Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1488532imm; Mon, 3 Sep 2018 01:37:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYGR6xtaqNa64LlYHMFXeKKYaekyHPRsmhwcaLrJXDBZVD0otnfR5DFRLyS3VYCOGKnDE31 X-Received: by 2002:a63:9809:: with SMTP id q9-v6mr24890076pgd.58.1535963844579; Mon, 03 Sep 2018 01:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535963844; cv=none; d=google.com; s=arc-20160816; b=SZBu7azejZ/dH4ZKETakXI524XpRCH669mZANSZeM48uIBkcV7VprQNJ9kb+rep9Jq XoQL5SvtxGeO61SFERsOOAZsy6X6ZvQ3QeEAaO2VdBzTY9d05xx0Rx+U7D4kaG0v4UuS zVUWeHbChKGaj4MVC6quBN6nqdnxTdaCE6m5B7oelUKMVeHeitGKym9z3+DesJsaSDtw EGWidbI57mweLVcHKXS5EJ+aDaVNWG0wmoikpQRmbFzuC+peOoF+zLEEX0uv6yY3xb3Z PqnCaDd1iereEQB3n8yaGLl7olJzG+N+jiUmgWcaoC6NDHjZKhcE+7XaOKclWNUo/+Ij lXRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=i1L1/7kAl27Imd+U7RXnfCQsaEwFa92dA8Tn3pWddC0=; b=kEZLui8GlXEqIGLFXStcp0JlHbnexYdk0thn9eZW8k9yoGWthfjqNBv/yqI/tVezq2 sUqd++aUdHa/ZDGJ8F3qkM7kWmCOXbbTdH9PGJafFwBXsn6eHd4qAwriMHnOKHo/jq+C WOxL0QgVJwAkDx6q4JN2cyk2oQrEgdF2ANxXab9Nn+60wCiG1Bl8Nwx0AX6iaiOxSsxP dENj7SxUlPHD82Iyvn/RKWYCj/PTZAldkWYXHEqP6v3W8S+skg9rqUU19kdtyrvx3yD5 H+uISeaT9pTslUTYaQCk0foeo1aXCVmKp61UksB49nwuNmuWPjyl8OpLu8k7fzPOjOgs Q5Bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32-v6si17719269plc.475.2018.09.03.01.37.09; Mon, 03 Sep 2018 01:37:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727220AbeICMzN convert rfc822-to-8bit (ORCPT + 99 others); Mon, 3 Sep 2018 08:55:13 -0400 Received: from mail.bootlin.com ([62.4.15.54]:53037 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeICMzN (ORCPT ); Mon, 3 Sep 2018 08:55:13 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id F0B1220726; Mon, 3 Sep 2018 10:36:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-92-107.w90-88.abo.wanadoo.fr [90.88.33.107]) by mail.bootlin.com (Postfix) with ESMTPSA id DA5C6215E6; Mon, 3 Sep 2018 10:36:03 +0200 (CEST) Date: Mon, 3 Sep 2018 10:36:00 +0200 From: Boris Brezillon To: Yogesh Narayan Gaur Cc: Lothar =?UTF-8?B?V2HDn21hbm4=?= , "linux-mtd@lists.infradead.org" , "marek.vasut@gmail.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" , "mark.rutland@arm.com" , "robh@kernel.org" , "linux-kernel@vger.kernel.org" , "frieder.schrempf@exceet.de" , "computersforpeace@gmail.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH 1/7] spi: add slave device size in spi_device struct Message-ID: <20180903103600.3efabbac@bbrezillon> In-Reply-To: References: <1535711404-29528-1-git-send-email-yogeshnarayan.gaur@nxp.com> <1535711404-29528-2-git-send-email-yogeshnarayan.gaur@nxp.com> <20180831135807.22255bce@karo-electronics.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yogesh, On Mon, 3 Sep 2018 04:47:25 +0000 Yogesh Narayan Gaur wrote: > Hi Lothar, > > > -----Original Message----- > > From: Lothar Waßmann [mailto:LW@KARO-electronics.de] > > Sent: Friday, August 31, 2018 5:28 PM > > To: Yogesh Narayan Gaur > > Cc: linux-mtd@lists.infradead.org; boris.brezillon@bootlin.com; > > marek.vasut@gmail.com; linux-spi@vger.kernel.org; > > devicetree@vger.kernel.org; mark.rutland@arm.com; robh@kernel.org; linux- > > kernel@vger.kernel.org; frieder.schrempf@exceet.de; > > computersforpeace@gmail.com; shawnguo@kernel.org; linux-arm- > > kernel@lists.infradead.org > > Subject: Re: [PATCH 1/7] spi: add slave device size in spi_device struct > > > > Hi, > > > > On Fri, 31 Aug 2018 15:59:58 +0530 Yogesh Gaur wrote: > > > Add 'size' data variable in spi_device struct. > > > This is to save the size of the connected slave device. > > > > > > After slave device scan, spi_nor_scan, size being assigned to this > > > from MTD layer. > > > > > > SFDP read is being requested before completion of spi_nor_scan() > > > routine, thus populate device size before making read request to the > > > SPI controller. > > > > > > Signed-off-by: Yogesh Gaur > > > --- > > > drivers/mtd/devices/m25p80.c | 6 ++++++ > > > drivers/mtd/spi-nor/spi-nor.c | 2 ++ > > > include/linux/spi/spi.h | 2 ++ > > > 3 files changed, 10 insertions(+) > > > > > > diff --git a/drivers/mtd/devices/m25p80.c > > > b/drivers/mtd/devices/m25p80.c index fe260cc..6c7ad86 100644 > > > --- a/drivers/mtd/devices/m25p80.c > > > +++ b/drivers/mtd/devices/m25p80.c > > > @@ -124,6 +124,10 @@ static ssize_t m25p80_read(struct spi_nor *nor, > > loff_t from, size_t len, > > > /* convert the dummy cycles to the number of bytes */ > > > op.dummy.nbytes = (nor->read_dummy * op.dummy.buswidth) / 8; > > > > > > + /* for case of SFDP header read commands, populate spi device size */ > > > + if (flash->spimem->spi->size == 0) > > > + flash->spimem->spi->size = nor->mtd.size; > > > + > > If the 'size' is an spimem specific variable it should be added to the spi_mem > > struct rather than the spi_device struct. > > Sure, would move 'size' from struct spi_device to the struct spi_mem. Before you send a new version doing that, I'd like to understand why you need this information. Can you wait a bit so I have some time to review the driver? Thanks, Boris