lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR04MB103801BA8203421C517199BB990C0@VI1PR04MB1038.eurprd04.prod.outlook.com>
Date:   Mon, 3 Sep 2018 04:47:25 +0000
From:   Yogesh Narayan Gaur <yogeshnarayan.gaur@....com>
To:     Lothar Waßmann <LW@...O-electronics.de>
CC:     "linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
        "boris.brezillon@...tlin.com" <boris.brezillon@...tlin.com>,
        "marek.vasut@...il.com" <marek.vasut@...il.com>,
        "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "robh@...nel.org" <robh@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "frieder.schrempf@...eet.de" <frieder.schrempf@...eet.de>,
        "computersforpeace@...il.com" <computersforpeace@...il.com>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH 1/7] spi: add slave device size in spi_device struct

Hi Lothar,

> -----Original Message-----
> From: Lothar Waßmann [mailto:LW@...O-electronics.de]
> Sent: Friday, August 31, 2018 5:28 PM
> To: Yogesh Narayan Gaur <yogeshnarayan.gaur@....com>
> Cc: linux-mtd@...ts.infradead.org; boris.brezillon@...tlin.com;
> marek.vasut@...il.com; linux-spi@...r.kernel.org;
> devicetree@...r.kernel.org; mark.rutland@....com; robh@...nel.org; linux-
> kernel@...r.kernel.org; frieder.schrempf@...eet.de;
> computersforpeace@...il.com; shawnguo@...nel.org; linux-arm-
> kernel@...ts.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 <yogeshnarayan.gaur@....com>
> > ---
> >  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.

--
Regards
Yogesh Gaur.

> 
> Lothar Waßmann

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