Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbcCVGkG (ORCPT ); Tue, 22 Mar 2016 02:40:06 -0400 Received: from mail-bl2nam02on0049.outbound.protection.outlook.com ([104.47.38.49]:41728 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751160AbcCVGj5 convert rfc822-to-8bit (ORCPT ); Tue, 22 Mar 2016 02:39:57 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Lakshmi Sai Krishna Potthuri To: Mark Brown CC: Michal Simek , Soren Brinkmann , David Woodhouse , Brian Norris , Javier Martinez Canillas , Boris Brezillon , Stephen Warren , Geert Uytterhoeven , "Andrew F. Davis" , Marek Vasut , Jagan Teki , =?iso-8859-2?Q?Rafa=B3_Mi=B3ecki?= , "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 Subject: RE: [LINUX PATCH 1/2] mtd: Added dummy entry in the spi_transfer structure. Thread-Topic: [LINUX PATCH 1/2] mtd: Added dummy entry in the spi_transfer structure. Thread-Index: AQHRg2wblaRb2/cF/U+RyRMtRqGMUp9jWE8AgAGMzBA= Date: Tue, 22 Mar 2016 06:39:51 +0000 Message-ID: <4FF8F58FAA9D5D4193D4E554E4352C5902C6D34C@XAP-PVEXMBX02.xlnx.xilinx.com> References: <1458562809-36114-1-git-send-email-lakshmis@xilinx.com> <20160321130734.GS2566@sirena.org.uk> In-Reply-To: <20160321130734.GS2566@sirena.org.uk> 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=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22206.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)(189002)(199003)(24454002)(63266004)(189998001)(2920100001)(5008740100001)(5003600100002)(2900100001)(92566002)(217423001)(6806005)(5890100001)(33656002)(81166005)(1220700001)(76176999)(50986999)(1096002)(2950100001)(54356999)(586003)(4001430100002)(47776003)(6116002)(50466002)(102836003)(3846002)(2906002)(87936001)(106466001)(86362001)(106116001)(110136002)(11100500001)(5004730100002)(5250100002)(55846006)(107886002)(4326007)(107986001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2NAM02HT074;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-MS-Office365-Filtering-Correlation-Id: afb46f90-f3f6-42ca-a60d-08d3521cc7e6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:BL2NAM02HT074; X-Microsoft-Antispam-PRVS: <9f02c360715b4d99898024068d86098c@BL2NAM02HT074.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)(13017025)(5005006)(13023025)(13015025)(13024025)(8121501046)(13018025)(3002001)(10201501046);SRVR:BL2NAM02HT074;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT074; X-Forefront-PRVS: 08897B549D X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2016 06:39:55.3215 (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: BL2NAM02HT074 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3137 Lines: 71 Hi Mark, >On Mon, Mar 21, 2016 at 05:50:08PM +0530, P L Sai Krishna wrote: >> This patch does following things. >> 1. Added dummy entry in the spi_transfer structure. >> 2. Assigned dummy cycles to dummy member in the transfer structure >> during read operation. > >Please try to follow the patch submission process covered in >SubmittingPatches, in particular please use subject lines reflecting the style >for the subsystem (which helps people identify relevant changes to >review) and... > >> drivers/mtd/devices/m25p80.c | 1 + >> include/linux/spi/spi.h | 2 ++ >> 2 files changed, 3 insertions(+) > >...split things up into individual patches, for example here you're both adding a >new feature and adding a user of that feature in a single patch. I will split the patch into two with appropriate commit messages. > >> + * @dummy: number of dummy cycles. > >This needs to be clearer about what a dummy cycle is and where it gets >inserted. We probably also want a better name, just "dummy" makes it look >like a padding field in the structure. How about dummy_cycles? dummy_cycles is a better idea. I will change it and add the usage of this in the description in a detailed manner. > >> @@ -752,6 +753,7 @@ struct spi_transfer { >> u8 bits_per_word; >> u16 delay_usecs; >> u32 speed_hz; >> + u32 dummy; >> >> struct list_head transfer_list; >> }; > >This isn't enough to add the feature - a client driver trying to make use of this >needs to be able to tell if the cycles are actually going to be inserted. I'd >expect to see a capability flag that can be checked and some error checking so >that if we try to do a transfer with dummy cycles and can't support it we don't >silently ignore the dummy cycles, ideally also something that'll handle >multiples of 8 bits with SPI controllers that don't otherwise support this >feature. Currently, all fast reads use 8 cycles or 1 byte of dummy. This generally works. But it can be vary based on the flash and the type of read command. Dummy bytes are taken care of in m25p80.c by adjusting the len field: Length = size of (command + address + dummy byte) There might be controllers (like ZynqMP GQSPI) that would be able to use the information that dummy byte(s) were added and the precise number of dummy cycles. This patch does not disturb the existing implementation of adjusting length (as described above). It adds an additional optional feature. So there is no harm to controllers that can't support it - they can ignore it and still work with the existing "length adjustment" implementation. If you think there value in adding a capability flag, please let me know. Thanks for your review. Regards, Sai Krishna 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.