* Patch "mtd: Fix partition alignment check on multi-erasesize devices" has been added to the 4.13-stable tree
@ 2017-10-02 12:30 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-10-02 12:30 UTC (permalink / raw)
To: boris.brezillon, Mathias.Thore, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
mtd: Fix partition alignment check on multi-erasesize devices
to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mtd-fix-partition-alignment-check-on-multi-erasesize-devices.patch
and it can be found in the queue-4.13 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 7e439681af82984045efc215437ebb2ca8d33a4c Mon Sep 17 00:00:00 2001
From: Boris Brezillon <boris.brezillon@free-electrons.com>
Date: Mon, 25 Sep 2017 10:19:57 +0200
Subject: mtd: Fix partition alignment check on multi-erasesize devices
From: Boris Brezillon <boris.brezillon@free-electrons.com>
commit 7e439681af82984045efc215437ebb2ca8d33a4c upstream.
Commit 1eeef2d7483a ("mtd: handle partitioning on devices with 0
erasesize") introduced a regression on heterogeneous erase region
devices. Alignment of the partition was tested against the master
eraseblock size which can be bigger than the slave one, thus leading
to some partitions being marked as read-only.
Update wr_alignment to match this slave erasesize after this erasesize
has been determined by picking the biggest erasesize of all the regions
embedded in the MTD partition.
Reported-by: Mathias Thore <Mathias.Thore@infinera.com>
Fixes: 1eeef2d7483a ("mtd: handle partitioning on devices with 0 erasesize")
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Mathias Thore <Mathias.Thore@infinera.com>
Reviewed-by: Mathias Thore <Mathias.Thore@infinera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mtd/mtdpart.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -581,6 +581,14 @@ static struct mtd_part *allocate_partiti
slave->mtd.erasesize = parent->erasesize;
}
+ /*
+ * Slave erasesize might differ from the master one if the master
+ * exposes several regions with different erasesize. Adjust
+ * wr_alignment accordingly.
+ */
+ if (!(slave->mtd.flags & MTD_NO_ERASE))
+ wr_alignment = slave->mtd.erasesize;
+
tmp = slave->offset;
remainder = do_div(tmp, wr_alignment);
if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
Patches currently in stable-queue which might be from boris.brezillon@free-electrons.com are
queue-4.13/mtd-fix-partition-alignment-check-on-multi-erasesize-devices.patch
queue-4.13/mtd-nand-atmel-fix-buffer-overflow-in-atmel_pmecc_user.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-02 12:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-02 12:30 Patch "mtd: Fix partition alignment check on multi-erasesize devices" has been added to the 4.13-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).