[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191021193343.41320-1-kdasu.kdev@gmail.com>
Date: Mon, 21 Oct 2019 15:32:52 -0400
From: Kamal Dasu <kdasu.kdev@...il.com>
To: linux-mtd@...ts.infradead.org
Cc: bcm-kernel-feedback-list@...adcom.com,
linux-kernel@...r.kernel.org, Kamal Dasu <kdasu.kdev@...il.com>,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
Marek Vasut <marek.vasut@...il.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>
Subject: [PATCH] mtd: set mtd partition panic write flag
Check mtd panic write flag and set the mtd partition panic
write flag so that low level drivers can use it to take
required action to ensure oops data gets written to assigned
mtd partition.
Fixes: 9f897bfdd8 ("mtd: Add flag to indicate panic_write")
Signed-off-by: Kamal Dasu <kdasu.kdev@...il.com>
---
drivers/mtd/mtdpart.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 7328c066c5ba..b4f6479abeda 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -159,6 +159,10 @@ static int part_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
struct mtd_part *part = mtd_to_part(mtd);
+
+ if (mtd->oops_panic_write)
+ part->parent->oops_panic_write = true;
+
return part->parent->_panic_write(part->parent, to + part->offset, len,
retlen, buf);
}
--
2.17.1
Powered by blists - more mailing lists