linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* mtd: spinand: wait on erase success in spinand_markbad?
@ 2018-12-19 13:27 Emil Lenngren
  2018-12-19 18:56 ` Boris Brezillon
  0 siblings, 1 reply; 4+ messages in thread
From: Emil Lenngren @ 2018-12-19 13:27 UTC (permalink / raw)
  To: linux-mtd

Hi,

I was just reading the spinand driver and found this piece of code:
static int spinand_markbad(struct nand_device *nand, const struct nand_pos *pos)
{
    struct spinand_device *spinand = nand_to_spinand(nand);
    struct nand_page_io_req req = {
        .pos = *pos,
        .ooboffs = 0,
        .ooblen = 2,
        .oobbuf.out = spinand->oobbuf,
    };
    int ret;

    /* Erase block before marking it bad. */
    ret = spinand_select_target(spinand, pos->target);
    if (ret)
        return ret;

    ret = spinand_write_enable_op(spinand);
    if (ret)
        return ret;

    spinand_erase_op(spinand, pos);

    memset(spinand->oobbuf, 0, 2);
    return spinand_write_page(spinand, &req);
}

Shouldn't there be spinand_wait call after spinand_erase_op and before
spinand_write_page?

/Emil

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

end of thread, other threads:[~2018-12-20 10:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-19 13:27 mtd: spinand: wait on erase success in spinand_markbad? Emil Lenngren
2018-12-19 18:56 ` Boris Brezillon
2018-12-19 19:54   ` Emil Lenngren
2018-12-20 10:30     ` Boris Brezillon

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).