Skip to content

Commit 8c9cd9d

Browse files
Merge pull request #33 from OnionIoT/bugfix/reduce-spi-brocken-reset-warning-29
Reduce spi brocken reset warning
2 parents 33c48b2 + f6ee856 commit 8c9cd9d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--- /dev/null
2+
+++ b/target/linux/generic/hack-5.15/999-spi-nor-prevent-trace-for-broken-flash-reset-flag.patch
3+
@@ -0,0 +1,24 @@
4+
+diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
5+
+index 22f7eb541d69..855ba079cf20 100644
6+
+--- a/drivers/mtd/spi-nor/core.c
7+
++++ b/drivers/mtd/spi-nor/core.c
8+
+@@ -2860,8 +2860,17 @@ static int spi_nor_init(struct spi_nor *nor)
9+
+ * reboots (e.g., crashes). Warn the user (or hopefully, system
10+
+ * designer) that this is bad.
11+
+ */
12+
+- WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
13+
+- "enabling reset hack; may not recover from unexpected reboots\n");
14+
++ /* Hack by [email protected]: prevent this (vebose) warning; when targeting
15+
++ a third-party platform with this hardware bug, and no way to fix it,
16+
++ the reminder does not help and clutters the log. So we just output a
17+
++ one-line warning message instead.
18+
++ */
19+
++
20+
++ // WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
21+
++ // "enabling reset hack; may not recover from unexpected reboots\n");
22+
++ if (nor->flags & SNOR_F_BROKEN_RESET) {
23+
++ dev_warn(nor->dev, "enabling broken reset hack; may not recover from unexpected reboots\n");
24+
++ }
25+
+ nor->params->set_4byte_addr_mode(nor, true);
26+
+ }
27+
+

0 commit comments

Comments
 (0)