Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756780AbcCRMni (ORCPT ); Fri, 18 Mar 2016 08:43:38 -0400 Received: from mail-cys01nam02on0068.outbound.protection.outlook.com ([104.47.37.68]:19331 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754672AbcCRMnc convert rfc822-to-8bit (ORCPT ); Fri, 18 Mar 2016 08:43:32 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Appana Durga Kedareswara Rao To: Laurent Pinchart CC: "dan.j.williams@intel.com" , "vinod.koul@intel.com" , Michal Simek , Soren Brinkmann , "moritz.fischer@ettus.com" , "luis@debethencourt.com" , Anirudha Sarangi , "dmaengine@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 2/7] dmaengine: xilinx_vdma: Add quirks support to differentiate differnet IP cores Thread-Topic: [PATCH 2/7] dmaengine: xilinx_vdma: Add quirks support to differentiate differnet IP cores Thread-Index: AQHRft9uIIYkSc3/zEaSaQlv3c5Bgp9ctriAgAJM6yA= Date: Fri, 18 Mar 2016 12:43:26 +0000 Message-ID: References: <1458062592-27981-1-git-send-email-appanad@xilinx.com> <1458062592-27981-3-git-send-email-appanad@xilinx.com> <1640685.GKdbz0bkAP@avalon> In-Reply-To: <1640685.GKdbz0bkAP@avalon> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.95.64] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22200.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(24454002)(377454003)(13464003)(189002)(199003)(52604005)(55846006)(1096002)(33656002)(50986999)(54356999)(50466002)(19580395003)(2900100001)(2920100001)(76176999)(5004730100002)(110136002)(46406003)(1220700001)(6116002)(4326007)(81166005)(92566002)(87936001)(6806005)(2906002)(11100500001)(102836003)(86362001)(5008740100001)(586003)(19580405001)(5250100002)(97756001)(47776003)(5003600100002)(189998001)(2950100001)(106116001)(23726003)(3846002)(63266004)(106466001)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1NAM02HT174;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-MS-Office365-Filtering-Correlation-Id: 9d73719c-65eb-4b52-f1f9-08d34f2ae8fc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:CY1NAM02HT174; X-Microsoft-Antispam-PRVS: <4a5568f282534391847cc230612c6fe2@CY1NAM02HT174.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13018025)(5005006)(13015025)(13017025)(8121501046)(13023025)(13024025)(3002001)(10201501046);SRVR:CY1NAM02HT174;BCL:0;PCL:0;RULEID:;SRVR:CY1NAM02HT174; X-Forefront-PRVS: 088552DE73 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2016 12:43:30.0483 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT174 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5467 Lines: 186 Hi Laurent Pinchart, Thanks for reviewing the patch. > -----Original Message----- > From: Laurent Pinchart [mailto:laurent.pinchart@ideasonboard.com] > Sent: Thursday, March 17, 2016 12:49 PM > To: Appana Durga Kedareswara Rao > Cc: dan.j.williams@intel.com; vinod.koul@intel.com; Michal Simek; Soren > Brinkmann; Appana Durga Kedareswara Rao; moritz.fischer@ettus.com; > luis@debethencourt.com; Anirudha Sarangi; dmaengine@vger.kernel.org; linux- > arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH 2/7] dmaengine: xilinx_vdma: Add quirks support to > differentiate differnet IP cores > > Hello, > > On Tuesday 15 March 2016 22:53:07 Kedareswara rao Appana wrote: > > This patch adds quirks support in the driver to differentiate > > differnet IP > > s/differnet/different/ Ok will modify In the V2. > > (and in the subject line too) > > With this series applied the driver will not be vdma-specific anymore. The > xilinx_vdma_ prefix will thus be confusing. I'd bite the bullet and apply a global > rename to functions that are not shared between the three DMA IP core types > before patch 2/7. Ok will modify the General API's that will be shared across the DMA's to the dma instead of vdma in the v2. > > > cores. > > > > Signed-off-by: Kedareswara rao Appana > > --- > > drivers/dma/xilinx/xilinx_vdma.c | 36 > > ++++++++++++++++++++++++++++++------ > > 1 file changed, 30 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/dma/xilinx/xilinx_vdma.c > > b/drivers/dma/xilinx/xilinx_vdma.c index 7ab6793..f682bef 100644 > > --- a/drivers/dma/xilinx/xilinx_vdma.c > > +++ b/drivers/dma/xilinx/xilinx_vdma.c > > @@ -139,6 +139,8 @@ > > /* Delay loop counter to prevent hardware failure */ > > #define XILINX_VDMA_LOOP_COUNT 1000000 > > > > +#define AXIVDMA_SUPPORT BIT(0) > > + > > /** > > * struct xilinx_vdma_desc_hw - Hardware Descriptor > > * @next_desc: Next Descriptor Pointer @0x00 @@ -240,6 +242,7 @@ > > struct xilinx_vdma_chan { > > * @chan: Driver specific VDMA channel > > * @has_sg: Specifies whether Scatter-Gather is present or not > > * @flush_on_fsync: Flush on frame sync > > + * @quirks: Needed for different IP cores > > */ > > struct xilinx_vdma_device { > > void __iomem *regs; > > @@ -248,6 +251,15 @@ struct xilinx_vdma_device { > > struct xilinx_vdma_chan > *chan[XILINX_VDMA_MAX_CHANS_PER_DEVICE]; > > bool has_sg; > > u32 flush_on_fsync; > > + u32 quirks; > > +}; > > + > > +/** > > + * struct xdma_platform_data - DMA platform structure > > + * @quirks: quirks for platform specific data. > > + */ > > +struct xdma_platform_data { > > This isn't platform data but device information, I'd rename the structure to > xdma_device_info (and update the description accordingly). Ok will modify in v2. > > > + u32 quirks; > > I don't think you should call this field quirks as it stores the IP core type. > Quirks usually refer to non-standard behaviour that requires specific handling in > the driver, possibly in the form of work-arounds. I would thus call the field type > and document it as "DMA IP core type". Similarly I'd rename AXIVDMA_SUPPORT > to XDMA_TYPE_VDMA. Sure will modify in the v2. > > > }; > > > > /* Macros */ > > @@ -1239,6 +1251,16 @@ static struct dma_chan > > *of_dma_xilinx_xlate(struct of_phandle_args *dma_spec, return > > dma_get_slave_channel(&xdev->chan[chan_id]->common); > > } > > > > +static const struct xdma_platform_data xvdma_def = { > > + .quirks = AXIVDMA_SUPPORT, > > +}; > > + > > +static const struct of_device_id xilinx_vdma_of_ids[] = { > > + { .compatible = "xlnx,axi-vdma-1.00.a", .data = &xvdma_def}, > > Missing space before }, did you run checkpatch ? Yes I ran check patch it didn't troughed any warning ok will fix in v2. > > As the xdma_platform_data structure contains a single integer, you could store > it in the .data field directly. Ok will fix in v2. > > > + {} > > +}; > > +MODULE_DEVICE_TABLE(of, xilinx_vdma_of_ids); > > + > > /** > > * xilinx_vdma_probe - Driver probe function > > * @pdev: Pointer to the platform_device structure @@ -1251,6 +1273,7 > > @@ static int xilinx_vdma_probe(struct platform_device > > *pdev) struct xilinx_vdma_device *xdev; > > struct device_node *child; > > struct resource *io; > > + const struct of_device_id *match; > > u32 num_frames; > > int i, err; > > > > @@ -1259,6 +1282,13 @@ static int xilinx_vdma_probe(struct > > platform_device > > *pdev) if (!xdev) > > return -ENOMEM; > > > > + match = of_match_node(xilinx_vdma_of_ids, pdev->dev.of_node); > > You can use of_device_get_match_data() to get the data directly. Ok will fix in v2 > > > + if (match && match->data) { > > I don't think this condition can ever be false. OK will fix in v2. Regards, Kedar. > > > + const struct xdma_platform_data *data = match->data; > > + > > + xdev->quirks = data->quirks; > > + } > > + > > xdev->dev = &pdev->dev; > > > > /* Request and map I/O memory */ > > @@ -1356,12 +1386,6 @@ static int xilinx_vdma_remove(struct > > platform_device > > *pdev) return 0; > > } > > > > -static const struct of_device_id xilinx_vdma_of_ids[] = { > > - { .compatible = "xlnx,axi-vdma-1.00.a",}, > > - {} > > -}; > > -MODULE_DEVICE_TABLE(of, xilinx_vdma_of_ids); > > - > > static struct platform_driver xilinx_vdma_driver = { > > .driver = { > > .name = "xilinx-vdma", > > -- > Regards, > > Laurent Pinchart