Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758813AbcDMFVf (ORCPT ); Wed, 13 Apr 2016 01:21:35 -0400 Received: from mail-cys01nam02on0085.outbound.protection.outlook.com ([104.47.37.85]:7597 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756594AbcDMFVd convert rfc822-to-8bit (ORCPT ); Wed, 13 Apr 2016 01:21:33 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; ti.com; dkim=none (message not signed) header.d=none;ti.com; dmarc=bestguesspass action=none header.from=xilinx.com; From: Lakshmi Sai Krishna Potthuri To: Cyrille Pitchen , Michal Simek , Soren Brinkmann , David Woodhouse , Brian Norris , Mark Brown , Javier Martinez Canillas , Boris Brezillon , Stephen Warren , Geert Uytterhoeven , "Andrew F. Davis" , Marek Vasut , Jagan Teki , =?iso-8859-2?Q?Rafa=B3_Mi=B3ecki?= CC: "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-spi@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Harini Katakam , Punnaiah Choudary Kalluri , Anirudha Sarangi , "R, Vignesh" Subject: RE: [LINUX PATCH v2 1/3] spi: Added dummy_cycle entry in the spi_transfer structure. Thread-Topic: [LINUX PATCH v2 1/3] spi: Added dummy_cycle entry in the spi_transfer structure. Thread-Index: AQHRkNtSww7cpKVtvUCf5p/0GaRvV59+FUAAgAlLKlA= Date: Wed, 13 Apr 2016 05:21:25 +0000 Message-ID: <4FF8F58FAA9D5D4193D4E554E4352C5902C720DE@XAP-PVEXMBX02.xlnx.xilinx.com> References: <1460039969-9835-1-git-send-email-lakshmis@xilinx.com> <57067694.8030806@atmel.com> In-Reply-To: <57067694.8030806@atmel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.97.152] Content-Type: text/plain; charset="iso-8859-2" 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-22254.005 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)(189002)(53754006)(199003)(13464003)(377454003)(76176999)(5004730100002)(86362001)(586003)(5008740100001)(5890100001)(63266004)(6116002)(50466002)(55846006)(4326007)(106116001)(2950100001)(81166005)(5250100002)(2920100001)(92566002)(1096002)(1220700001)(5001770100001)(2906002)(19580405001)(6806005)(47776003)(19580395003)(54356999)(189998001)(3846002)(11100500001)(106466001)(5003600100002)(2900100001)(50986999)(102836003)(107986001)(921003)(217873001)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2NAM02HT214;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-MS-Office365-Filtering-Correlation-Id: 4b555a9d-10be-4b80-f63a-08d3635b788c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:BL2NAM02HT214; X-Microsoft-Antispam-PRVS: <94f717f68b4643b0ae4a34b23012626c@BL2NAM02HT214.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)(13017025)(13024025)(8121501046)(5005006)(13023025)(13015025)(3002001)(10201501046);SRVR:BL2NAM02HT214;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT214; X-Forefront-PRVS: 0911D5CE78 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2016 05:21:30.2393 (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: BL2NAM02HT214 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4502 Lines: 99 Hi Cyrille and Mark, >-----Original Message----- >From: Cyrille Pitchen [mailto:cyrille.pitchen@atmel.com] >Sent: Thursday, April 07, 2016 8:33 PM >To: Lakshmi Sai Krishna Potthuri ; Michal Simek >; Soren Brinkmann ; David >Woodhouse ; Brian Norris >; Mark Brown ; >Javier Martinez Canillas ; Boris Brezillon >; Stephen Warren >; Geert Uytterhoeven ; >Andrew F. Davis ; Marek Vasut ; Jagan Teki >; Rafa? Mi?ecki >Cc: linux-mtd@lists.infradead.org; linux-kernel@vger.kernel.org; linux- >spi@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Harini Katakam >; Punnaiah Choudary Kalluri ; >Anirudha Sarangi ; Lakshmi Sai Krishna Potthuri >; R, Vignesh >Subject: Re: [LINUX PATCH v2 1/3] spi: Added dummy_cycle entry in the >spi_transfer structure. > >Hi all, > >Le 07/04/2016 16:39, P L Sai Krishna a ?crit : >> This patch adds dummy_cycles entry in the spi_transfer structure. >> len field in the transfer structure contains dummy bytes along with >> actual data bytes, controllers which requires dummy bytes use len >> field and simply Ignore the dummy_cycles field. Controllers which >> expects dummy cycles won't work directly by using len field because >> host driver doesn't know that len field of a particular transfer >> includes dummy bytes or not (and also number of dummy bytes included >> in len field). In such cases host driver use this dummy_cycles field >> to identify the number of dummy cycles and based on that it will send >> the required number of dummy cycles. > >Dummy cycles are only used with SPI NOR flashes, aren't they? Yes, with SPI NOR flashes. >I guess so since there is also a patch dedicated to the m25p80 driver. > >So why not using the spi_flash_read() API already introduced by Vignesh >in the SPI layer? ZynqMP GQSPI controller driver use "transfer_one" hook. Since this is generic Controller majorly interfaced to flash devices and it might extend to NAND flashes in future. This patch does not disturb the existing implementation of accessing the flash or other slave devices. It adds an additional optional feature. So there is no harm to controllers that don't need dummy cycles - they can ignore it and still work with the existing implementation. Regards Sai Krishna > >struct spi_flash_read_message already includes a 'dummy_bytes' member. > >> >> Signed-off-by: P L Sai Krishna >> --- >> v2: >> - Changed the structure member name from dummy to dummy_cycles. >> - Updated the documentation of dummy_cycles. >> - m25p80 changes split into another patch. >> >> include/linux/spi/spi.h | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h >> index 857a9a1..63135b3 100644 >> --- a/include/linux/spi/spi.h >> +++ b/include/linux/spi/spi.h >> @@ -664,6 +664,9 @@ extern void spi_res_release(struct spi_master >*master, >> * @len: size of rx and tx buffers (in bytes) >> * @speed_hz: Select a speed other than the device default for this >> * transfer. If 0 the default (from @spi_device) is used. >> + * @dummy_cycles: number of dummy cycles. If host controller requires >> + * dummy cycles rather than dummy bytes which send along with Cmd >> + * and address then this dummy_cycles is used. >> * @bits_per_word: select a bits_per_word other than the device default >> * for this transfer. If 0 the default (from @spi_device) is used. >> * @cs_change: affects chipselect after this transfer completes >> @@ -752,6 +755,7 @@ struct spi_transfer { >> u8 bits_per_word; >> u16 delay_usecs; >> u32 speed_hz; >> + u32 dummy_cycles; >> >> struct list_head transfer_list; >> }; >> > >Best regards, > >Cyrille 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.