Re: mtd: spinand: wait on erase success in spinand_markbad?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 19 Dec 2018 14:27:51 +0100
Emil Lenngren <emil.lenngren@xxxxxxxxx> wrote:

> 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?
> 

Absolutely. Can you send a patch to fix that?

Thanks,

Boris

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



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux