public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <bbrezillon@kernel.org>
To: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Cc: Esben Haabendal <eha@deif.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"Per N. Christensen" <pnc@deif.com>
Subject: Re: subpage reads/writes with fsl_elbc_nand driver
Date: Thu, 31 Jan 2019 17:14:14 +0100	[thread overview]
Message-ID: <20190131171330.221e200c@bbrezillon> (raw)
In-Reply-To: <add8754e-e044-a6d7-2ead-067777afbde4@prevas.dk>

On Thu, 31 Jan 2019 14:24:15 +0000
Rasmus Villemoes <rasmus.villemoes@prevas.dk> wrote:

> I'm in the process of upgrading a board from an old 3.14-based kernel
> with quite a few out-of-tree patches to one based on 4.19, hopefully
> with much fewer such patches.
> 
> In order to even get the new kernel to mount the existing root
> filesystem, I've had to apply the hacks below:
> 
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -6657,6 +6657,11 @@ static int nand_scan_tail(struct mtd_info *mtd)
>                 pr_warn("WARNING: %s: the ECC used on your system is too
> weak compared to the one required by the NAND chip\n",
>                         mtd->name);
> 
> +       if (IS_ENABLED(CONFIG_ML300PCM31)) {
> +               pr_warn("setting NAND_NO_SUBPAGE_WRITE bit\n");
> +               chip->ecc.write_subpage = NULL;
> +               chip->options |= NAND_NO_SUBPAGE_WRITE;
> +       }
>         /* Allow subpage writes up to ecc.steps. Not possible for MLC
> flash */
>         if (!(chip->options & NAND_NO_SUBPAGE_WRITE) && nand_is_slc(chip)) {
>                 switch (ecc->steps) {
> @@ -6681,8 +6686,12 @@ static int nand_scan_tail(struct mtd_info *mtd)
>         /* Large page NAND with SOFT_ECC should support subpage reads */
>         switch (ecc->mode) {
>         case NAND_ECC_SOFT:
> -               if (chip->page_shift > 9)
> -                       chip->options |= NAND_SUBPAGE_READ;
> +               if (chip->page_shift > 9) {
> +                       if (IS_ENABLED(CONFIG_ML300PCM31))
> +                               pr_warn("setting of NAND_SUBPAGE_READ
> bit has been patched out\n");
> +                       else
> +                               chip->options |= NAND_SUBPAGE_READ;
> +               }
>                 break;
> 
> Without the latter, I get
> 
>     [    0.833134] fsl,elbc-fcm-nand fff00000.nand: fsl_elbc_cmdfunc:
> error, unsupported command 0x5.
>     [    0.841822] fsl,elbc-fcm-nand fff00000.nand: read_buf beyond end
> of buffer (14 requested, 0 available)

For that part of the problem, you should consider converting the driver
to ->exec_op().

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      parent reply	other threads:[~2019-01-31 16:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 14:24 subpage reads/writes with fsl_elbc_nand driver Rasmus Villemoes
2019-01-31 16:11 ` Boris Brezillon
2019-02-04 12:42   ` Rasmus Villemoes
2019-01-31 16:14 ` Boris Brezillon [this message]

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=20190131171330.221e200c@bbrezillon \
    --to=bbrezillon@kernel.org \
    --cc=eha@deif.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pnc@deif.com \
    --cc=rasmus.villemoes@prevas.dk \
    /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