linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: denali: disable usage of subpages
@ 2014-04-30 12:46 Sebastian Andrzej Siewior
  2014-04-30 22:23 ` Brian Norris
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-04-30 12:46 UTC (permalink / raw)
  To: Huang Shijie
  Cc: Sebastian Andrzej Siewior, Josh Triplett, linux-mtd,
	Brian Norris, David Woodhouse, Dinh Nguyen

I use this driver on an Altera SoC (not MRST) and its ECC algorithm
does not compute 0xff ECC of an empty page. That problem can be easily
noticed if ubifs is used. Therefore I disable subpages support.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
I can't test if this is also the case for MRST or not.

 drivers/mtd/nand/denali.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index c07cd57..44f2c8b 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1524,6 +1524,8 @@ int denali_init(struct denali_nand_info *denali)
 	denali->nand.options |= NAND_SKIP_BBTSCAN;
 	denali->nand.ecc.mode = NAND_ECC_HW_SYNDROME;
 
+	denali->nand.options |= NAND_NO_SUBPAGE_WRITE;
+
 	/* Denali Controller only support 15bit and 8bit ECC in MRST,
 	 * so just let controller do 15bit ECC for MLC and 8bit ECC for
 	 * SLC if possible.
-- 
1.9.2

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

* Re: [PATCH] mtd: denali: disable usage of subpages
  2014-04-30 12:46 [PATCH] mtd: denali: disable usage of subpages Sebastian Andrzej Siewior
@ 2014-04-30 22:23 ` Brian Norris
  2014-05-06 18:11   ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Norris @ 2014-04-30 22:23 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: Huang Shijie, Josh Triplett, linux-mtd, Pekon Gupta,
	David Woodhouse, Dinh Nguyen

On Wed, Apr 30, 2014 at 02:46:41PM +0200, Sebastian Andrzej Siewior wrote:
> I use this driver on an Altera SoC (not MRST) and its ECC algorithm
> does not compute 0xff ECC of an empty page. That problem can be easily
> noticed if ubifs is used. Therefore I disable subpages support.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> I can't test if this is also the case for MRST or not.

This is an important change to get right; if any systems have been using
Denali NAND with subpage writes, then this change will break any flash
with existing UBI data. Can we either confirm that no Denali systems
were using subpage writes successfully, or else tie this option to some
kind of platform data or DT information (e.g., compatible string)?

Or is this related to commit 837a6ba4f3b6d23026674e6af6b6849a4634fff9,
which changed subpage write support? (Or conversely, could this help you
support subpage writes properly?)

Brian

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

* Re: [PATCH] mtd: denali: disable usage of subpages
  2014-04-30 22:23 ` Brian Norris
@ 2014-05-06 18:11   ` Sebastian Andrzej Siewior
  2014-07-08  7:22     ` Gupta, Pekon
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-05-06 18:11 UTC (permalink / raw)
  To: Brian Norris
  Cc: Huang Shijie, Josh Triplett, linux-mtd, Pekon Gupta,
	David Woodhouse, Dinh Nguyen

On 05/01/2014 12:23 AM, Brian Norris wrote:
> On Wed, Apr 30, 2014 at 02:46:41PM +0200, Sebastian Andrzej Siewior wrote:
>> I use this driver on an Altera SoC (not MRST) and its ECC algorithm
>> does not compute 0xff ECC of an empty page. That problem can be easily
>> noticed if ubifs is used. Therefore I disable subpages support.
>>
>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>> ---
>> I can't test if this is also the case for MRST or not.
> 
> This is an important change to get right; if any systems have been using
> Denali NAND with subpage writes, then this change will break any flash
> with existing UBI data. Can we either confirm that no Denali systems
> were using subpage writes successfully, or else tie this option to some
> kind of platform data or DT information (e.g., compatible string)?

First I would like to get some confirmation from the MRST hackers /
users to make sure subpage write works for them (which I doubt).

> Or is this related to commit 837a6ba4f3b6d23026674e6af6b6849a4634fff9,
> which changed subpage write support? (Or conversely, could this help you
> support subpage writes properly?)

Not sure. If I look at the write_page() function in delali, it writes
the whole page in one go. The ECC is transparently added. On read, the
controller computes the data to fix and the driver just XORs the data
(with the information the controller provided). And in case the the
error is not recoverable it checks for an empty page which means 0xff is
not the ECC for an empty page.
Based on this I don't see how that commit could help.

> 
> Brian

Sebastian

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

* RE: [PATCH] mtd: denali: disable usage of subpages
  2014-05-06 18:11   ` Sebastian Andrzej Siewior
