All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-13  8:21 ` Sverdlin, Alexander (Nokia - DE/Ulm)
  0 siblings, 0 replies; 19+ messages in thread
From: Sverdlin, Alexander (Nokia - DE/Ulm) @ 2019-03-13  8:21 UTC (permalink / raw)
  To: linux-mtd, Mika Westerberg
  Cc: Sverdlin, Alexander (Nokia - DE/Ulm),
	Marek Vasut, Tudor Ambarus, David Woodhouse, Brian Norris,
	Boris Brezillon, Richard Weinberger, Bin Meng, Porte,
	Romain (Nokia - FR/Paris-Saclay),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	stable

It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
Changelog:
v2: More macros! As suggested by Mika.
v3: Actually compiled. Sorry Mika, the lines are really long now.

 drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
index af0a220..d60cbf2 100644
--- a/drivers/mtd/spi-nor/intel-spi.c
+++ b/drivers/mtd/spi-nor/intel-spi.c
@@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Read cannot cross 4K boundary */
+		block_size = min_t(loff_t, from + block_size,
+				   round_up(from + 1, SZ_4K)) - from;
+
 		writel(from, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
@@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Write cannot cross 4K boundary */
+		block_size = min_t(loff_t, to + block_size,
+				   round_up(to + 1, SZ_4K)) - to;
+
 		writel(to, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
-- 
2.4.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-13  8:21 ` Sverdlin, Alexander (Nokia - DE/Ulm)
  0 siblings, 0 replies; 19+ messages in thread
From: Sverdlin, Alexander (Nokia - DE/Ulm) @ 2019-03-13  8:21 UTC (permalink / raw)
  To: linux-mtd, Mika Westerberg
  Cc: Bin Meng, Porte, Romain (Nokia - FR/Paris-Saclay),
	Boris Brezillon, Richard Weinberger, Tudor Ambarus, stable,
	Marek Vasut, Sverdlin, Alexander (Nokia - DE/Ulm),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	Brian Norris, David Woodhouse

It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
Changelog:
v2: More macros! As suggested by Mika.
v3: Actually compiled. Sorry Mika, the lines are really long now.

 drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
