All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
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
Date: Fri, 31 Aug 2018 13:58:07 +0200	[thread overview]
Message-ID: <20180831135807.22255bce@karo-electronics.de> (raw)
In-Reply-To: <1535711404-29528-2-git-send-email-yogeshnarayan.gaur@nxp.com>

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@nxp.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.


Lothar Waßmann

WARNING: multiple messages have this Message-ID (diff)
From: LW@KARO-electronics.de (Lothar Waßmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] spi: add slave device size in spi_device struct
Date: Fri, 31 Aug 2018 13:58:07 +0200	[thread overview]
Message-ID: <20180831135807.22255bce@karo-electronics.de> (raw)
In-Reply-To: <1535711404-29528-2-git-send-email-yogeshnarayan.gaur@nxp.com>

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@nxp.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.


Lothar Wa?mann

  parent reply	other threads:[~2018-08-31 11:58 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 10:29 [PATCH 0/7] spi: spi-mem: Add a driver for NXP FlexSPI controller Yogesh Gaur
2018-08-31 10:29 ` Yogesh Gaur
2018-08-31 10:29 ` [PATCH 1/7] spi: add slave device size in spi_device struct Yogesh Gaur
2018-08-31 10:29   ` Yogesh Gaur
2018-08-31 11:41   ` Geert Uytterhoeven
2018-08-31 11:41     ` Geert Uytterhoeven
2018-08-31 11:58   ` Lothar Waßmann [this message]
2018-08-31 11:58     ` Lothar Waßmann
2018-09-03  4:47     ` Yogesh Narayan Gaur
2018-09-03  4:47       ` Yogesh Narayan Gaur
2018-09-03  8:36       ` Boris Brezillon
2018-09-03  8:36         ` Boris Brezillon
2018-08-31 10:29 ` [PATCH 2/7] spi: add flags for octal I/O data transfer Yogesh Gaur
2018-08-31 10:29   ` Yogesh Gaur
2018-08-31 10:30 ` [PATCH 3/7] spi: spi-mem: Add a driver for NXP FlexSPI controller Yogesh Gaur
2018-08-31 10:30   ` Yogesh Gaur
2018-09-04 14:58   ` Boris Brezillon
2018-09-04 14:58     ` Boris Brezillon
2018-09-05 10:07     ` Yogesh Narayan Gaur
2018-09-05 10:07       ` Yogesh Narayan Gaur
2018-09-06  8:26       ` Frieder Schrempf
2018-09-06  8:26         ` Frieder Schrempf
2018-09-06  8:26         ` Frieder Schrempf
2018-09-06 11:35         ` Yogesh Narayan Gaur
2018-09-06 11:35           ` Yogesh Narayan Gaur
2018-09-06 11:43           ` Boris Brezillon
2018-09-06 11:43             ` Boris Brezillon
2018-09-06 12:23             ` Yogesh Narayan Gaur
2018-09-06 12:23               ` Yogesh Narayan Gaur
2018-08-31 10:30 ` [PATCH 4/7] dt-bindings: spi: add binding file for NXP FlexSPI driver Yogesh Gaur
2018-08-31 10:30   ` Yogesh Gaur
2018-09-03  9:54   ` Prabhakar Kushwaha
2018-09-03  9:54     ` Prabhakar Kushwaha
2018-09-03  9:54     ` Prabhakar Kushwaha
2018-09-04  5:37     ` Yogesh Narayan Gaur
2018-09-04  5:37       ` Yogesh Narayan Gaur
2018-09-04 12:46     ` Boris Brezillon
2018-09-04 12:46       ` Boris Brezillon
2018-09-06  7:08       ` Jagdish Gediya
2018-09-06  7:08         ` Jagdish Gediya
2018-09-04  1:33   ` Rob Herring
2018-09-04  1:33     ` Rob Herring
2018-09-04  1:33     ` Rob Herring
2018-08-31 10:30 ` [PATCH 5/7] arm64: dts: lx2160a: add fspi node property Yogesh Gaur
2018-08-31 10:30   ` Yogesh Gaur
2018-09-03  3:01   ` Shawn Guo
2018-09-03  3:01     ` Shawn Guo
2018-08-31 10:30 ` [PATCH 6/7] arm64: defconfig: enable NXP FlexSPI driver Yogesh Gaur
2018-08-31 10:30   ` Yogesh Gaur
2018-08-31 10:30 ` [PATCH 7/7] MAINTAINERS: add maintainers for the " Yogesh Gaur
2018-08-31 10:30   ` Yogesh Gaur
2018-09-04 12:43 ` [PATCH 0/7] spi: spi-mem: Add a driver for NXP FlexSPI controller Boris Brezillon
2018-09-04 12:43   ` Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180831135807.22255bce@karo-electronics.de \
    --to=lw@karo-electronics.de \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frieder.schrempf@exceet.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=robh@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=yogeshnarayan.gaur@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.