[RFC/PATCH] mtd: m25p80: set writebufsize

Shawn J. Goff shawn7400 at gmail.com
Tue Jan 31 09:08:57 EST 2012


Yes, I ran into this problem myself and fixed it in a similar way.

Even after adding this fix, it turned out that I still couldn't boot
from a UBI volume because SPI comes up after UBI, so the UBI tries to
attach, but there is no MTD device to attach to.

On Tue, Jan 31, 2012 at 3:06 AM, Brian Norris
<computersforpeace at gmail.com> wrote:
> Using UBI on m25p80 can give messages like:
>
>    UBI error: io_init: bad write buffer size 0 for 1 min. I/O unit
>
> We need to initialize writebufsize; I think "page_size" is the correct
> "bufsize", although I'm not sure. Comments?
>
> Signed-off-by: Brian Norris <computersforpeace at gmail.com>
> ---
>  drivers/mtd/devices/m25p80.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index f83e4d0..8808da9 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -932,6 +932,7 @@ static int __devinit m25p_probe(struct spi_device *spi)
>        ppdata.of_node = spi->dev.of_node;
>        flash->mtd.dev.parent = &spi->dev;
>        flash->page_size = info->page_size;
> +       flash->mtd.writebufsize = flash->page_size;
>
>        if (info->addr_width)
>                flash->addr_width = info->addr_width;
> --
> 1.7.5.4
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/



More information about the linux-mtd mailing list