Re: [PATCH v2] spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Mika and all,

On 27/02/2019 11:27, Mika Westerberg wrote:
> On Wed, Feb 27, 2019 at 09:57:15AM +0000, Sverdlin, Alexander (Nokia - DE/Ulm) wrote:
>> It was observed that reads crossing 4K address boundary are failing.

[...]

>> Reported-by: Romain Porte <romain.porte@xxxxxxxxx>
>> Tested-by: Pascal Fabreges <pascal.fabreges@xxxxxxxxx>
>> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>
>> ---
>> Changelog:
>> v2:	More macros! As Mika suggested.
>>
>>  drivers/mtd/spi-nor/intel-spi.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/mtd/spi-nor/intel-spi.c b/drivers/mtd/spi-nor/intel-spi.c
>> index af0a220..8c279c4 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 */
>> +		blocksize = min(from + block_size, round_up(from + 1, SZ_4K)) -
>> +			    from;
> 
> Nit:
> 
> It looks better if you put it into one line like:
> 
> 		blocksize = min(from + block_size, round_up(from + 1, SZ_4K)) - from;
> 
> 
> Regardless of that,
> 
> Acked-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>

Please ignore v2!
There was a failure in build/test process on my side.
I will send v3.

-- 
Best regards,
Alexander Sverdlin.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux