All of lore.kernel.org
 help / color / mirror / Atom feed
* Handle eraseblocks containing the bad-block table in UBI
@ 2018-01-12 15:48 Bogdan Harjoc
  2018-01-12 20:52 ` Richard Weinberger
  0 siblings, 1 reply; 4+ messages in thread
From: Bogdan Harjoc @ 2018-01-12 15:48 UTC (permalink / raw)
  To: linux-mtd

With some Macronix NANDs that present the bad-blocks table at a fixed
eraseblock, UBI tries to use the PEB as data and this results in the
"Bad node, ff ff ff ..." symptoms.

Should UBI receive this special status of the bbt PEBs via the
mtd_isbad() result values (in the Macronix case, mtd_block_isbad()
returns false for the PEB containing the bbt), or are 'bbt PEBs' not
supported in UBI ?

Thanks,
Bogdan Harjoc

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

* Re: Handle eraseblocks containing the bad-block table in UBI
  2018-01-12 15:48 Handle eraseblocks containing the bad-block table in UBI Bogdan Harjoc
@ 2018-01-12 20:52 ` Richard Weinberger
  2018-01-13 12:46   ` Bogdan Harjoc
       [not found]   ` <CAF4+tmpcv-zTJKj++AwRfU=vf3OjhK2_jDvJS-KyNX3mZW_uNg@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Weinberger @ 2018-01-12 20:52 UTC (permalink / raw)
  To: Bogdan Harjoc; +Cc: linux-mtd

Bogdan,

On Fri, Jan 12, 2018 at 4:48 PM, Bogdan Harjoc <harjoc@gmail.com> wrote:
> With some Macronix NANDs that present the bad-blocks table at a fixed
> eraseblock, UBI tries to use the PEB as data and this results in the
> "Bad node, ff ff ff ..." symptoms.
>
> Should UBI receive this special status of the bbt PEBs via the
> mtd_isbad() result values (in the Macronix case, mtd_block_isbad()
> returns false for the PEB containing the bbt), or are 'bbt PEBs' not
> supported in UBI ?

Usually blocks containing the BBT are also marked as bad to avoid the
problem you're facing.
So, yes UBI should not see these PEBs because they should look like bad blocks.

Is this a kernel with vendor hackery?

-- 
Thanks,
//richard

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

* Re: Handle eraseblocks containing the bad-block table in UBI
  2018-01-12 20:52 ` Richard Weinberger
@ 2018-01-13 12:46   ` Bogdan Harjoc
       [not found]   ` <CAF4+tmpcv-zTJKj++AwRfU=vf3OjhK2_jDvJS-KyNX3mZW_uNg@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Bogdan Harjoc @ 2018-01-13 12:46 UTC (permalink / raw)
  To: linux-mtd

On Fri, Jan 12, 2018 at 10:52 PM, Richard Weinberger
<richard.weinberger@gmail.com> wrote:
> Usually blocks containing the BBT are also marked as bad to avoid the
> problem you're facing.
> So, yes UBI should not see these PEBs because they should look like bad blocks.
>
> Is this a kernel with vendor hackery?

It is, at least the nand probing code adds its own nand_bbt_descr
structs. Since the issue goes away by adding an

if (ec_hdr->magic == 'Bbt0' or '1bbT')
   treat_it_as_bad_block()

in ubi_io_read_ec_hdr(), I will see where the bad-block status for the
bbt PEBs gets lost.

Thank you,
Bogdan

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

* Re: Handle eraseblocks containing the bad-block table in UBI
       [not found]   ` <CAF4+tmpcv-zTJKj++AwRfU=vf3OjhK2_jDvJS-KyNX3mZW_uNg@mail.gmail.com>
@ 2018-01-13 14:17     ` Richard Weinberger
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Weinberger @ 2018-01-13 14:17 UTC (permalink / raw)
  To: Bogdan Harjoc; +Cc: linux-mtd

Am Samstag, 13. Januar 2018, 13:44:54 CET schrieb Bogdan Harjoc:
> On Fri, Jan 12, 2018 at 10:52 PM, Richard Weinberger
> 
> <richard.weinberger@gmail.com> wrote:
> > Usually blocks containing the BBT are also marked as bad to avoid the
> > problem you're facing.
> > So, yes UBI should not see these PEBs because they should look like bad
> > blocks.
> > 
> > Is this a kernel with vendor hackery?
> 
> It is, at least the nand probing code adds its own nand_bbt_descr
> structs. Since the issue goes away by adding an
> 
> if (ec_hdr->magic == 'Bbt0' or '1bbT')
>    treat_it_as_bad_block()
> 
> in ubi_io_read_ec_hdr(), I will see where the bad-block status for the
> bbt PEBs gets lost.

UBI is the wrong layer to address this.
Please make sure that these blocks are handled in the NAND core.
BBT_BLOCK_RESERVED is the flag you need for them.

Thanks,
//richard

-- 
sigma star gmbh - Eduard-Bodem-Gasse 6 - 6020 Innsbruck - Austria
ATU66964118 - FN 374287y

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

end of thread, other threads:[~2018-01-13 14:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 15:48 Handle eraseblocks containing the bad-block table in UBI Bogdan Harjoc
2018-01-12 20:52 ` Richard Weinberger
2018-01-13 12:46   ` Bogdan Harjoc
     [not found]   ` <CAF4+tmpcv-zTJKj++AwRfU=vf3OjhK2_jDvJS-KyNX3mZW_uNg@mail.gmail.com>
2018-01-13 14:17     ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.