@ 2014-07-08  7:22     ` Gupta, Pekon
  2014-07-08  7:25       ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Gupta, Pekon @ 2014-07-08  7:22 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, Brian Norris
  Cc: David Woodhouse, Dinh Nguyen, Huang Shijie, Josh Triplett, linux-mtd

Hi Sebastien,

>From: Sebastian Andrzej Siewior [mailto:bigeasy@linutronix.de]
>>On 05/01/2014 12:23 AM, Brian Norris wrote:
>> On Wed, Apr 30, 2014 at 02:46:41PM +0200, Sebastian Andrzej Siewior wrote:
>>> I use this driver on an Altera SoC (not MRST) and its ECC algorithm
>>> does not compute 0xff ECC of an empty page. That problem can be easily
>>> noticed if ubifs is used. Therefore I disable subpages support.
>>>
>>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>>> ---
>>> I can't test if this is also the case for MRST or not.
>>
>> This is an important change to get right; if any systems have been using
>> Denali NAND with subpage writes, then this change will break any flash
>> with existing UBI data. Can we either confirm that no Denali systems
>> were using subpage writes successfully, or else tie this option to some
>> kind of platform data or DT information (e.g., compatible string)?
>
>First I would like to get some confirmation from the MRST hackers /
>users to make sure subpage write works for them (which I doubt).
>
>> Or is this related to commit 837a6ba4f3b6d23026674e6af6b6849a4634fff9,
>> which changed subpage write support? (Or conversely, could this help you
>> support subpage writes properly?)
>
>Not sure. If I look at the write_page() function in delali, it writes
>the whole page in one go. The ECC is transparently added. On read, the
>controller computes the data to fix and the driver just XORs the data
>(with the information the controller provided). And in case the the
>error is not recoverable it checks for an empty page which means 0xff is
>not the ECC for an empty page.
>Based on this I don't see how that commit could help.
>
I have tried fixing the write_subpage generic interface to write only relevant
subpage data to NAND device. However I wasn't able to test it much.
Would it be possible for you to test these?

http://lists.infradead.org/pipermail/linux-mtd/2014-June/054446.html
http://patchwork.ozlabs.org/patch/365537/
http://patchwork.ozlabs.org/patch/365538/

with regards, pekon

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

* Re: [PATCH] mtd: denali: disable usage of subpages
  2014-07-08  7:22     ` Gupta, Pekon
@ 2014-07-08  7:25       ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-07-08  7:25 UTC (permalink / raw)
  To: Gupta, Pekon, Brian Norris
  Cc: David Woodhouse, Dinh Nguyen, Huang Shijie, Josh Triplett, linux-mtd

On 07/08/2014 09:22 AM, Gupta, Pekon wrote:
> Hi Sebastien,

Hi Pekon,

> I have tried fixing the write_subpage generic interface to write only relevant
> subpage data to NAND device. However I wasn't able to test it much.
> Would it be possible for you to test these?

No, I don't have the hardware anymore.

> 
> with regards, pekon

Sebastian

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

end of thread, other threads:[~2014-07-08  7:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 12:46 [PATCH] mtd: denali: disable usage of subpages Sebastian Andrzej Siewior
2014-04-30 22:23 ` Brian Norris
2014-05-06 18:11   ` Sebastian Andrzej Siewior
2014-07-08  7:22     ` Gupta, Pekon
2014-07-08  7:25       ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).