Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753575AbbGWQgB (ORCPT ); Thu, 23 Jul 2015 12:36:01 -0400 Received: from mail-bn1bon0093.outbound.protection.outlook.com ([157.56.111.93]:52032 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752255AbbGWQfv (ORCPT ); Thu, 23 Jul 2015 12:35:51 -0400 Authentication-Results: spf=fail (sender IP is 66.35.236.236) smtp.mailfrom=opensource.altera.com; infradead.org; dkim=none (message not signed) header.d=none; Authentication-Results: ettus.com; dkim=none (message not signed) header.d=none; Date: Thu, 23 Jul 2015 11:28:56 -0500 From: atull X-X-Sender: atull@linuxheads99 To: Moritz Fischer CC: Greg KH , Jason Gunthorpe , , Michal Simek , Michal Simek , , , , , Pantelis Antoniou , , , , Nicolas Pitre , , , Grant Likely , David Brown , Linus Walleij , , , , , , , Philip Balister , Petr Cvek , , , , , Alan Tull , , Rob Landley , Kumar Gala , , , Subject: Re: [PATCH v9 5/7] staging: fpga manager core In-Reply-To: Message-ID: References: <1437148277-5405-1-git-send-email-atull@opensource.altera.com> <1437148277-5405-6-git-send-email-atull@opensource.altera.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: BY2PR05CA055.namprd05.prod.outlook.com (10.141.250.45) To BLUPR03MB1506.namprd03.prod.outlook.com (25.163.81.24) X-Microsoft-Exchange-Diagnostics-untrusted: 1;BLUPR03MB1506;2:hVjfm02QbpzmuSDnyOLY+PyK31a6LgoWyCKaFUzKrDylMezw/6ZnxAMLWSupQtsf;3:ll7iu4ZJtGVqiVrXHVnk1WG3zGDcr8IMYSvEA8JBbWH9wNy64qbJTVDs9JYwGZ8vKAwFwyaYldHNwyzg+EUv+JYgptcGpaJjpu3c2Y8rWimh9W1CoqLH4dy/Xtjgm4KTvmtUAMOWwObTS5uLeR2hXg==;25:wIH0XKgz/9KyDTOa8Ni/d/CHEa26HjU+6eR3vo9qVfyyKeeryIHaL7offRIUO2n2tp5nG2dupDTzxOO3JraE9F4nd7vD6kauv4QTV1Yu1ppse6aTUhyYGWhmSzjI6qtI+9lcm++FIvG/qQTwEkiig16Tv++q523cJ0RO3DHMyOcR5IsitXqhKzyehVH6Xc3Bi5kT1cRnVqGGPr6Fyd5SrHbmcMtA7KJ/tw98QP7ITH+jmDHcRPezNZ3GC/8mT4bs;20:DSVORfQx3PxGdpsh3zp4w4ed98Uaevh+EuvOiFIu0qVm5Vt2DswmGZiteXNuAhBCujqL02gA+PVinF+UUerIK3LI0qtBjwUIg6A77irz1kexF6DaQgUMXydA3a9hqnDdW2ZrCfMLIiVfIvz/6HceBPBDRa7OshfQUeW4z2lhMq4=;4:VewMPBk0ycKoVmqsqnfwCMc0WIFOlELshOuqSGUvaf93HXhYF9K+7S/Y0IwSPoVCmD9SLVdIe2ZF0Jgf9DU1eKfMQCjbSDkaj677qwvSlYB9td0suZtc3glbkd9F5gSkiHNLmhE0sl4csl8P+rfnHAXj2M6aYBtWoG5+kRPRiV4cgzGoORInbHoVEn9qt0jSjzyRZOegyKwrNEJChHCq91gm5uVkIjHzZV06GHQx92UZXhGQgEmvTROIsy/FLaZwGaNfVFGwmNhhg7kVb81uKREGgzns6ZMcqlHpcvqgsoY= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1506;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB233; BLUPR03MB1506: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BLUPR03MB1506;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1506;BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN1PR03MB233;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB233; X-Forefront-PRVS: 06469BCC91 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(24454002)(19580405001)(33716001)(77096005)(86362001)(2950100001)(19580395003)(122386002)(86152002)(189998001)(87976001)(40100003)(53416004)(50466002)(46102003)(83506001)(66066001)(110136002)(62966003)(23726002)(5001960100002)(92566002)(4001350100001)(47776003)(42186005)(46406003)(76176999)(50986999)(54356999)(77156002)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR03MB1506;H:linuxheads99.altera.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: 1;BLUPR03MB1506;23:kpEr8IQcTEh2UWBN6KyLWbcUnzszHiE9BCOQ4gBg/YMHYd6lb/Zmtfwg7IzOx9TS8mOXafVk0yY3Oe3Cf9F6BdivkLhebQzPSLtBeIClgL+z0ymAh5L9ljtgycVHjpeO4H0oBMOhmOFFAGNGwqwrjdwRVTt9VzmQYAM/OXPflvHGcIbw8we5qcXPmPU2KRzY/HNpopoIWUCJJsg6sJvJIucdXeBk5PcaLnqyPxZspjfUy2awrURfwrn+JW66CteTf8zp0nUTU6Mv6BW/OUIt+LXpVXlxEknOjPn8ZKSB4Y4HBgseI9z2EU79ulVCpVL3u0dgBzskfLLcWDepx5Ac1qdksyRAYkiXB5gNXCbcY4s03R+hKv5wD/raf/yIvBHE+F8Vgj0ES42yA3/J4v3kiY8qoOQhtkEzwkqLjciDiTAeabTId9xt0QafDFTtt5NJ1tiEaMUvwyEu7byamMbj2/WXVExGrch/M3KyLDh2Y4S6bWTQ9JAe3egpQ6XVRhVvqmELaRvErJrAS8/bVOx1RFH0v3Bq8QBta9yIOOC7smgg2Rn0d51c/kuYl6SndaV75sTI/lBx4O2Keok7d6ZALFwgpiQHERixcL+LVWfIeN2Gr0qhf8FphYpE5qCqefmivvw9570e03+tAmrqgtxkwilPyEhYvY4kOtt6Bn2fvQDtzqcF6+6b72SaiPjZZGM/rgHbmSq9K+y4aDGJTIdFQuOYBUHUlqyVIDRw7zsJGeoxamXlrr8u+zwqKiGmS4ABcj2uiKRLD2SKj5WbQv6p5bwksCoDddH7tIg1EVNCSRdHFo1YqARahNP0GIIAxshH0vXOlp5dB301bmqVG6N4EzL0MzeHjxqKr0INtK54kY97c3LKefo0ESu3RfLRPXVKEWtR0d3+FEP0mxqWm/L6nA== X-Microsoft-Exchange-Diagnostics-untrusted: 1;BLUPR03MB1506;5:fCPjg5eun0iWTRJftLw88lrycz/AwFSM7vOFmg0THQXQwyD9pG/M0BEX3TPaA03nrmJVWovEpZIyfbPFUHh4h9y2Lj68lZrIZPp05Uqfz+iouESZVfUKYk6uYl3Mtes+TDCt3Ie630q0HFQ6Dqt1zg==;24:aMZtWiPENT6DxYJKApif/Iut6ACcOaaMzBxygQ5TlaN1GhifCsGT5zcLlEz3wExW2Zn96zwsbxA4AjiWhfrqws6FAWtAOdblhRG239T/sc4=;20:gQ/x4Y6QNZEGcVQ63TdzQ4sLArKME/RyV+/th8U/k3DdVoshnruJlh7iKPeJ+zAclakrLJSJAKpIf55frYPtj4qib2ycjm/1JzqQGcz4nPhcKn0ZQf/DnBnumnY9eiTf4phFaiuQU8b60UVvby5KfYmPaVPnTe29E34uW5sjzAI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1506 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BY2FFO11FD004.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD004;1:5RJgsN2en1ZsQ2KMekz6CLFMJlw4gzoi/HfPzB+WsYGVvNx8KtcT/D3gGKgeUibj0LuYKR8y134QlW/R8iHCaeNlt3Y/qCgDw7WlB8etMW/4vG6VOwKMAyOo6zcIi/v6SmKM0SYRPonNGUZKYcYe7H1n7K42idQILy6VTbyPOfV8HQDvCw93UKXX5yLslNr/D8XG3bpj3lDwvzmq7dGiCAIBD5fNju9YN+WQ2PckZ1WPKuHg9tp+9GXko0zwgrDvtwhshzX2abNYm/rotf66OjMUIj0Wy2AdYUwF0RF1SJK2dmq6eJmgHwuuPXyRPOuCaCbIL0nRJ5WIKdFhyZIfFA== X-Forefront-Antispam-Report: CIP:66.35.236.236;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(339900001)(189002)(199003)(24454002)(377454003)(2950100001)(6806004)(105606002)(53416004)(19580405001)(85426001)(92566002)(50466002)(4001350100001)(106466001)(86152002)(47776003)(77096005)(76176999)(86362001)(110136002)(87936001)(19580395003)(46406003)(50986999)(16796002)(189998001)(46102003)(77156002)(66066001)(122386002)(62966003)(5001960100002)(40100003)(54356999)(23726002)(83506001)(33716001)(7099028)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1PR03MB233;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;MLV:sfv;MX:1;A:0;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB233;2:WstYsg0PzbmpUE+3+uFmsVGWcPlcCzPuYxqe3qMIg29QYTxkF5nQxKS5BmMevLOk;3:2kTDsnWY8qMnPthpqa7+NlJJmZqmXyBJGh8ycXwW2sh8R2SJZq/rPFfE+iikkYFVU+xXeeWAzbZECQCndaShY8NU6zNDe3UsdRjtuWrkyH4QB1oiI8qk5rhRxesvCJlq1My7HXM2AHba6I1bv/e7pWGQuZRWf4qIVCBZVFu+WgsYITDzlc4yjrNk/d93LV3+B67Y1rNV3yf+Aq9HsNTlxrZlKfmzyqZw0IdNS8aI6jE=;25:RHJufK+lVbI4V+4NMZ3QB+/WmGtOV/HV5JCu9cuh32AzrNChcf2HJB5GKIEaOZWfjF8UqK4YmcIP6i2ozS4CvAtDk7NvaRJRsNzbeuwzKzKzQeNQ4Gg/LfTROh8Kr8a/uc4fOYv2S5XahjEXAYTiRIuHbevunGzQ066R6C5t/ARgA8685bBb4MqqeXVFB/ipIrFzQMx5A1AoQvXaC4sNb6tiPCEfj7F+BJ3EW86d0BZzIPDqDBzZoOVzeQzd/CqX;20:3mPN2AdWGutzQFhOE+js+UIlCqZ1MM5AP4YdW4L1bChxqrYydMd1oP9CbuRwG4KqyHlU5xHtkISrUs4FoJe7TkafrWQyv0w1v3QcQqV5unRXRv+0j4FdQac+E49PcIFdGmcrrgvt68VOTiIui+Z7OzlyvoksOtv5y9Y0o2JvDuY= BN1PR03MB233: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB233;4:2wRm0LCGMmCF3fgmAkGztVJ04QI3dlAx/sol6qLoCNFsObraEvY56dS6JYsorbz5fqQv5DLI0TPNBiiKZeGWRP+nkgTIhNJ6Xk3FWhcSApnXSfznPUK8sPbBEvREP5fWj9QYxh8bs53cuN7NQfj+z0SIgQoWEzV9Hd2dHGCrAhe2LJY1CSFQskSNTs9VnPk7Q+RoYWc7BH0tUibJaEIdwCJZJbBge3lEoqXG0MF+SIYf3T2KcxI4WBmQCSoEXEmy4CiZxXo8Yx9Ekc1VZneolzKJexI+xO3ITKu/5miaEb8= X-Forefront-PRVS: 06469BCC91 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1PR03MB233;23:azvrQYSG4yGooWVZLQJDMnXq07wmToDNYGzUpfSPYC?= =?us-ascii?Q?ggkB3CFgBumaLC24491m9YfYR/vpwzlernZI6GUKswpPce3U74M1v7z/pdHo?= =?us-ascii?Q?Iayqkbm/WkPehajCCZbYzjcXZxbIrxsVMeVwXeD3gC6UZ1UMXlR5PAZ255ze?= =?us-ascii?Q?H9ZGaqO5V+S+7Oce/8/N6LRylxj+4cBBWIJK9/LVjXDxjj/hAp/+455Jt0NW?= =?us-ascii?Q?UpNicuat3GBUZTFb/BSOy5DV1u5cqNgbYIY+3+bnjIplROo4SPtBOtGdFrfc?= =?us-ascii?Q?uspmcgDGipuj9BIkNB85KvxrNVsWLG7JvKsnEYCcBPH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gJBKF6FVhc/JhTw81El5vdaaUIHis/D1T+pyuJYRQETsCawO0cVfuObMU8X9NoIEG8WZHKA==;24:gAOND24i6oXVrgneH23EL+8lyOMUmOK3EQUtPaJxI3gyYlnft7IeqzomHEu/j8YXrMNah1QwBAdolxirNCmuEPI/zTPhyTA2Np/Ft1JC/Zk=;20:vvfCuqFlh+BtlMVZUHjiIZQgplKOXYBnwjOeVQNb/fIm96Pa9wfBik5uPq39ZwEAwP+i1HkLu4Tv5jlmshQ6MxdigCjrOxqhRQgk8N0tGJnBLXMkEB8oYFGDWLOIsYgwTQGCwQQ6VjAPUKyJLUY+TGbfzWoBbTkHsp70ZFlH1fI= X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2015 16:35:48.2669 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a;Ip=[66.35.236.236];Helo=[sj-itexedge04.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR03MB233 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2579 Lines: 79 On Wed, 22 Jul 2015, Moritz Fischer wrote: Hi Miritz, > Hi Alan, > > a couple of small things I found while reworking the Zynq version to > match the v9 patchset: > > On Fri, Jul 17, 2015 at 8:51 AM, wrote: > > From: Alan Tull > > ... > > + ret = mgr->mops->write_complete(mgr); > > Could we pass in flags here? This way the driver wouldn't have to keep > track of the flags. For my case it would simplify the partial reconfig > case. Yes, that change will be very simple and makes sense to me. > > +/* > > + * FPGA Manager flags > > + * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported > > + */ > > +#define FPGA_MGR_PARTIAL_RECONFIG (1) > Could this be BIT(0) instead? Yes, ha. That's what it should have been. > > + > > +/** > > + * struct fpga_manager_ops - ops for low level fpga manager drivers > > + * @state: returns an enum value of the FPGA's state > > + * @write_init: prepare the FPGA to receive confuration data > > + * @write: write count bytes of configuration data to the FPGA > > + * @write_complete: set FPGA to operating state after writing is done > > + * @fpga_remove: optional: Set FPGA into a specific state during driver remove > > + * > > + * fpga_manager_ops are the low level functions implemented by a specific > > + * fpga manager driver. The optional ones are tested for NULL before being > > + * called, so leaving them out is fine. > > + */ > > +struct fpga_manager_ops { > > + enum fpga_mgr_states (*state)(struct fpga_manager *mgr); > > + int (*write_init)(struct fpga_manager *mgr, u32 flags, > > + const char *buf, size_t count); > > + int (*write)(struct fpga_manager *mgr, const char *buf, size_t count); > > + int (*write_complete)(struct fpga_manager *mgr); > See comment above, having the flags here would be very convenient for > my usecase. Yes > > + void (*fpga_remove)(struct fpga_manager *mgr); > > +}; > > + ... > > Overall looks pretty good. I still need to look at the bridge part, > currently I have the resets and level shifters in the zynq-fpga > driver, > but maybe breaking them out makes sense. > > Cheers, > > Moritz > Thanks for the review. I'll probably send out a v10 next week including your recommendations. Alan -- 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/