public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Sean Nyekjær" <sean.nyekjaer@prevas.dk>
To: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Richard Weinberger <richard@nod.at>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	Greg Cook <greg@morpheus.ws>,
	Miquel RAYNAL <miquel.raynal@free-electrons.com>,
	<stable@kernel.vger.org>
Subject: Re: [PATCH] mtd: nand: pxa3xx: Fix READOOB implementation
Date: Mon, 18 Dec 2017 13:45:16 +0100	[thread overview]
Message-ID: <4827ded9-a430-d6cf-4241-9d31ce2a89cd@prevas.dk> (raw)
In-Reply-To: <CAAEAJfBXbWPTU3s=oyiRrxegvq7g0+HquUdehbd8pRi3hEJQ8Q@mail.gmail.com>



On 2017-12-18 13:33, Ezequiel Garcia wrote:
> On 18 December 2017 at 07:32, Boris Brezillon
> <boris.brezillon@free-electrons.com> wrote:
>> In the current driver, OOB bytes are accessed in raw mode, and when a
>> page access is done with NDCR_SPARE_EN set and NDCR_ECC_EN cleared, the
>> driver must read the whole spare area (64 bytes in case of a 2k page,
>> 16 bytes for a 512 page). The driver was only reading the free OOB
>> bytes, which was leaving some unread data in the FIFO and was somehow
>> leading to a timeout.
>>
>> We could patch the driver to read ->spare_size + ->ecc_size instead of
>> just ->spare_size when READOOB is requested, but we'd better make
>> in-band and OOB accesses consistent.
>> Since the driver is always accessing in-band data in non-raw mode (with
>> the ECC engine enabled), we should also access OOB data in this mode.
>> That's particularly useful when using the BCH engine because in this
>> mode the free OOB bytes are also ECC protected.
>>
>> Fixes: 43bcfd2bb24a ("mtd: nand: pxa3xx: Add driver-specific ECC BCH support")
>> Cc: <stable@kernel.vger.org>
>> Reported-by: Sean Nyekjær <sean.nyekjaer@prevas.dk>
>> Tested-by: Willy Tarreau <w@1wt.eu>
>> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
>> ---
>>   drivers/mtd/nand/pxa3xx_nand.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
>> index 021374fe59dc..d1979c7dbe7e 100644
>> --- a/drivers/mtd/nand/pxa3xx_nand.c
>> +++ b/drivers/mtd/nand/pxa3xx_nand.c
>> @@ -961,6 +961,7 @@ static void prepare_start_command(struct pxa3xx_nand_info *info, int command)
>>
>>          switch (command) {
>>          case NAND_CMD_READ0:
>> +       case NAND_CMD_READOOB:
>>          case NAND_CMD_PAGEPROG:
>>                  info->use_ecc = 1;
>>                  break;
>> --
>> 2.11.0
>>
> Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
>
> Thanks a lot Boris!

Tested-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>

Thanks

  reply	other threads:[~2017-12-18 12:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 10:32 [PATCH] mtd: nand: pxa3xx: Fix READOOB implementation Boris Brezillon
2017-12-18 12:33 ` Ezequiel Garcia
2017-12-18 12:45   ` Sean Nyekjær [this message]
2017-12-18 17:37 ` Robert Jarzmik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4827ded9-a430-d6cf-4241-9d31ce2a89cd@prevas.dk \
    --to=sean.nyekjaer@prevas.dk \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=greg@morpheus.ws \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@free-electrons.com \
    --cc=richard@nod.at \
    --cc=stable@kernel.vger.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox