Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752829AbcCYJRO (ORCPT ); Fri, 25 Mar 2016 05:17:14 -0400 Received: from mail-cys01nam02on0066.outbound.protection.outlook.com ([104.47.37.66]:23719 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752275AbcCYJRL convert rfc822-to-8bit (ORCPT ); Fri, 25 Mar 2016 05:17:11 -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;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Appana Durga Kedareswara Rao To: Laurent Pinchart , Anurag Kumar Vulisha CC: Vinod Koul , Rob Herring , "Pawel Moll" , Mark Rutland , "Ian Campbell" , Kumar Gala , Michal Simek , Soren Brinkmann , "Dan Williams" , "afaerber@suse.de" , Maxime Ripard , Anirudha Sarangi , Srikanth Vemula , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "dmaengine@vger.kernel.org" Subject: RE: [PATCH v2] dmaengine: vdma: Add 64 bit addressing support to the driver Thread-Topic: [PATCH v2] dmaengine: vdma: Add 64 bit addressing support to the driver Thread-Index: AQHQ4N/+gAo3wshFU0aBDjxaTrQTU55GxH4AgAMYNACBGvXcAIAGWP5g Date: Fri, 25 Mar 2016 09:17:03 +0000 Message-ID: References: <1440690558-39822-1-git-send-email-anuragku@xilinx.com> <20150921155712.GN2381@localhost> <3802E9A6666DF54886E2B9CBF743BA9801C08CA1@XAP-PVEXMBX01.xlnx.xilinx.com> <3681371.njDCZ2OU0Q@avalon> In-Reply-To: <3681371.njDCZ2OU0Q@avalon> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.95.210] 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-22218.003 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(24454002)(377454003)(164054003)(189002)(43544003)(13464003)(199003)(3846002)(189998001)(23726003)(6116002)(102836003)(5004730100002)(5008740100001)(50466002)(11100500001)(4001450100002)(586003)(87936001)(106116001)(5001770100001)(19580395003)(1096002)(5250100002)(1220700001)(6806005)(106466001)(19580405001)(63266004)(33656002)(5003600100002)(2900100001)(2950100001)(92566002)(86362001)(54356999)(2906002)(4326007)(50986999)(46406003)(76176999)(2920100001)(97756001)(55846006)(81166005)(47776003)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2NAM02HT086;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-MS-Office365-Filtering-Correlation-Id: 948b6239-8ea3-4213-b321-08d3548e3dae X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:BL2NAM02HT086; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(13023025)(13024025)(13015025)(13018025)(13017025)(3002001)(10201501046);SRVR:BL2NAM02HT086;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT086; X-Forefront-PRVS: 0892FA9A88 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2016 09:17:08.3664 (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: BL2NAM02HT086 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3525 Lines: 99 Hi Laurent Pinchart, > -----Original Message----- > From: Laurent Pinchart [mailto:laurent.pinchart@ideasonboard.com] > Sent: Monday, March 21, 2016 9:48 PM > To: Anurag Kumar Vulisha > Cc: Vinod Koul; Rob Herring; Pawel Moll; Mark Rutland; Ian Campbell; Kumar > Gala; Michal Simek; Soren Brinkmann; Dan Williams; afaerber@suse.de; Maxime > Ripard; Appana Durga Kedareswara Rao; Anirudha Sarangi; Srikanth Vemula; > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux- > kernel@vger.kernel.org; dmaengine@vger.kernel.org > Subject: Re: [PATCH v2] dmaengine: vdma: Add 64 bit addressing support to the > driver > > Hi Anurag, > > On Wednesday 23 Sep 2015 15:12:36 Anurag Kumar Vulisha wrote: > > On Monday, September 21, 2015 9:27 PM Vinod Koul wrote: > > > On Thu, Aug 27, 2015 at 09:19:18PM +0530, Anurag Kumar Vulisha wrote: > > >> This VDMA is a soft ip, which can be programmed to support > > >> 32 bit addressing or greater than 32 bit addressing. > > >> > > >> When the VDMA ip is configured for 32 bit address space the > > >> transfer start address is specified by a single register. > > > > > > would be good to specfiy which one > > > > Will change this in v3 > > What happened to v3 ? :-) I have sent it today. Thanks, Kedar. > > > >> When the VDMA core is configured for an address space greater than > > >> 32 then each start address is specified by a combination of two > > >> registers. The first register specifies the LSB 32 bits of address, > > >> while the next register specifies the MSB 32 bits of address.For > > >> example,5Ch will specify the LSB 32 bits while 60h will specify the > > >> MSB 32 bits of the first start address.So we need to program two > > >> registers at a time. > > > > > > can we have spaces after full stops and commas! > > > > Will take care of this in v3 patch. > > > > >> +/* Since vdma driver is trying to write to a register offset which > > >> +is not a > > >> + * multiple of 64 bits(ex : 0x5c), we are writing as two separate > > >> +32 bits > > >> + * instead of a single 64 bit register write. > > >> + */ > > > > > > This is not kernel style for multi-lines, pls refer to > > > Documentation/CodingStyle > > > > Will address this in v3 patch > > > > >> + > > >> +static inline void vdma_desc_write_64(struct xilinx_vdma_chan > > >> +*chan, > > >> u32 reg, > > >> + u32 value_lsb, u32 value_msb) { > > >> + /* Write the lsb 32 bits*/ > > >> + writel(value_lsb, chan->xdev->regs + chan->desc_offset + reg); > > >> + > > >> + /* Write the msb 32 bits */ > > >> + writel(value_msb, chan->xdev->regs + chan->desc_offset + reg + > > >> + 4); > > > > > > why not writeq > > > > We are trying to write at a register address(ex:0x5c) which is not > > aligned on 8 bytes boundary.So if I try to use 64 bit write on > > it,unalignment fault is getting generated.To avoid that we are using > > two separate 32 bit writes. We had this discussion in previous > > versions of this patch with Laurent Pinchart .I have also added this > > exaplanation in the comments above this function. > > > > >> + err = of_property_read_u32(node, "xlnx,addrwidth", > > >> + &addr_width); > > >> + > > >> + if (err < 0) { > > >> + /* Setting addr_width property to default 32 bits */ > > >> + addr_width = 32; > > >> + } > > > > > > braces for a single line statement! Also space is redandant before > > > if condition > > > > Will take care of this in v3 patch > > -- > Regards, > > Laurent Pinchart