linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: set mtd partition panic write flag
@ 2019-10-21 19:32 Kamal Dasu
  2019-11-05 19:03 ` Miquel Raynal
  0 siblings, 1 reply; 10+ messages in thread
From: Kamal Dasu @ 2019-10-21 19:32 UTC (permalink / raw)
  To: linux-mtd
  Cc: Vignesh Raghavendra, Kamal Dasu, Richard Weinberger,
	linux-kernel, Marek Vasut, bcm-kernel-feedback-list,
	Miquel Raynal, Brian Norris, David Woodhouse

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@gmail.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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-04 17:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 19:32 [PATCH] mtd: set mtd partition panic write flag Kamal Dasu
2019-11-05 19:03 ` Miquel Raynal
2019-11-05 23:03   ` Richard Weinberger
2019-11-11 20:35     ` Kamal Dasu
2020-01-09 15:03     ` Miquel Raynal
2020-01-09 15:25       ` Kamal Dasu
2020-01-09 17:28         ` Miquel Raynal
2020-05-02 18:08           ` Miquel Raynal
2020-05-04 15:20             ` Kamal Dasu
2020-05-04 17:29               ` Miquel Raynal

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).