index af0a220..d60cbf2 100644
--- a/drivers/mtd/spi-nor/intel-spi.c
+++ b/drivers/mtd/spi-nor/intel-spi.c
@@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Read cannot cross 4K boundary */
+		block_size = min_t(loff_t, from + block_size,
+				   round_up(from + 1, SZ_4K)) - from;
+
 		writel(from, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
@@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Write cannot cross 4K boundary */
+		block_size = min_t(loff_t, to + block_size,
+				   round_up(to + 1, SZ_4K)) - to;
+
 		writel(to, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
-- 
2.4.6


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-13  8:21 ` Sverdlin, Alexander (Nokia - DE/Ulm)
@ 2019-03-13 10:56   ` Mika Westerberg
  -1 siblings, 0 replies; 19+ messages in thread
From: Mika Westerberg @ 2019-03-13 10:56 UTC (permalink / raw)
  To: Sverdlin, Alexander (Nokia - DE/Ulm)
  Cc: linux-mtd, Marek Vasut, Tudor Ambarus, David Woodhouse,
	Brian Norris, Boris Brezillon, Richard Weinberger, Bin Meng,
	Porte, Romain (Nokia - FR/Paris-Saclay),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	stable

On Wed, Mar 13, 2019 at 08:21:46AM +0000, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> It was observed that reads crossing 4K address boundary are failing.
> 
> This limitation is mentioned in Intel documents:
> 
> Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> 
> "5.26.3 Flash Access
> Program Register Access:
> * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> 
> Enhanced Serial Peripheral Interface (eSPI)
> Interface Base Specification (for Client and Server Platforms):
> 
> "5.1.4 Address
> For other memory transactions, the address may start or end at any byte
> boundary. However, the address and payload length combination must not
> cross the naturally aligned address boundary of the corresponding Maximum
> Payload Size. It must not cross a 4 KB address boundary."
> 
> Avoid this by splitting an operation crossing the boundary into two
> operations.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Romain Porte <romain.porte@nokia.com>
> Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-13 10:56   ` Mika Westerberg
  0 siblings, 0 replies; 19+ messages in thread
From: Mika Westerberg @ 2019-03-13 10:56 UTC (permalink / raw)
  To: Sverdlin, Alexander (Nokia - DE/Ulm)
  Cc: Bin Meng, Porte, Romain (Nokia - FR/Paris-Saclay),
	Boris Brezillon, Richard Weinberger, Tudor Ambarus, stable,
	Marek Vasut, linux-mtd, Fabreges,
	Pascal (Nokia - FR/Paris-Saclay),
	Brian Norris, David Woodhouse

On Wed, Mar 13, 2019 at 08:21:46AM +0000, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> It was observed that reads crossing 4K address boundary are failing.
> 
> This limitation is mentioned in Intel documents:
> 
> Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> 
> "5.26.3 Flash Access
> Program Register Access:
> * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> 
> Enhanced Serial Peripheral Interface (eSPI)
> Interface Base Specification (for Client and Server Platforms):
> 
> "5.1.4 Address
> For other memory transactions, the address may start or end at any byte
> boundary. However, the address and payload length combination must not
> cross the naturally aligned address boundary of the corresponding Maximum
> Payload Size. It must not cross a 4 KB address boundary."
> 
> Avoid this by splitting an operation crossing the boundary into two
> operations.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Romain Porte <romain.porte@nokia.com>
> Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-13  8:21 ` Sverdlin, Alexander (Nokia - DE/Ulm)
@ 2019-03-19 16:29   ` Tudor.Ambarus
  -1 siblings, 0 replies; 19+ messages in thread
From: Tudor.Ambarus @ 2019-03-19 16:29 UTC (permalink / raw)
  To: alexander.sverdlin, linux-mtd, mika.westerberg
  Cc: marek.vasut, dwmw2, computersforpeace, bbrezillon, richard,
	bmeng.cn, romain.porte, pascal.fabreges, stable

Hi, Alexander,

On 03/13/2019 10:21 AM, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> It was observed that reads crossing 4K address boundary are failing.
> 
> This limitation is mentioned in Intel documents:
> 
> Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> 
> "5.26.3 Flash Access
> Program Register Access:
> * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> 
> Enhanced Serial Peripheral Interface (eSPI)
> Interface Base Specification (for Client and Server Platforms):
> 
> "5.1.4 Address
> For other memory transactions, the address may start or end at any byte
> boundary. However, the address and payload length combination must not
> cross the naturally aligned address boundary of the corresponding Maximum
> Payload Size. It must not cross a 4 KB address boundary."
> 
> Avoid this by splitting an operation crossing the boundary into two
> operations.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Romain Porte <romain.porte@nokia.com>
> Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Please fix your author name to match your S-o-b tag. See
https://lkml.org/lkml/2019/2/8/556 for a workaround.

For consistency, all spi-nor patches should be prepended with "mtd: spi-nor:",
you forgot the "mtd:" part.

Looks good apart of these, I'll add my R-b tag on the next version.

Thanks,
ta

> ---
> Changelog:
> v2: More macros! As suggested by Mika.
> v3: Actually compiled. Sorry Mika, the lines are really long now.
> 
>  drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
> index af0a220..d60cbf2 100644
> --- a/drivers/mtd/spi-nor/intel-spi.c
> +++ b/drivers/mtd/spi-nor/intel-spi.c
> @@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
>  	while (len > 0) {
>  		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
>  
> +		/* Read cannot cross 4K boundary */
> +		block_size = min_t(loff_t, from + block_size,
> +				   round_up(from + 1, SZ_4K)) - from;
> +
>  		writel(from, ispi->base + FADDR);
>  
>  		val = readl(ispi->base + HSFSTS_CTL);
> @@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
>  	while (len > 0) {
>  		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
>  
> +		/* Write cannot cross 4K boundary */
> +		block_size = min_t(loff_t, to + block_size,
> +				   round_up(to + 1, SZ_4K)) - to;
> +
>  		writel(to, ispi->base + FADDR);
>  
>  		val = readl(ispi->base + HSFSTS_CTL);
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-19 16:29   ` Tudor.Ambarus
  0 siblings, 0 replies; 19+ messages in thread
From: Tudor.Ambarus @ 2019-03-19 16:29 UTC (permalink / raw)
  To: alexander.sverdlin, linux-mtd, mika.westerberg
  Cc: computersforpeace, bbrezillon, richard, romain.porte, stable,
	marek.vasut, pascal.fabreges, bmeng.cn, dwmw2

Hi, Alexander,

On 03/13/2019 10:21 AM, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> It was observed that reads crossing 4K address boundary are failing.
> 
> This limitation is mentioned in Intel documents:
> 
> Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> 
> "5.26.3 Flash Access
> Program Register Access:
> * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> 
> Enhanced Serial Peripheral Interface (eSPI)
> Interface Base Specification (for Client and Server Platforms):
> 
> "5.1.4 Address
> For other memory transactions, the address may start or end at any byte
> boundary. However, the address and payload length combination must not
> cross the naturally aligned address boundary of the corresponding Maximum
> Payload Size. It must not cross a 4 KB address boundary."
> 
> Avoid this by splitting an operation crossing the boundary into two
> operations.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Romain Porte <romain.porte@nokia.com>
> Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Please fix your author name to match your S-o-b tag. See
https://lkml.org/lkml/2019/2/8/556 for a workaround.

For consistency, all spi-nor patches should be prepended with "mtd: spi-nor:",
you forgot the "mtd:" part.

Looks good apart of these, I'll add my R-b tag on the next version.

Thanks,
ta

> ---
> Changelog:
> v2: More macros! As suggested by Mika.
> v3: Actually compiled. Sorry Mika, the lines are really long now.
> 
>  drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
> index af0a220..d60cbf2 100644
> --- a/drivers/mtd/spi-nor/intel-spi.c
> +++ b/drivers/mtd/spi-nor/intel-spi.c
> @@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
>  	while (len > 0) {
>  		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
>  
> +		/* Read cannot cross 4K boundary */
> +		block_size = min_t(loff_t, from + block_size,
> +				   round_up(from + 1, SZ_4K)) - from;
> +
>  		writel(from, ispi->base + FADDR);
>  
>  		val = readl(ispi->base + HSFSTS_CTL);
> @@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
>  	while (len > 0) {
>  		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
>  
> +		/* Write cannot cross 4K boundary */
> +		block_size = min_t(loff_t, to + block_size,
> +				   round_up(to + 1, SZ_4K)) - to;
> +
>  		writel(to, ispi->base + FADDR);
>  
>  		val = readl(ispi->base + HSFSTS_CTL);
> 
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-19 16:29   ` Tudor.Ambarus
@ 2019-03-19 16:50     ` Sverdlin, Alexander (Nokia - DE/Ulm)
  -1 siblings, 0 replies; 19+ messages in thread
From: Sverdlin, Alexander (Nokia - DE/Ulm) @ 2019-03-19 16:50 UTC (permalink / raw)
  To: linux-mtd, Mika Westerberg
  Cc: Sverdlin, Alexander (Nokia - DE/Ulm),
	Marek Vasut, Tudor Ambarus, David Woodhouse, Brian Norris,
	Boris Brezillon, Richard Weinberger, Bin Meng, Porte,
	Romain (Nokia - FR/Paris-Saclay),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	stable

It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
Changelog:
v2: More macros! As suggested by Mika.
v3: Actually compiled. Sorry Mika, the lines are really long now.

 drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
index af0a220..d60cbf2 100644
--- a/drivers/mtd/spi-nor/intel-spi.c
+++ b/drivers/mtd/spi-nor/intel-spi.c
@@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Read cannot cross 4K boundary */
+		block_size = min_t(loff_t, from + block_size,
+				   round_up(from + 1, SZ_4K)) - from;
+
 		writel(from, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
@@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Write cannot cross 4K boundary */
+		block_size = min_t(loff_t, to + block_size,
+				   round_up(to + 1, SZ_4K)) - to;
+
 		writel(to, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
-- 
2.4.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-19 16:50     ` Sverdlin, Alexander (Nokia - DE/Ulm)
  0 siblings, 0 replies; 19+ messages in thread
From: Sverdlin, Alexander (Nokia - DE/Ulm) @ 2019-03-19 16:50 UTC (permalink / raw)
  To: linux-mtd, Mika Westerberg
  Cc: Bin Meng, Porte, Romain (Nokia - FR/Paris-Saclay),
	Boris Brezillon, Richard Weinberger, Tudor Ambarus, stable,
	Marek Vasut, Sverdlin, Alexander (Nokia - DE/Ulm),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	Brian Norris, David Woodhouse

It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
Changelog:
v2: More macros! As suggested by Mika.
v3: Actually compiled. Sorry Mika, the lines are really long now.

 drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
index af0a220..d60cbf2 100644
--- a/drivers/mtd/spi-nor/intel-spi.c
+++ b/drivers/mtd/spi-nor/intel-spi.c
@@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Read cannot cross 4K boundary */
+		block_size = min_t(loff_t, from + block_size,
+				   round_up(from + 1, SZ_4K)) - from;
+
 		writel(from, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
@@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Write cannot cross 4K boundary */
+		block_size = min_t(loff_t, to + block_size,
+				   round_up(to + 1, SZ_4K)) - to;
+
 		writel(to, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
-- 
2.4.6


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-19 16:29   ` Tudor.Ambarus
@ 2019-03-19 16:52     ` Sverdlin, Alexander (Nokia - DE/Ulm)
  -1 siblings, 0 replies; 19+ messages in thread
From: Sverdlin, Alexander (Nokia - DE/Ulm) @ 2019-03-19 16:52 UTC (permalink / raw)
  To: linux-mtd, Mika Westerberg
  Cc: Sverdlin, Alexander (Nokia - DE/Ulm),
	Marek Vasut, Tudor Ambarus, David Woodhouse, Brian Norris,
	Boris Brezillon, Richard Weinberger, Bin Meng, Porte,
	Romain (Nokia - FR/Paris-Saclay),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	stable

From: Alexander Sverdlin <alexander.sverdlin@nokia.com>

It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
Changelog:
v2: More macros! As suggested by Mika.
v3: Actually compiled. Sorry Mika, the lines are really long now.

 drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
index af0a220..d60cbf2 100644
--- a/drivers/mtd/spi-nor/intel-spi.c
+++ b/drivers/mtd/spi-nor/intel-spi.c
@@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Read cannot cross 4K boundary */
+		block_size = min_t(loff_t, from + block_size,
+				   round_up(from + 1, SZ_4K)) - from;
+
 		writel(from, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
@@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Write cannot cross 4K boundary */
+		block_size = min_t(loff_t, to + block_size,
+				   round_up(to + 1, SZ_4K)) - to;
+
 		writel(to, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
-- 
2.4.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-19 16:52     ` Sverdlin, Alexander (Nokia - DE/Ulm)
  0 siblings, 0 replies; 19+ messages in thread
From: Sverdlin, Alexander (Nokia - DE/Ulm) @ 2019-03-19 16:52 UTC (permalink / raw)
  To: linux-mtd, Mika Westerberg
  Cc: Bin Meng, Porte, Romain (Nokia - FR/Paris-Saclay),
	Boris Brezillon, Richard Weinberger, Tudor Ambarus, stable,
	Marek Vasut, Sverdlin, Alexander (Nokia - DE/Ulm),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	Brian Norris, David Woodhouse

From: Alexander Sverdlin <alexander.sverdlin@nokia.com>

It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
Changelog:
v2: More macros! As suggested by Mika.
v3: Actually compiled. Sorry Mika, the lines are really long now.

 drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
index af0a220..d60cbf2 100644
--- a/drivers/mtd/spi-nor/intel-spi.c
+++ b/drivers/mtd/spi-nor/intel-spi.c
@@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Read cannot cross 4K boundary */
+		block_size = min_t(loff_t, from + block_size,
+				   round_up(from + 1, SZ_4K)) - from;
+
 		writel(from, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
@@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Write cannot cross 4K boundary */
+		block_size = min_t(loff_t, to + block_size,
+				   round_up(to + 1, SZ_4K)) - to;
+
 		writel(to, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
-- 
2.4.6


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4] mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-19 16:29   ` Tudor.Ambarus
@ 2019-03-19 17:18     ` Sverdlin, Alexander (Nokia - DE/Ulm)
  -1 siblings, 0 replies; 19+ messages in thread
From: Sverdlin, Alexander (Nokia - DE/Ulm) @ 2019-03-19 17:18 UTC (permalink / raw)
  To: linux-mtd, Mika Westerberg
  Cc: Sverdlin, Alexander (Nokia - DE/Ulm),
	Marek Vasut, Tudor Ambarus, David Woodhouse, Brian Norris,
	Boris Brezillon, Richard Weinberger, Bin Meng, Porte,
	Romain (Nokia - FR/Paris-Saclay),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	stable

From: Alexander Sverdlin <alexander.sverdlin@nokia.com>

It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
Changelog:
v2: More macros! As suggested by Mika.
v3: Actually compiled. Sorry Mika, the lines are really long now.
v4: Add "mtd:" to the subject

 drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
index af0a220..d60cbf2 100644
--- a/drivers/mtd/spi-nor/intel-spi.c
+++ b/drivers/mtd/spi-nor/intel-spi.c
@@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Read cannot cross 4K boundary */
+		block_size = min_t(loff_t, from + block_size,
+				   round_up(from + 1, SZ_4K)) - from;
+
 		writel(from, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
@@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Write cannot cross 4K boundary */
+		block_size = min_t(loff_t, to + block_size,
+				   round_up(to + 1, SZ_4K)) - to;
+
 		writel(to, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
-- 
2.4.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4] mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-19 17:18     ` Sverdlin, Alexander (Nokia - DE/Ulm)
  0 siblings, 0 replies; 19+ messages in thread
From: Sverdlin, Alexander (Nokia - DE/Ulm) @ 2019-03-19 17:18 UTC (permalink / raw)
  To: linux-mtd, Mika Westerberg
  Cc: Bin Meng, Porte, Romain (Nokia - FR/Paris-Saclay),
	Boris Brezillon, Richard Weinberger, Tudor Ambarus, stable,
	Marek Vasut, Sverdlin, Alexander (Nokia - DE/Ulm),
	Fabreges, Pascal (Nokia - FR/Paris-Saclay),
	Brian Norris, David Woodhouse

From: Alexander Sverdlin <alexander.sverdlin@nokia.com>

It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
Changelog:
v2: More macros! As suggested by Mika.
v3: Actually compiled. Sorry Mika, the lines are really long now.
v4: Add "mtd:" to the subject

 drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
index af0a220..d60cbf2 100644
--- a/drivers/mtd/spi-nor/intel-spi.c
+++ b/drivers/mtd/spi-nor/intel-spi.c
@@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Read cannot cross 4K boundary */
+		block_size = min_t(loff_t, from + block_size,
+				   round_up(from + 1, SZ_4K)) - from;
+
 		writel(from, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
@@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
 	while (len > 0) {
 		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
 
+		/* Write cannot cross 4K boundary */
+		block_size = min_t(loff_t, to + block_size,
+				   round_up(to + 1, SZ_4K)) - to;
+
 		writel(to, ispi->base + FADDR);
 
 		val = readl(ispi->base + HSFSTS_CTL);
-- 
2.4.6


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-19 17:18     ` Sverdlin, Alexander (Nokia - DE/Ulm)
@ 2019-03-20  6:49       ` Tudor.Ambarus
  -1 siblings, 0 replies; 19+ messages in thread
From: Tudor.Ambarus @ 2019-03-20  6:49 UTC (permalink / raw)
  To: alexander.sverdlin, mika.westerberg
  Cc: linux-mtd, marek.vasut, dwmw2, computersforpeace, bbrezillon,
	richard, bmeng.cn, romain.porte, pascal.fabreges, stable

Mika,

Would you please add your Acked-by again? It's dropped in v4.

Looks good for me, below is my R-b.

Thanks!

On 03/19/2019 07:18 PM, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> External E-Mail
> 
> 
> From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> 
> It was observed that reads crossing 4K address boundary are failing.
> 
> This limitation is mentioned in Intel documents:
> 
> Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> 
> "5.26.3 Flash Access
> Program Register Access:
> * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> 
> Enhanced Serial Peripheral Interface (eSPI)
> Interface Base Specification (for Client and Server Platforms):
> 
> "5.1.4 Address
> For other memory transactions, the address may start or end at any byte
> boundary. However, the address and payload length combination must not
> cross the naturally aligned address boundary of the corresponding Maximum
> Payload Size. It must not cross a 4 KB address boundary."
> 
> Avoid this by splitting an operation crossing the boundary into two
> operations.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Romain Porte <romain.porte@nokia.com>
> Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
> Changelog:
> v2: More macros! As suggested by Mika.
> v3: Actually compiled. Sorry Mika, the lines are really long now.
> v4: Add "mtd:" to the subject
> 
>  drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
> index af0a220..d60cbf2 100644
> --- a/drivers/mtd/spi-nor/intel-spi.c
> +++ b/drivers/mtd/spi-nor/intel-spi.c
> @@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
>  	while (len > 0) {
>  		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
>  
> +		/* Read cannot cross 4K boundary */
> +		block_size = min_t(loff_t, from + block_size,
> +				   round_up(from + 1, SZ_4K)) - from;
> +
>  		writel(from, ispi->base + FADDR);
>  
>  		val = readl(ispi->base + HSFSTS_CTL);
> @@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
>  	while (len > 0) {
>  		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
>  
> +		/* Write cannot cross 4K boundary */
> +		block_size = min_t(loff_t, to + block_size,
> +				   round_up(to + 1, SZ_4K)) - to;
> +
>  		writel(to, ispi->base + FADDR);
>  
>  		val = readl(ispi->base + HSFSTS_CTL);
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-20  6:49       ` Tudor.Ambarus
  0 siblings, 0 replies; 19+ messages in thread
From: Tudor.Ambarus @ 2019-03-20  6:49 UTC (permalink / raw)
  To: alexander.sverdlin, mika.westerberg
  Cc: bmeng.cn, bbrezillon, richard, romain.porte, stable, marek.vasut,
	linux-mtd, pascal.fabreges, computersforpeace, dwmw2

Mika,

Would you please add your Acked-by again? It's dropped in v4.

Looks good for me, below is my R-b.

Thanks!

On 03/19/2019 07:18 PM, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> External E-Mail
> 
> 
> From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> 
> It was observed that reads crossing 4K address boundary are failing.
> 
> This limitation is mentioned in Intel documents:
> 
> Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> 
> "5.26.3 Flash Access
> Program Register Access:
> * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> 
> Enhanced Serial Peripheral Interface (eSPI)
> Interface Base Specification (for Client and Server Platforms):
> 
> "5.1.4 Address
> For other memory transactions, the address may start or end at any byte
> boundary. However, the address and payload length combination must not
> cross the naturally aligned address boundary of the corresponding Maximum
> Payload Size. It must not cross a 4 KB address boundary."
> 
> Avoid this by splitting an operation crossing the boundary into two
> operations.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Romain Porte <romain.porte@nokia.com>
> Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
> Changelog:
> v2: More macros! As suggested by Mika.
> v3: Actually compiled. Sorry Mika, the lines are really long now.
> v4: Add "mtd:" to the subject
> 
>  drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
> index af0a220..d60cbf2 100644
> --- a/drivers/mtd/spi-nor/intel-spi.c
> +++ b/drivers/mtd/spi-nor/intel-spi.c
> @@ -632,6 +632,10 @@ static ssize_t intel_spi_read(struct spi_nor *nor, loff_t from, size_t len,
>  	while (len > 0) {
>  		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
>  
> +		/* Read cannot cross 4K boundary */
> +		block_size = min_t(loff_t, from + block_size,
> +				   round_up(from + 1, SZ_4K)) - from;
> +
>  		writel(from, ispi->base + FADDR);
>  
>  		val = readl(ispi->base + HSFSTS_CTL);
> @@ -685,6 +689,10 @@ static ssize_t intel_spi_write(struct spi_nor *nor, loff_t to, size_t len,
>  	while (len > 0) {
>  		block_size = min_t(size_t, len, INTEL_SPI_FIFO_SZ);
>  
> +		/* Write cannot cross 4K boundary */
> +		block_size = min_t(loff_t, to + block_size,
> +				   round_up(to + 1, SZ_4K)) - to;
> +
>  		writel(to, ispi->base + FADDR);
>  
>  		val = readl(ispi->base + HSFSTS_CTL);
> 
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-20  6:49       ` Tudor.Ambarus
@ 2019-03-20  7:39         ` Mika Westerberg
  -1 siblings, 0 replies; 19+ messages in thread
From: Mika Westerberg @ 2019-03-20  7:39 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: alexander.sverdlin, linux-mtd, marek.vasut, dwmw2,
	computersforpeace, bbrezillon, richard, bmeng.cn, romain.porte,
	pascal.fabreges, stable

On Wed, Mar 20, 2019 at 06:49:19AM +0000, Tudor.Ambarus@microchip.com wrote:
> Mika,
> 
> Would you please add your Acked-by again? It's dropped in v4.

Sure.

> Looks good for me, below is my R-b.
> 
> Thanks!
> 
> On 03/19/2019 07:18 PM, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> > External E-Mail
> > 
> > 
> > From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> > 
> > It was observed that reads crossing 4K address boundary are failing.
> > 
> > This limitation is mentioned in Intel documents:
> > 
> > Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> > 
> > "5.26.3 Flash Access
> > Program Register Access:
> > * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> > 
> > Enhanced Serial Peripheral Interface (eSPI)
> > Interface Base Specification (for Client and Server Platforms):
> > 
> > "5.1.4 Address
> > For other memory transactions, the address may start or end at any byte
> > boundary. However, the address and payload length combination must not
> > cross the naturally aligned address boundary of the corresponding Maximum
> > Payload Size. It must not cross a 4 KB address boundary."
> > 
> > Avoid this by splitting an operation crossing the boundary into two
> > operations.
> > 
> > Cc: stable@vger.kernel.org
> > Reported-by: Romain Porte <romain.porte@nokia.com>
> > Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> > Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> 
> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-20  7:39         ` Mika Westerberg
  0 siblings, 0 replies; 19+ messages in thread
From: Mika Westerberg @ 2019-03-20  7:39 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: bmeng.cn, bbrezillon, richard, romain.porte, stable, marek.vasut,
	linux-mtd, pascal.fabreges, alexander.sverdlin,
	computersforpeace, dwmw2

On Wed, Mar 20, 2019 at 06:49:19AM +0000, Tudor.Ambarus@microchip.com wrote:
> Mika,
> 
> Would you please add your Acked-by again? It's dropped in v4.

Sure.

> Looks good for me, below is my R-b.
> 
> Thanks!
> 
> On 03/19/2019 07:18 PM, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> > External E-Mail
> > 
> > 
> > From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> > 
> > It was observed that reads crossing 4K address boundary are failing.
> > 
> > This limitation is mentioned in Intel documents:
> > 
> > Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> > 
> > "5.26.3 Flash Access
> > Program Register Access:
> > * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> > 
> > Enhanced Serial Peripheral Interface (eSPI)
> > Interface Base Specification (for Client and Server Platforms):
> > 
> > "5.1.4 Address
> > For other memory transactions, the address may start or end at any byte
> > boundary. However, the address and payload length combination must not
> > cross the naturally aligned address boundary of the corresponding Maximum
> > Payload Size. It must not cross a 4 KB address boundary."
> > 
> > Avoid this by splitting an operation crossing the boundary into two
> > operations.
> > 
> > Cc: stable@vger.kernel.org
> > Reported-by: Romain Porte <romain.porte@nokia.com>
> > Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> > Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> 
> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-19 17:18     ` Sverdlin, Alexander (Nokia - DE/Ulm)
@ 2019-03-21 16:48       ` Tudor.Ambarus
  -1 siblings, 0 replies; 19+ messages in thread
From: Tudor.Ambarus @ 2019-03-21 16:48 UTC (permalink / raw)
  To: alexander.sverdlin, linux-mtd, mika.westerberg
  Cc: marek.vasut, dwmw2, computersforpeace, bbrezillon, richard,
	bmeng.cn, romain.porte, pascal.fabreges, stable



On 03/19/2019 07:18 PM, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> 
> It was observed that reads crossing 4K address boundary are failing.
> 
> This limitation is mentioned in Intel documents:
> 
> Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> 
> "5.26.3 Flash Access
> Program Register Access:
> * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> 
> Enhanced Serial Peripheral Interface (eSPI)
> Interface Base Specification (for Client and Server Platforms):
> 
> "5.1.4 Address
> For other memory transactions, the address may start or end at any byte
> boundary. However, the address and payload length combination must not
> cross the naturally aligned address boundary of the corresponding Maximum
> Payload Size. It must not cross a 4 KB address boundary."
> 
> Avoid this by splitting an operation crossing the boundary into two
> operations.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Romain Porte <romain.porte@nokia.com>
> Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> ---
> Changelog:
> v2: More macros! As suggested by Mika.
> v3: Actually compiled. Sorry Mika, the lines are really long now.
> v4: Add "mtd:" to the subject
> 
>  drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Applied to http://git.infradead.org/linux-mtd.git, spi-nor/next. Thanks.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
@ 2019-03-21 16:48       ` Tudor.Ambarus
  0 siblings, 0 replies; 19+ messages in thread
From: Tudor.Ambarus @ 2019-03-21 16:48 UTC (permalink / raw)
  To: alexander.sverdlin, linux-mtd, mika.westerberg
  Cc: computersforpeace, bbrezillon, richard, romain.porte, stable,
	marek.vasut, pascal.fabreges, bmeng.cn, dwmw2



On 03/19/2019 07:18 PM, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
> From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> 
> It was observed that reads crossing 4K address boundary are failing.
> 
> This limitation is mentioned in Intel documents:
> 
> Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:
> 
> "5.26.3 Flash Access
> Program Register Access:
> * Program Register Accesses are not allowed to cross a 4 KB boundary..."
> 
> Enhanced Serial Peripheral Interface (eSPI)
> Interface Base Specification (for Client and Server Platforms):
> 
> "5.1.4 Address
> For other memory transactions, the address may start or end at any byte
> boundary. However, the address and payload length combination must not
> cross the naturally aligned address boundary of the corresponding Maximum
> Payload Size. It must not cross a 4 KB address boundary."
> 
> Avoid this by splitting an operation crossing the boundary into two
> operations.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Romain Porte <romain.porte@nokia.com>
> Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> ---
> Changelog:
> v2: More macros! As suggested by Mika.
> v3: Actually compiled. Sorry Mika, the lines are really long now.
> v4: Add "mtd:" to the subject
> 
>  drivers/mtd/spi-nor/intel-spi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Applied to http://git.infradead.org/linux-mtd.git, spi-nor/next. Thanks.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
  2019-03-19 16:50     ` Sverdlin, Alexander (Nokia - DE/Ulm)
  (?)
@ 2019-03-25  0:38     ` Sasha Levin
  -1 siblings, 0 replies; 19+ messages in thread
From: Sasha Levin @ 2019-03-25  0:38 UTC (permalink / raw)
  To: Sasha Levin, Sverdlin, Alexander (Nokia - DE/Ulm), linux-mtd
  Cc: , Sverdlin, Alexander (Nokia - DE/Ulm), stable

Hi,

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.0.3, v4.19.30, v4.14.107, v4.9.164, v4.4.176, v3.18.136.

v5.0.3: Build OK!
v4.19.30: Build OK!
v4.14.107: Build OK!
v4.9.164: Failed to apply! Possible dependencies:
    8afda8b26d01 ("spi-nor: Add support for Intel SPI serial flash controller")

v4.4.176: Failed to apply! Possible dependencies:
    8afda8b26d01 ("spi-nor: Add support for Intel SPI serial flash controller")

v3.18.136: Failed to apply! Possible dependencies:
    8afda8b26d01 ("spi-nor: Add support for Intel SPI serial flash controller")
    f617b9587c16 ("mtd: spi-nor: add driver for NXP SPI Flash Interface (SPIFI)")


How should we proceed with this patch?

--
Thanks,
Sasha

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-03-25  0:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13  8:21 [PATCH v3] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write Sverdlin, Alexander (Nokia - DE/Ulm)
2019-03-13  8:21 ` Sverdlin, Alexander (Nokia - DE/Ulm)
2019-03-13 10:56 ` Mika Westerberg
2019-03-13 10:56   ` Mika Westerberg
2019-03-19 16:29 ` Tudor.Ambarus
2019-03-19 16:29   ` Tudor.Ambarus
2019-03-19 16:50   ` Sverdlin, Alexander (Nokia - DE/Ulm)
2019-03-19 16:50     ` Sverdlin, Alexander (Nokia - DE/Ulm)
2019-03-25  0:38     ` Sasha Levin
2019-03-19 16:52   ` Sverdlin, Alexander (Nokia - DE/Ulm)
2019-03-19 16:52     ` Sverdlin, Alexander (Nokia - DE/Ulm)
2019-03-19 17:18   ` [PATCH v4] mtd: " Sverdlin, Alexander (Nokia - DE/Ulm)
2019-03-19 17:18     ` Sverdlin, Alexander (Nokia - DE/Ulm)
2019-03-20  6:49     ` Tudor.Ambarus
2019-03-20  6:49       ` Tudor.Ambarus
2019-03-20  7:39       ` Mika Westerberg
2019-03-20  7:39         ` Mika Westerberg
2019-03-21 16:48     ` Tudor.Ambarus
2019-03-21 16:48       ` Tudor.Ambarus

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.