Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbbHNSm3 (ORCPT ); Fri, 14 Aug 2015 14:42:29 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:33190 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735AbbHNSm1 (ORCPT ); Fri, 14 Aug 2015 14:42:27 -0400 MIME-Version: 1.0 In-Reply-To: References: <1439487452-23977-1-git-send-email-atull@opensource.altera.com> <1439487452-23977-5-git-send-email-atull@opensource.altera.com> Date: Fri, 14 Aug 2015 11:42:25 -0700 Message-ID: Subject: Re: [PATCH v10 3/8] add fpga manager core From: Moritz Fischer To: atull Cc: Greg KH , Jason Gunthorpe , hpa@zytor.com, Michal Simek , Michal Simek , rdunlap@infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Pantelis Antoniou , robh+dt@kernel.org, Grant Likely , iws@ovro.caltech.edu, linux-doc@vger.kernel.org, pavel@denx.de, broonie@kernel.org, Philip Balister , rubini@gnudd.com, s.trumtrar@pengutronix.de, jason@lakedaemon.net, kyle.teske@ni.com, Nicolas Pitre , balbi@ti.com, m.chehab@samsung.com, David Brown , Rob Landley , davem@davemloft.net, cesarb@cesarb.net, sameo@linux.intel.com, akpm@linux-foundation.org, Linus Walleij , pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, Kumar Gala , devel@driverdev.osuosl.org, Petr Cvek , Alan Tull , yvanderv@altera.com, dinguyen@opensource.altera.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2594 Lines: 70 Hi Alan, On Fri, Aug 14, 2015 at 8:46 AM, atull wrote: > On Fri, 14 Aug 2015, atull wrote: > >> On Fri, 14 Aug 2015, Moritz Fischer wrote: >> >> > Hi Alan, >> > >> > I've updated my Zynq driver (it can be found in an older version >> > against your v8 in the Xilinx tree, too) >> > >> > https://github.com/mfischer/linux/tree/alan-fpga-mgr-v10 >> >> Since we are both already using this and have been for a while now, I hope it >> can go up into the mainstream instead of continuing to exist only in Altera >> and Xilinx's git trees. Yeah, that was definitely my intention. I just held off submitting my driver for mainline, because your patchset was still sort of a moving target. And that would be like the 3rd layer of dependencies :-) The reason for inclusion into the Xilinx tree was so people can play around with it already. >> > > Hi Moritz, > > I fetched your git tree and took a look at your low level driver. > > I had a some feedback. write_complete() is a blocking call, waiting for the > FPGA to go into operating state and timing out (ETIMEDOUT) if necessary. The > fpga-mgr.c framework is assuming that when write_complete exits with status 0, > that means that the FPGA is in operating state. That's why it's proper for us > to add "mgr->state = FPGA_MGR_STATE_OPERATING" after write_complete returns > success as you noted. My suggestion is that your write_complete() should check > status in this way. Whatever error codes it returns will get propagated. Fair enough, I had misunderstood the API then :-) Another option would have been to have the sysfs function actually query the state function instead of using the cached mgr->state value. I'll fix my driver ;-) I'll probably do something like #define zynq_fpga_poll_timeout(priv, addr, val, cond, sleep_us, timeout_us) \ readl_poll_timeout(priv->io_base + addr, val, cond, sleep_us, \ timeout_us) > > Also, I'm wondering how the simple-fpga-bus stuff looks to you now that you've > had it for a little while. To be honest I haven't played much with it aside from making sure it works. I had to submit another patchset for the Zynq's reset controller to make it work. The whole dt overlay is pretty cool, but the syntax took some getting used to. > > Thank, > Alan Thanks for your feedback, Moritz -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/