[PATCH 0/3] mtd: rawnand: More continuous read fixes

Miquel Raynal miquel.raynal at bootlin.com
Thu Mar 7 03:52:00 PST 2024


Hi Christophe,

> > I was expecting the ongoing boolean to always be reset at the end of
> > nand_do_read_ops(), I probably missed a scenario. In any case what is
> > probably needed for the sequencer to work is:
> > 
> > +++ b/drivers/mtd/nand/raw/nand_base.c
> > @@ -3726,6 +3726,7 @@ static int nand_do_read_ops(struct nand_chip *chip, loff_t from,
> >                  }
> >          }
> >          nand_deselect_target(chip);
> > +       chip->cont_read.ongoing = false;  
> 
> With this patch, it is OK, the continuous read feature will be disabled
> as expected in all cases.

Thanks to your feedback, I've thought again about this case. The fix
presented here will most likely work but does not sound ideal as we
still enable the continuous read internal flag without using it. So I
am drafting something else that should ensure we are always enabling
continuous read only when we can use it.

As a second step, I will reset the flag like above, but with a
WARN_ON_ONCE(). This way:
- If it happens that we missed another path where this is not disabled,
  there will be no behavioral bug (hopefully).
- We will still be notified by the warning.

Thanks for all your valuable feedback and testing. Let me know what
you think of this new series.

Thanks,
Miquèl



More information about the linux-mtd mailing list