[RFC][PATCH][MTD][OneNAND] Fix OneNAND byte access
Kyungmin Park
kmpark at infradead.org
Fri May 16 03:52:18 EDT 2008
>> It's only optimization at driver level
>>
>> I think it's the best that it handles at UBIFS itself
>> e.g., Now it passed down from name handling
>> If the size of name is odd how about pad it even?
>
> It would be a lot of work to change UBIFS.
>
> It is really a driver problem. For example OMAP2
> does not have the problem, so it should be fixed at
> the driver level.
>
I'm not sure it makes a problem but potentially it access wrongly.
Well I will check it at omap2 driver
>>
>> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
>> ---
>> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
>> index 5d7965f..49194b6 100644
>> --- a/drivers/mtd/onenand/onenand_base.c
>> +++ b/drivers/mtd/onenand/onenand_base.c
>> @@ -509,9 +509,23 @@ static int onenand_read_bufferram(struct mtd_info *mtd, int area,
>>
>> bufferram += onenand_bufferram_offset(mtd, area);
>>
>> + if (ONENAND_CHECK_BYTE_ACCESS(offset)) {
>> + unsigned short word;
>> + printk("%s[%d] %d %zd\n", __func__, __LINE__, offset, count);
>> +
>> + /* Align with word(16-bit) size */
>> + /* Read word and save byte */
>> + word = this->read_word(bufferram + offset - 1);
>> + buffer[0] = (word & 0xff00) >> 8;
>> + buffer++;
>> + offset++;
>> + count--;
>> + }
>> +
>> if (ONENAND_CHECK_BYTE_ACCESS(count)) {
>> unsigned short word;
>>
>> + printk("%s[%d] %d %zd\n", __func__, __LINE__, offset, count);
>> /* Align with word(16-bit) size */
>> count--;
>>
>>
>
> I presume you will remove the printks.
>
Sure, it remains only for checking for you. Must be removed at patch.
Thank you,
Kyungmin Park
More information about the linux-mtd
mailing list