Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.75 Removed upstream: bcm27xx/patches-6.12/950-0225-media-i2c-ov5647-Correct-pixel-array-offset.patch[1] bcm27xx/patches-6.12/950-0226-media-i2c-ov5647-Correct-minimum-VBLANK-value.patch[2] bcm27xx/patches-6.12/950-0248-media-i2c-ov5647-Sensor-should-report-RAW-color-spac.patch[3] qualcommax/patches-6.12/0074-v6.20-clk-qcom-gcc-ipq5018-flag-sleep-clock-as-critical.patch[4] Manually rebased: bcm27xx/patches-6.12/950-0262-mfd-simple-mfd-i2c-Add-configuration-for-RPi-POE-HAT.patch bcm27xx/patches-6.12/950-0071-drivers-mfd-sensehat-Add-Raspberry-Pi-Sense-HAT-to-s.patch bcm27xx/patches-6.12/950-0516-media-i2c-ov5647-Add-V4L2_CID_LINK_FREQUENCY-control.patch lantiq/patches-6.12/101-find_active_root.patch All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.75&id=58f1767ad5c9eda3dd0befddc1843259d46d64fa 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.75&id=ff65571ffae52b65577121e7696bf22156e1928a 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.75&id=fbf2a108ed5eb1c896d3f354bd05314c2e22e78f 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.75&id=b109dd4970a0fc89d54b1198b163f86125dd2977 Build system: x86/64 Build-tested: flogic/glinet_gl-mt6000 Run-tested: flogic/glinet_gl-mt6000 Co-authored-by: Shiji Yang <yangshiji66@outlook.com> Signed-off-by: John Audia <therealgraysky@proton.me> Link: https://github.com/openwrt/openwrt/pull/22276 Signed-off-by: Robert Marko <robimarko@gmail.com>
65 lines
2.2 KiB
Diff
65 lines
2.2 KiB
Diff
From 010dc7f2dd6a0078ade3f88f627ed5fbf45ceb94 Mon Sep 17 00:00:00 2001
|
|
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
|
Date: Thu, 18 Sep 2025 00:54:01 +0300
|
|
Subject: mtd: spinand: repeat reading in regular mode if continuous reading
|
|
fails
|
|
|
|
Continuous reading may result in multiple flash pages reading in one
|
|
operation. Unfortunately, not all spinand controllers support such
|
|
large reading. They will read less data. Unfortunately, the operation
|
|
can't be continued.
|
|
|
|
In this case:
|
|
* disable continuous reading on this (not good enough) spi controller
|
|
* repeat reading in regular mode.
|
|
|
|
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
|
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
|
---
|
|
drivers/mtd/nand/spi/core.c | 25 +++++++++++++++++++++----
|
|
1 file changed, 21 insertions(+), 4 deletions(-)
|
|
|
|
--- a/drivers/mtd/nand/spi/core.c
|
|
+++ b/drivers/mtd/nand/spi/core.c
|
|
@@ -427,8 +427,16 @@ static int spinand_read_from_cache_op(st
|
|
* Dirmap accesses are allowed to toggle the CS.
|
|
* Toggling the CS during a continuous read is forbidden.
|
|
*/
|
|
- if (nbytes && req->continuous)
|
|
- return -EIO;
|
|
+ if (nbytes && req->continuous) {
|
|
+ /*
|
|
+ * Spi controller with broken support of continuous
|
|
+ * reading was detected. Disable future use of
|
|
+ * continuous reading and return -EAGAIN to retry
|
|
+ * reading within regular mode.
|
|
+ */
|
|
+ spinand->cont_read_possible = false;
|
|
+ return -EAGAIN;
|
|
+ }
|
|
}
|
|
|
|
if (req->datalen)
|
|
@@ -849,10 +857,19 @@ static int spinand_mtd_read(struct mtd_i
|
|
|
|
old_stats = mtd->ecc_stats;
|
|
|
|
- if (spinand_use_cont_read(mtd, from, ops))
|
|
+ if (spinand_use_cont_read(mtd, from, ops)) {
|
|
ret = spinand_mtd_continuous_page_read(mtd, from, ops, &max_bitflips);
|
|
- else
|
|
+ if (ret == -EAGAIN && !spinand->cont_read_possible) {
|
|
+ /*
|
|
+ * Spi controller with broken support of continuous
|
|
+ * reading was detected (see spinand_read_from_cache_op()),
|
|
+ * repeat reading in regular mode.
|
|
+ */
|
|
+ ret = spinand_mtd_regular_page_read(mtd, from, ops, &max_bitflips);
|
|
+ }
|
|
+ } else {
|
|
ret = spinand_mtd_regular_page_read(mtd, from, ops, &max_bitflips);
|
|
+ }
|
|
|
|
if (ops->stats) {
|
|
ops->stats->uncorrectable_errors +=
|