* [PATCH 2/8] mtd: doc2000: initialize writebufsize
2012-02-03 8:43 [PATCH 1/8] mtd: block2mtd: initialize writebufsize Artem Bityutskiy
@ 2012-02-03 8:43 ` Artem Bityutskiy
2012-02-03 8:43 ` [PATCH 3/8] mtd: doc2001: " Artem Bityutskiy
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2012-02-03 8:43 UTC (permalink / raw)
To: MTD Maling List
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 it to be equivalent to mtd->writesize because this is the maximum amount
of data the driver writes at a time.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: stable@kernel.org [2.6.38+]
---
drivers/mtd/devices/doc2000.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
index ffd01a6..115d890 100644
--- a/drivers/mtd/devices/doc2000.c
+++ b/drivers/mtd/devices/doc2000.c
@@ -562,7 +562,7 @@ void DoC2k_init(struct mtd_info *mtd)
mtd->type = MTD_NANDFLASH;
mtd->flags = MTD_CAP_NANDFLASH;
- mtd->writesize = 512;
+ mtd->writebufsize = mtd->writesize = 512;
mtd->oobsize = 16;
mtd->owner = THIS_MODULE;
mtd->_erase = doc_erase;
--
1.7.9
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 3/8] mtd: doc2001: initialize writebufsize
2012-02-03 8:43 [PATCH 1/8] mtd: block2mtd: initialize writebufsize Artem Bityutskiy
2012-02-03 8:43 ` [PATCH 2/8] mtd: doc2000: " Artem Bityutskiy
@ 2012-02-03 8:43 ` Artem Bityutskiy
2012-02-03 8:43 ` [PATCH 4/8] mtd: doc2001plus: " Artem Bityutskiy
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2012-02-03 8:43 UTC (permalink / raw)
To: MTD Maling List
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 it to be equivalent to mtd->writesize because this is the maximum amount
of data the driver writes at a time.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: stable@kernel.org [2.6.38+]
---
drivers/mtd/devices/doc2001.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c
index 3785733..b1185f9 100644
--- a/drivers/mtd/devices/doc2001.c
+++ b/drivers/mtd/devices/doc2001.c
@@ -346,7 +346,7 @@ void DoCMil_init(struct mtd_info *mtd)
/* FIXME: erase size is not always 8KiB */
mtd->erasesize = 0x2000;
- mtd->writesize = 512;
+ mtd->writebufsize = mtd->writesize = 512;
mtd->oobsize = 16;
mtd->owner = THIS_MODULE;
mtd->_erase = doc_erase;
--
1.7.9
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 4/8] mtd: doc2001plus: initialize writebufsize
2012-02-03 8:43 [PATCH 1/8] mtd: block2mtd: initialize writebufsize Artem Bityutskiy
2012-02-03 8:43 ` [PATCH 2/8] mtd: doc2000: " Artem Bityutskiy
2012-02-03 8:43 ` [PATCH 3/8] mtd: doc2001: " Artem Bityutskiy
@ 2012-02-03 8:43 ` Artem Bityutskiy
2012-02-03 8:43 ` [PATCH 5/8] mtd: docg3: " Artem Bityutskiy
` (4 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2012-02-03 8:43 UTC (permalink / raw)
To: MTD Maling List
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 it to be equivalent to mtd->writesize because this is the maximum amount
of data the driver writes at a time.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: stable@kernel.org [2.6.38+]
---
drivers/mtd/devices/doc2001plus.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c
index 409fa31..c9fbadd 100644
--- a/drivers/mtd/devices/doc2001plus.c
+++ b/drivers/mtd/devices/doc2001plus.c
@@ -467,7 +467,7 @@ void DoCMilPlus_init(struct mtd_info *mtd)
mtd->type = MTD_NANDFLASH;
mtd->flags = MTD_CAP_NANDFLASH;
- mtd->writesize = 512;
+ mtd->writebufsize = mtd->writesize = 512;
mtd->oobsize = 16;
mtd->owner = THIS_MODULE;
mtd->_erase = doc_erase;
--
1.7.9
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 5/8] mtd: docg3: initialize writebufsize
2012-02-03 8:43 [PATCH 1/8] mtd: block2mtd: initialize writebufsize Artem Bityutskiy
` (2 preceding siblings ...)
2012-02-03 8:43 ` [PATCH 4/8] mtd: doc2001plus: " Artem Bityutskiy
@ 2012-02-03 8:43 ` Artem Bityutskiy
2012-02-03 15:44 ` Robert Jarzmik
2012-02-03 8:43 ` [PATCH 6/8] mtd: lart: " Artem Bityutskiy
` (3 subsequent siblings)
7 siblings, 1 reply; 12+ messages in thread
From: Artem Bityutskiy @ 2012-02-03 8:43 UTC (permalink / raw)
To: MTD Maling List; +Cc: Robert Jarzmik
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 it to be equivalent to mtd->writesize because this is the maximum amount
of data the driver writes at a time.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: stable@kernel.org [3.2+]
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
---
drivers/mtd/devices/docg3.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 3746ae8..fc7932b 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -1817,7 +1817,7 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd)
mtd->erasesize = DOC_LAYOUT_BLOCK_SIZE * DOC_LAYOUT_NBPLANES;
if (docg3->reliable == 2)
mtd->erasesize /= 2;
- mtd->writesize = DOC_LAYOUT_PAGE_SIZE;
+ mtd->writebufsize = mtd->writesize = DOC_LAYOUT_PAGE_SIZE;
mtd->oobsize = DOC_LAYOUT_OOB_SIZE;
mtd->owner = THIS_MODULE;
mtd->_erase = doc_erase;
--
1.7.9
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 5/8] mtd: docg3: initialize writebufsize
2012-02-03 8:43 ` [PATCH 5/8] mtd: docg3: " Artem Bityutskiy
@ 2012-02-03 15:44 ` Robert Jarzmik
0 siblings, 0 replies; 12+ messages in thread
From: Robert Jarzmik @ 2012-02-03 15:44 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: MTD Maling List
Artem Bityutskiy <dedekind1@gmail.com> writes:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>
> 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 it to be equivalent to mtd->writesize because this is the maximum amount
> of data the driver writes at a time.
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
--
Robert
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 6/8] mtd: lart: initialize writebufsize
2012-02-03 8:43 [PATCH 1/8] mtd: block2mtd: initialize writebufsize Artem Bityutskiy
` (3 preceding siblings ...)
2012-02-03 8:43 ` [PATCH 5/8] mtd: docg3: " Artem Bityutskiy
@ 2012-02-03 8:43 ` Artem Bityutskiy
2012-02-03 8:43 ` [PATCH 7/8] mtd: spear_smi: " Artem Bityutskiy
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2012-02-03 8:43 UTC (permalink / raw)
To: MTD Maling List
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 <artem.bityutskiy@linux.intel.com>
Cc: stable@kernel.org [2.6.38+]
---
drivers/mtd/devices/lart.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c
index a595848..6d6502c 100644
--- a/drivers/mtd/devices/lart.c
+++ b/drivers/mtd/devices/lart.c
@@ -630,6 +630,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;
--
1.7.9
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 7/8] mtd: spear_smi: initialize writebufsize
2012-02-03 8:43 [PATCH 1/8] mtd: block2mtd: initialize writebufsize Artem Bityutskiy
` (4 preceding siblings ...)
2012-02-03 8:43 ` [PATCH 6/8] mtd: lart: " Artem Bityutskiy
@ 2012-02-03 8:43 ` Artem Bityutskiy
2012-02-03 8:45 ` Stefan Roese
2012-02-03 8:43 ` [PATCH 8/8] mtd: sst25l: " Artem Bityutskiy
2012-02-04 18:00 ` [PATCH 1/8] mtd: block2mtd: " Jörn Engel
7 siblings, 1 reply; 12+ messages in thread
From: Artem Bityutskiy @ 2012-02-03 8:43 UTC (permalink / raw)
To: MTD Maling List; +Cc: Shiraz Hashim, spear--sw-devel, Stefan Roese
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 <artem.bityutskiy@linux.intel.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Shiraz Hashim <shiraz.hashim@st.com>
Cc: spear--sw-devel@lists.codex.cro.st.com
---
drivers/mtd/devices/spear_smi.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index 77bcb0b..b4c02d6 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -847,6 +847,7 @@ static int spear_smi_setup_banks(struct platform_device *pdev, u32 bank)
flash->mtd.size = flash_info->size;
flash->mtd.erasesize = flash_devices[flash_index].sectorsize;
flash->page_size = flash_devices[flash_index].pagesize;
+ flash->mtd.writebufsize = flash->page_size;
flash->erase_cmd = flash_devices[flash_index].erase_cmd;
flash->mtd._erase = spear_mtd_erase;
flash->mtd._read = spear_mtd_read;
--
1.7.9
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 7/8] mtd: spear_smi: initialize writebufsize
2012-02-03 8:43 ` [PATCH 7/8] mtd: spear_smi: " Artem Bityutskiy
@ 2012-02-03 8:45 ` Stefan Roese
0 siblings, 0 replies; 12+ messages in thread
From: Stefan Roese @ 2012-02-03 8:45 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: Shiraz Hashim, MTD Maling List
On Friday 03 February 2012 09:43:13 Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>
> 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 <artem.bityutskiy@linux.intel.com>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Shiraz Hashim <shiraz.hashim@st.com>
> Cc: spear--sw-devel@lists.codex.cro.st.com
Acked-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 8/8] mtd: sst25l: initialize writebufsize
2012-02-03 8:43 [PATCH 1/8] mtd: block2mtd: initialize writebufsize Artem Bityutskiy
` (5 preceding siblings ...)
2012-02-03 8:43 ` [PATCH 7/8] mtd: spear_smi: " Artem Bityutskiy
@ 2012-02-03 8:43 ` Artem Bityutskiy
2012-02-04 18:00 ` [PATCH 1/8] mtd: block2mtd: " Jörn Engel
7 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2012-02-03 8:43 UTC (permalink / raw)
To: MTD Maling List
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 <artem.bityutskiy@linux.intel.com>
---
drivers/mtd/devices/sst25l.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
index a665eba..8b9ffaf 100644
--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -402,6 +402,7 @@ static int __devinit sst25l_probe(struct spi_device *spi)
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;
--
1.7.9
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 1/8] mtd: block2mtd: initialize writebufsize
2012-02-03 8:43 [PATCH 1/8] mtd: block2mtd: initialize writebufsize Artem Bityutskiy
` (6 preceding siblings ...)
2012-02-03 8:43 ` [PATCH 8/8] mtd: sst25l: " Artem Bityutskiy
@ 2012-02-04 18:00 ` Jörn Engel
2012-02-06 9:07 ` Artem Bityutskiy
7 siblings, 1 reply; 12+ messages in thread
From: Jörn Engel @ 2012-02-04 18:00 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: MTD Maling List
On Fri, 3 February 2012 10:43:07 +0200, Artem Bityutskiy wrote:
>
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>
> 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 <artem.bityutskiy@linux.intel.com>
> Cc: stable@kernel.org [2.6.38+]
> Cc: Joern Engel <joern@lazybastard.org>
Acked-by: Joern Engel <joern@lazybastard.org>
>From the description of 0e4ca7e it appears as if using a minimum of
say 8 for ubifs recovery would have done the trick as well. Oh well!
Jörn
^ permalink raw reply [flat|nested] 12+ messages in thread