From 9e42012103bfaa25e58fa46466d6d227ab6ac15c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 4 Apr 2012 10:37:50 -0700 Subject: [PATCH] 3.0-stable patches added patches: mtd-block2mtd-initialize-writebufsize.patch mtd-lart-initialize-writebufsize.patch mtd-m25p80-set-writebufsize.patch mtd-sst25l-initialize-writebufsize.patch --- ...td-block2mtd-initialize-writebufsize.patch | 37 +++++++++++++++++++ .../mtd-lart-initialize-writebufsize.patch | 35 ++++++++++++++++++ queue-3.0/mtd-m25p80-set-writebufsize.patch | 35 ++++++++++++++++++ .../mtd-sst25l-initialize-writebufsize.patch | 36 ++++++++++++++++++ queue-3.0/series | 4 ++ 5 files changed, 147 insertions(+) create mode 100644 queue-3.0/mtd-block2mtd-initialize-writebufsize.patch create mode 100644 queue-3.0/mtd-lart-initialize-writebufsize.patch create mode 100644 queue-3.0/mtd-m25p80-set-writebufsize.patch create mode 100644 queue-3.0/mtd-sst25l-initialize-writebufsize.patch diff --git a/queue-3.0/mtd-block2mtd-initialize-writebufsize.patch b/queue-3.0/mtd-block2mtd-initialize-writebufsize.patch new file mode 100644 index 00000000000..38e39b04618 --- /dev/null +++ b/queue-3.0/mtd-block2mtd-initialize-writebufsize.patch @@ -0,0 +1,37 @@ +From b604387411ec6a072e95910099262616edd2bd2f Mon Sep 17 00:00:00 2001 +From: Artem Bityutskiy +Date: Fri, 3 Feb 2012 09:32:44 +0200 +Subject: mtd: block2mtd: initialize writebufsize + +From: Artem Bityutskiy + +commit b604387411ec6a072e95910099262616edd2bd2f upstream. + +The writebufsize concept was introduce by commit +"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents +the maximum amount of data the device writes to the media at a time. This is +an important parameter for UBIFS which is used during recovery and which +basically defines how big a corruption caused by a power cut can be. + +However, we forgot to set this parameter for block2mtd. Set it to PAGE_SIZE +because this is actually the amount of data we write at a time. + +Signed-off-by: Artem Bityutskiy +Acked-by: Joern Engel +Signed-off-by: David Woodhouse +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/devices/block2mtd.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/devices/block2mtd.c ++++ b/drivers/mtd/devices/block2mtd.c +@@ -284,6 +284,7 @@ static struct block2mtd_dev *add_device( + dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK; + dev->mtd.erasesize = erase_size; + dev->mtd.writesize = 1; ++ dev->mtd.writebufsize = PAGE_SIZE; + dev->mtd.type = MTD_RAM; + dev->mtd.flags = MTD_CAP_RAM; + dev->mtd.erase = block2mtd_erase; diff --git a/queue-3.0/mtd-lart-initialize-writebufsize.patch b/queue-3.0/mtd-lart-initialize-writebufsize.patch new file mode 100644 index 00000000000..3e02ca02819 --- /dev/null +++ b/queue-3.0/mtd-lart-initialize-writebufsize.patch @@ -0,0 +1,35 @@ +From fcc44a07dae0af16e84e93425fc8afe642ddc603 Mon Sep 17 00:00:00 2001 +From: Artem Bityutskiy +Date: Fri, 3 Feb 2012 09:53:28 +0200 +Subject: mtd: lart: initialize writebufsize + +From: Artem Bityutskiy + +commit fcc44a07dae0af16e84e93425fc8afe642ddc603 upstream. + +The writebufsize concept was introduce by commit +"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents +the maximum amount of data the device writes to the media at a time. This is +an important parameter for UBIFS which is used during recovery and which +basically defines how big a corruption caused by a power cut can be. + +Set writebufsize to 4 because this drivers writes at max 4 bytes at a time. + +Signed-off-by: Artem Bityutskiy +Signed-off-by: David Woodhouse +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/devices/lart.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/devices/lart.c ++++ b/drivers/mtd/devices/lart.c +@@ -636,6 +636,7 @@ static int __init lart_flash_init (void) + mtd.name = module_name; + mtd.type = MTD_NORFLASH; + mtd.writesize = 1; ++ mtd.writebufsize = 4; + mtd.flags = MTD_CAP_NORFLASH; + mtd.size = FLASH_BLOCKSIZE_PARAM * FLASH_NUMBLOCKS_16m_PARAM + FLASH_BLOCKSIZE_MAIN * FLASH_NUMBLOCKS_16m_MAIN; + mtd.erasesize = FLASH_BLOCKSIZE_MAIN; diff --git a/queue-3.0/mtd-m25p80-set-writebufsize.patch b/queue-3.0/mtd-m25p80-set-writebufsize.patch new file mode 100644 index 00000000000..6ce1d52ba2e --- /dev/null +++ b/queue-3.0/mtd-m25p80-set-writebufsize.patch @@ -0,0 +1,35 @@ +From b54f47c8bcfc5f766bf13ec31bd7dd1d4726d33b Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Tue, 31 Jan 2012 00:06:03 -0800 +Subject: mtd: m25p80: set writebufsize + +From: Brian Norris + +commit b54f47c8bcfc5f766bf13ec31bd7dd1d4726d33b upstream. + +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 +Signed-off-by: Artem Bityutskiy +Signed-off-by: David Woodhouse +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/devices/m25p80.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/devices/m25p80.c ++++ b/drivers/mtd/devices/m25p80.c +@@ -930,6 +930,7 @@ static int __devinit m25p_probe(struct s + + 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; diff --git a/queue-3.0/mtd-sst25l-initialize-writebufsize.patch b/queue-3.0/mtd-sst25l-initialize-writebufsize.patch new file mode 100644 index 00000000000..853bf445f89 --- /dev/null +++ b/queue-3.0/mtd-sst25l-initialize-writebufsize.patch @@ -0,0 +1,36 @@ +From c4cc625ea5958d065c21cc0fcea29e9ed8f3d2bc Mon Sep 17 00:00:00 2001 +From: Artem Bityutskiy +Date: Fri, 3 Feb 2012 10:16:50 +0200 +Subject: mtd: sst25l: initialize writebufsize + +From: Artem Bityutskiy + +commit c4cc625ea5958d065c21cc0fcea29e9ed8f3d2bc upstream. + +The writebufsize concept was introduce by commit +"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents +the maximum amount of data the device writes to the media at a time. This is +an important parameter for UBIFS which is used during recovery and which +basically defines how big a corruption caused by a power cut can be. + +Set writebufsize to the flash page size because it is the maximum amount of +data it writes at a time. + +Signed-off-by: Artem Bityutskiy +Signed-off-by: David Woodhouse +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/devices/sst25l.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/devices/sst25l.c ++++ b/drivers/mtd/devices/sst25l.c +@@ -406,6 +406,7 @@ static int __devinit sst25l_probe(struct + flash->mtd.flags = MTD_CAP_NORFLASH; + flash->mtd.erasesize = flash_info->erase_size; + flash->mtd.writesize = flash_info->page_size; ++ flash->mtd.writebufsize = flash_info->page_size; + flash->mtd.size = flash_info->page_size * flash_info->nr_pages; + flash->mtd.erase = sst25l_erase; + flash->mtd.read = sst25l_read; diff --git a/queue-3.0/series b/queue-3.0/series index 6f355cc4571..250e84e6983 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -1,3 +1,7 @@ x86-bpf_jit-fix-a-bug-in-emitting-the-16-bit-immediate-operand-of-and.patch rose_dev-fix-memcpy-bug-in-rose_set_mac_address.patch net-usb-cdc_eem-fix-mtu.patch +mtd-sst25l-initialize-writebufsize.patch +mtd-block2mtd-initialize-writebufsize.patch +mtd-lart-initialize-writebufsize.patch +mtd-m25p80-set-writebufsize.patch -- 2.47.3