Re: [PATCH v4 0/7] Add spi-nor SPI transfer error handling

2015-11-19 Thread Brian Norris
Hi Michal,

On Fri, Aug 14, 2015 at 09:23:06AM -, Michal Suchanek wrote:
> Hello,
> 
> with these patches SPI transfer errors are not silently ignored but rather
> reported to spi-nor users.
> 
> This should prevent silently dropping data to the floor in cases when the SPI
> transfer fails and the failure is detected.
> 
> It has been pointed out that MTD users do not handle the case when data is 
> read
> only partially so this version adds the last patch which handles this in
> spi-nor.
> 
> Thanks
> 
> Michal
> 
> Michal Suchanek (7):
>   mtd: spi-nor: change return value of read/write
>   mtd: m25p80: return amount of data transferred or error in read/write
>   mtd: fsl-quadspi: return amount of data read/written or error
>   mtd: spi-nor: check return value from read/write
>   mtd: spi-nor: stop passing around retlen

Patches 1 to 5 look good to me, though there is a new spi-nor driver
since you sent this. Can you rebase/fixup?

>   mtd: spi-nor: simplify write loop
>   mtd: spi-nor: add read loop

I posted some comments for these. I get the feeling that patch 6 is
over-complicated and should be just a simple assertion. And I'm still
not 100% sure on the approach for patch 7, since it's not clear whether
the responsibility lies in the SPI layer or in MTD.

Brian

>  drivers/mtd/devices/m25p80.c  | 33 +--
>  drivers/mtd/spi-nor/fsl-quadspi.c | 29 ++---
>  drivers/mtd/spi-nor/spi-nor.c | 85 
> +++
>  include/linux/mtd/spi-nor.h   |  8 ++--
>  4 files changed, 91 insertions(+), 64 deletions(-)
> 
> -- 
> 2.1.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 0/7] Add spi-nor SPI transfer error handling

2015-11-19 Thread Brian Norris
Hi Michal,

On Fri, Aug 14, 2015 at 09:23:06AM -, Michal Suchanek wrote:
> Hello,
> 
> with these patches SPI transfer errors are not silently ignored but rather
> reported to spi-nor users.
> 
> This should prevent silently dropping data to the floor in cases when the SPI
> transfer fails and the failure is detected.
> 
> It has been pointed out that MTD users do not handle the case when data is 
> read
> only partially so this version adds the last patch which handles this in
> spi-nor.
> 
> Thanks
> 
> Michal
> 
> Michal Suchanek (7):
>   mtd: spi-nor: change return value of read/write
>   mtd: m25p80: return amount of data transferred or error in read/write
>   mtd: fsl-quadspi: return amount of data read/written or error
>   mtd: spi-nor: check return value from read/write
>   mtd: spi-nor: stop passing around retlen

Patches 1 to 5 look good to me, though there is a new spi-nor driver
since you sent this. Can you rebase/fixup?

>   mtd: spi-nor: simplify write loop
>   mtd: spi-nor: add read loop

I posted some comments for these. I get the feeling that patch 6 is
over-complicated and should be just a simple assertion. And I'm still
not 100% sure on the approach for patch 7, since it's not clear whether
the responsibility lies in the SPI layer or in MTD.

Brian

>  drivers/mtd/devices/m25p80.c  | 33 +--
>  drivers/mtd/spi-nor/fsl-quadspi.c | 29 ++---
>  drivers/mtd/spi-nor/spi-nor.c | 85 
> +++
>  include/linux/mtd/spi-nor.h   |  8 ++--
>  4 files changed, 91 insertions(+), 64 deletions(-)
> 
> -- 
> 2.1.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 0/7] Add spi-nor SPI transfer error handling

2015-08-16 Thread Michal Suchanek
Hello,

On 15 August 2015 at 03:51, Bean Huo 霍斌斌 (beanhuo)  wrote:
>>Hello,
>
>>with these patches SPI transfer errors are not silently ignored but rather 
>>reported to spi-nor users.
>
>>This should prevent silently dropping data to the floor in cases when the SPI 
>>transfer fails and the failure is detected.
>
>>It has been pointed out that MTD users do not handle the case when data is 
>>read only partially so this version adds the last patch which handles this in 
>>spi-nor.
>
>>Thanks
>
>>Michal
>  Seems parallel nand read/write also has the same condition.

I am not familiar with parallel NAND drivers so I have no idea if
parallel nand can fail in similar way.

As I understand it the parallel nand controller is dedicated piece of
hardware just for accessing the nand so there may not be any problems
similar to what the generic SPI bus has.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 0/7] Add spi-nor SPI transfer error handling

2015-08-16 Thread Michal Suchanek
Hello,

On 15 August 2015 at 03:51, Bean Huo 霍斌斌 (beanhuo) bean...@micron.com wrote:
Hello,

with these patches SPI transfer errors are not silently ignored but rather 
reported to spi-nor users.

This should prevent silently dropping data to the floor in cases when the SPI 
transfer fails and the failure is detected.

It has been pointed out that MTD users do not handle the case when data is 
read only partially so this version adds the last patch which handles this in 
spi-nor.

Thanks

Michal
  Seems parallel nand read/write also has the same condition.

I am not familiar with parallel NAND drivers so I have no idea if
parallel nand can fail in similar way.

As I understand it the parallel nand controller is dedicated piece of
hardware just for accessing the nand so there may not be any problems
similar to what the generic SPI bus has.

Thanks

Michal
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v4 0/7] Add spi-nor SPI transfer error handling

2015-08-14 Thread beanhuo
>Hello,

>with these patches SPI transfer errors are not silently ignored but rather 
>reported to spi-nor users.

>This should prevent silently dropping data to the floor in cases when the SPI 
>transfer fails and the failure is detected.

>It has been pointed out that MTD users do not handle the case when data is 
>read only partially so this version adds the last patch which handles this in 
>spi-nor.

>Thanks

>Michal
 Seems parallel nand read/write also has the same condition.


RE: [PATCH v4 0/7] Add spi-nor SPI transfer error handling

2015-08-14 Thread beanhuo
Hello,

with these patches SPI transfer errors are not silently ignored but rather 
reported to spi-nor users.

This should prevent silently dropping data to the floor in cases when the SPI 
transfer fails and the failure is detected.

It has been pointed out that MTD users do not handle the case when data is 
read only partially so this version adds the last patch which handles this in 
spi-nor.

Thanks

Michal
 Seems parallel nand read/write also has the same condition.