[PATCH v2] mtd: gpmi: Deal with bitflips in erased regions regions

Huang Shijie shijie8 at gmail.com
Mon Dec 16 08:00:50 EST 2013


On Mon, Dec 16, 2013 at 10:43:34AM +0100, Elie De Brauwer wrote:
> On Mon, Dec 16, 2013 at 5:30 AM, Huang Shijie <b32955 at freescale.com> wrote:
 >> +/* Returns 1 if the last transaction consisted only out of ones. */
> >> +int gpmi_allones(struct gpmi_nand_data *this)
> >> +{
> >> +     struct resources *r = &this->resources;
> >> +     uint32_t reg = readl(r->gpmi_regs + HW_BCH_STATUS0);
> > please add a empty line here.
> >> +     if (reg & BM_BCH_STATUS0_ALLONES_MASK)
> >> +             return 1;
> >> +     return 0;
> > We can simplify the code to:
> >         return reg & BM_BCH_STATUS0_ALLONES_MASK;
> >
> 
> I was doing some stress testing on this piece of code today, but I'm
> afraid the ALLONES solution apparently does not work. If I look at the
> BCH_STATUS0 register while doing some heavy flash access, the
> (entire) register remains zero at all times, while I would at least expect the
how do you do the stress test, and how do you know the register is zero?

I can test it on my side too.

thanks
Huang Shijie



More information about the linux-mtd mailing list