Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753913AbbFXRMk (ORCPT ); Wed, 24 Jun 2015 13:12:40 -0400 Received: from mail-bn1on0072.outbound.protection.outlook.com ([157.56.110.72]:35488 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753189AbbFXRMR convert rfc822-to-8bit (ORCPT ); Wed, 24 Jun 2015 13:12:17 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Appana Durga Kedareswara Rao To: Vinod Koul CC: "dan.j.williams@intel.com" , Michal Simek , Soren Brinkmann , Anirudha Sarangi , Punnaiah Choudary Kalluri , "dmaengine@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Srikanth Thokala Subject: RE: [PATCH v5 2/2] dma: Add Xilinx AXI Central Direct Memory Access Engine driver support Thread-Topic: [PATCH v5 2/2] dma: Add Xilinx AXI Central Direct Memory Access Engine driver support Thread-Index: AQHQopEJXzrIiVGHLkioqI+BsmdY+p233XmAgAQTGhA= Date: Wed, 24 Jun 2015 17:12:12 +0000 Message-ID: References: <1433839690-5491-1-git-send-email-appanad@xilinx.com> <20150622101527.GB19530@localhost> In-Reply-To: <20150622101527.GB19530@localhost> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.231.165] 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-21630.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD016;1:nvNMuwPz233PCQiEAAPz3ZAmRVjY6Jt1D619yBmuIPgEtb9Y/Dkh6HzTUcxCt/Sd+OXJrPUiICzkQ8do0hgtKhn2w+p/fIvhJoA+owEhRP/pOXdvnWpbALfmJyFGoh2omzgjN55z5skBlJwB53UdiAet/3EUwolTUGpiyKH+os1EsOXAIpexSjVlvNDyNOEkZxz8Ss5RQ/UemKn4TVDA1Hz8Lig5xap6ZnAY0xIlDWANAFnNTYQDl4rf80wX/S8CpQTw/hQMdgar/1zutBSoRTs9l2HKxnGw9wJSgktcsJIXGkclSso9dgWX1sYvevNfcyhvDPgd1LYgK9urssj5+w== X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(43544003)(51704005)(51914003)(24454002)(377454003)(13464003)(47776003)(50986999)(86362001)(54356999)(5001960100002)(189998001)(107886002)(110136002)(5003600100002)(6806004)(63266004)(46406003)(2920100001)(76176999)(92566002)(2950100001)(2900100001)(102836002)(5250100002)(19580405001)(19580395003)(2656002)(5890100001)(97756001)(23726002)(55846006)(106116001)(46102003)(50466002)(33656002)(106466001)(77156002)(62966003)(87936001)(21314002)(107986001)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2FFO11HUB028;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11HUB028;2:RIj4/Ifxwzt3/3HriJMvXslUUu9hwJvV+c/wYoRD49DCPSvNJUGGt3fBONvGfFlA;3:mWA3eGkbyHO7ACOt3J8L7F1ZxChzj+U56JuDO3yUwWj3RM4YrBWj3t+zU/sJ5zu+lYN15F6raOFo5wcy7+72h14NKRz6V1+l+m6C70VD1BxBgBmSWIg8OuLZrdklYXdcD95tSlA+okUzIKIFQOGhPOw9YW0yaYKMRBi50BrUo3vfpvIxgRh/+mm0gRzYX1h5al0QghU26FqY+ZP9Sw9d+hzMiLOm8pGNtK839acTEHBU3l6/8sEr6RQ+5MssSZzx4Di81Kt8ZvbxnUwnDFKoUw==;20:hL5U32ZJJZz/l9wo9MfF/9LDAmDgUAC6g4Fo0VOKQEBqRaneEDhQ1QimxFaZSHezT479IrWiJFOHvivs67npnFseIYzbEF5zYR482NZX/v2mhPbE3RuYtebaVS+axAoHb5+bsLK+G/K4Ens7YViweITfvkQR3JW98uyj5u98tpP6Dtvgneqf+Pp+aTbT0J4JpTNKy5OeI8qNH1ap+NuB5yxYRR3CQJM1Ki08BPmcUQncHLhqraB/lXqsYX7Ovi04pDEpIXKAHwNnLDW2wS9Tbq3D1axSfeB0BFEJKRbLLkaISWJ/yXiSwmoHhjtGsnZjSF6AeGi+Dt0U7iD3pjNAD7+RYfG6zSHMHWxcfA8Bmqm5BAnVRlgpVW3HvXpCfz/QGGYDsouqXWyAKHYsFZWAAdYeKecVI3DwX6F+OD/LT/tQEti39go/6k8FR7LuMAhvIostVEmj9GnSmaFASX9BbX0YSyBuTkPQsgebNitEtryp1s01VZMFpuWG1cWx65kH X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(42134001)(42139001);SRVR:BL2FFO11HUB028; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BL2FFO11HUB028;BCL:0;PCL:0;RULEID:;SRVR:BL2FFO11HUB028; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11HUB028;4:gO1Cxu4fRshghQNGKeipkD9K+41ZblmBjPx+x0cG33mHs7JILPlpAKQFr1+ArkiFrnRLDkW+2pc+owmJReDesPd/6PFcRcdUkJaEX5ySdXsPsP1KymZJXc30RIW9vHhpgfAcdC7goLHiEjaRn3oRq3Vx3oslSj0m/wy3FHEEFyM/aV0ZACb49e+AbudcXi81Uw4fz4jNbR2Gy4zZyewv4zSXlxPlnZjEMvJNaB/IvRyPSRrRnhXqd3Al7/9OCQChHuIJLjLNqF4fi/EE5onA7bj/FLRZLCG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czNBBy0PXo2w?= =?us-ascii?Q?wjA0+7kPN7SOMLxP96/3uJmo3aCm9PS7hjMBgCF21OfIhLVZUOx+3YsKaUGy?= =?us-ascii?Q?3yrQKg/+Haic7ZgarV9/uJ80HWSqaSfqSyIDh0HH3OwFhSctsvHH8DxQe/N+?= =?us-ascii?Q?YyLmlngio+aUVKgo2R9/6gIokF0q0KYSSjM4piA5nrbVREmRBUXdyRf4TtEq?= =?us-ascii?Q?IT0qTFBYRhRbUnRY4Wps2nERt/B/vtV8/YxtJtDr2lkEt2Ok0hipydR9evNX?= =?us-ascii?Q?78YD9CBGIG/sY4Ce0+Cg19UNszoD9h6sfkUDrDqCRVpCiBlpOC5c7zOxxjtM?= =?us-ascii?Q?jbydGeTOu6vxyYmi4bfyuqZ+V8LzjriHeLxQWAlfiCiyTEpygcMfQbTvtn9/?= =?us-ascii?Q?hx6kCj9c5ZRtHqefB3hehplSLoTP8GxgDTQXc+tnGG0AcMGHMM5I2wFodw?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11HUB028;5:tMK2guzH/zCZZpbgYJ5+7mPUTKCzBBExB29CZFwlNpEFAGKwUV4IEPTXpIonrNkB1L1Jq7BH141WrNq4UW+5i+bgv+tsczoYAFdqOzxfs3qa9iuJ5vtbsv/YRpDfPsNC4k88AtitVVc3QtJpb3cvcw==;24:clv5yz5yQbltoAHZ/J6RTkg6RglUPsnycSsrFbfjA5OAh64Nz+wIQV611TJng9z9FLHdTCSZlDS2RXhfHbf95LejFtyZmGItM86ylHG3HJU= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2015 17:12:15.8126 (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.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2FFO11HUB028 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5335 Lines: 156 Hi Vinod, > -----Original Message----- > From: dmaengine-owner@vger.kernel.org [mailto:dmaengine- > owner@vger.kernel.org] On Behalf Of Vinod Koul > Sent: Monday, June 22, 2015 3:45 PM > To: Appana Durga Kedareswara Rao > Cc: dan.j.williams@intel.com; Michal Simek; Soren Brinkmann; Appana Durga > Kedareswara Rao; Anirudha Sarangi; Punnaiah Choudary Kalluri; > dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux- > kernel@vger.kernel.org; Srikanth Thokala > Subject: Re: [PATCH v5 2/2] dma: Add Xilinx AXI Central Direct Memory > Access Engine driver support > > On Tue, Jun 09, 2015 at 02:18:10PM +0530, Kedareswara rao Appana wrote: > > pls conform to the subsystem naming convention which git log on subsystem > should have told you that it is dmaengine: xxx...... Ok Sure will take care of it in the next version of the patch. > > > This is the driver for the AXI Central Direct Memory Access (AXI > > CDMA) core, which is a soft Xilinx IP core that provides > > high-bandwidth Direct Memory Access (DMA) between a memory- > mapped > > source address and a memory-mapped destination address. > > > > This module works on Zynq (ARM Based SoC) and Microblaze platforms. > > > > Signed-off-by: Srikanth Thokala > > Signed-off-by: Kedareswara rao Appana > > --- > > This patch is rebased on the commit > > Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net > why a random, unrelated commit? and no mention of tree.. Ok will fix in the next iteration of the patch. > > > +static struct dma_async_tx_descriptor * > > +xilinx_cdma_prep_memcpy(struct dma_chan *dchan, dma_addr_t > dma_dst, > > + dma_addr_t dma_src, size_t len, unsigned long flags) > { > > + struct xilinx_cdma_chan *chan = to_xilinx_chan(dchan); > > + struct xilinx_cdma_desc_hw *hw; > > + struct xilinx_cdma_tx_descriptor *desc; > > + struct xilinx_cdma_tx_segment *segment, *prev; > > + > > + if (!len || len > XILINX_CDMA_MAX_TRANS_LEN) > > + return NULL; > > + > > + desc = xilinx_cdma_alloc_tx_descriptor(chan); > > + if (!desc) > > + return NULL; > > + > > + dma_async_tx_descriptor_init(&desc->async_tx, &chan->common); > > + desc->async_tx.tx_submit = xilinx_cdma_tx_submit; > > + async_tx_ack(&desc->async_tx); > and why are you doing this ? Ok will remove. > > > +int xilinx_cdma_channel_set_config(struct dma_chan *dchan, > > + struct xilinx_cdma_config *cfg) > > +{ > > + struct xilinx_cdma_chan *chan = to_xilinx_chan(dchan); > > + u32 reg = cdma_read(chan, XILINX_CDMA_CONTROL_OFFSET); > > + > > + if (!xilinx_cdma_is_idle(chan)) > > + return -EBUSY; > Why cant it be like dma_slave_config and take effect on next descriptor > prepare? Will fix this part. > > > + > > + if (cfg->reset) > > + return xilinx_cdma_chan_reset(chan); > Why do you want to reset this externally, that sounds bad to me If someone (client driver) want to reset the controller externally. It will be useful right? > > > + > > + if (cfg->coalesc <= XILINX_CDMA_COALESCE_MAX) { > > + reg &= ~XILINX_CDMA_XR_COALESCE_MASK; > > + reg |= cfg->coalesc << XILINX_CDMA_COALESCE_SHIFT; > > + } > Can you explain what coalesc means here? Coalesc means interrupt threshold This value is used for setting the interrupt threshold. When IOC (interrupt on complete) interrupt events occur, an internal counter Counts down from the Interrupt Threshold setting. When the count reaches zero, an interrupt out is generated by the DMA engine. This will be useful in case of SG transfer. > > > + > > + if (cfg->delay <= XILINX_CDMA_DELAY_MAX) { > > + reg &= ~XILINX_CDMA_XR_DELAY_MASK; > > + reg |= cfg->delay << XILINX_CDMA_DELAY_SHIFT; > > + } > > + > > + cdma_write(chan, XILINX_CDMA_CONTROL_OFFSET, reg); > Shouldn't you save it apply for a descriptor? Currently I am not making efficient use of it will use take care of it. > > + > > + return 0; > > +} > > +EXPORT_SYMBOL(xilinx_cdma_channel_set_config); > not EXPORT_SYMBOL_GPL? Ok will modify. > > > > +static int xilinx_cdma_chan_probe(struct xilinx_cdma_device *xdev, > > + struct device_node *node) > > +{ > > + struct xilinx_cdma_chan *chan; > > + bool has_dre; > > + u32 value, width; > > + int err; > > + > > + /* Alloc channel */ > > + chan = devm_kzalloc(xdev->dev, sizeof(*chan), GFP_NOWAIT); > Why do you use GFP_NOWAIT in probe? Ok will fix in the next version of patch. Thanks for the review. Regards, Kedar. > > -- > ~Vinod > > -- > To unsubscribe from this list: send the line "unsubscribe dmaengine" in This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately. -- 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/