public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* nandwrite with raw oob data
@ 2011-06-05 16:40 Peter Wippich
  2011-06-06 12:10 ` Artem Bityutskiy
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Wippich @ 2011-06-05 16:40 UTC (permalink / raw)
  To: linux-mtd


Dear all,

I run into the same problem as outlined here before:
http://lists.infradead.org/pipermail/linux-mtd/2011-March/034516.html

Going a little bit deeper it looks to me that writing any nand flash data 
with raw (precomputed ECC) OOB data is not possible at all with a recent 
Kernel and nandwrite version.

What happens here is that nandwrite will set MTD_MODE_RAW when noecc is 
specified. Doing so will force the kernel driver to write OOB data only on 
a normal write. Obviously this will fail when someone is trying to write 
normal data to flash in MODE_RAW.

Question: is this realy the intended behaviour ???

It may be easy to fix this on kernel level, but may be there is some good 
reason I don't know to do it as it is. And I don't want to break things.

Any comments welcome.

Thank you and Cheers,

Peter

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

* Re: nandwrite with raw oob data
  2011-06-05 16:40 nandwrite with raw oob data Peter Wippich
@ 2011-06-06 12:10 ` Artem Bityutskiy
  2011-06-06 13:11   ` Peter Wippich
  0 siblings, 1 reply; 3+ messages in thread
From: Artem Bityutskiy @ 2011-06-06 12:10 UTC (permalink / raw)
  To: Peter Wippich; +Cc: linux-mtd

On Sun, 2011-06-05 at 18:40 +0200, Peter Wippich wrote:
> Dear all,
> 
> I run into the same problem as outlined here before:
> http://lists.infradead.org/pipermail/linux-mtd/2011-March/034516.html
> 
> Going a little bit deeper it looks to me that writing any nand flash data 
> with raw (precomputed ECC) OOB data is not possible at all with a recent 
> Kernel and nandwrite version.
> 
> What happens here is that nandwrite will set MTD_MODE_RAW when noecc is 
> specified. Doing so will force the kernel driver to write OOB data only on 
> a normal write. Obviously this will fail when someone is trying to write 
> normal data to flash in MODE_RAW.
> 
> Question: is this realy the intended behaviour ???
> 
> It may be easy to fix this on kernel level, but may be there is some good 
> reason I don't know to do it as it is. And I don't want to break things.
> 
> Any comments welcome.

I think that is just broken stuff which is rarely used. Please, send a
set of fixes, but please, try to:

1. Fix both nandwrite and the kernel.
2. Test that non-raw functionality is not broken.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: nandwrite with raw oob data
  2011-06-06 12:10 ` Artem Bityutskiy
@ 2011-06-06 13:11   ` Peter Wippich
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Wippich @ 2011-06-06 13:11 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: linux-mtd


Hi Artem,

On Mon, 6 Jun 2011, Artem Bityutskiy wrote:

> On Sun, 2011-06-05 at 18:40 +0200, Peter Wippich wrote:
>> Dear all,
>>
>> I run into the same problem as outlined here before:
>> http://lists.infradead.org/pipermail/linux-mtd/2011-March/034516.html
>>
>> Going a little bit deeper it looks to me that writing any nand flash data
>> with raw (precomputed ECC) OOB data is not possible at all with a recent
>> Kernel and nandwrite version.
>>
>> What happens here is that nandwrite will set MTD_MODE_RAW when noecc is
>> specified. Doing so will force the kernel driver to write OOB data only on
>> a normal write. Obviously this will fail when someone is trying to write
>> normal data to flash in MODE_RAW.
>>
>> Question: is this realy the intended behaviour ???
>>
>> It may be easy to fix this on kernel level, but may be there is some good
>> reason I don't know to do it as it is. And I don't want to break things.
>>
>> Any comments welcome.
>
> I think that is just broken stuff which is rarely used. Please, send a
> set of fixes, but please, try to:
>
> 1. Fix both nandwrite and the kernel.
> 2. Test that non-raw functionality is not broken.
>

Digged a little bit deeper. The problem is much simpler:

Indeed write_oob can be used to write the data block. This is just what 
happens when writing in MODE_RAW. However, the initialization 
of the mtd_oob_ops structure used is to lazy and causes the write to fail 
later on. I will send a trivial patch later on.

Cheers,

Peter

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

end of thread, other threads:[~2011-06-06 13:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-05 16:40 nandwrite with raw oob data Peter Wippich
2011-06-06 12:10 ` Artem Bityutskiy
2011-06-06 13:11   ` Peter Wippich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox