difos/target/linux/bcm27xx/patches-6.12/950-0435-drivers-mmc-handle-1024-byte-SD-General-Info-lengths.patch
Shiji Yang 9ddeb30499 kernel: bump 6.12 to 6.12.35
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.35

Remove upstreamed patches:
  bcm27xx/patches-6.12/950-0961-media-imx335-Use-correct-register-width-for-HNUM.patch [1]
  bcm27xx/patches-6.12/950-1003-drivers-media-i2c-imx335-Fix-frame-size-enumeration.patch [2]
  gemini/patches-6.12/0001-net-ethernet-cortina-Use-TOE-TSO-on-all-TCP.patch [3]
  generic/backport-6.12/300-v6.16-mips-Add-std-flag-specified.patch [4]
  mvebu/patches-6.12/0004-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch [5]
  mvebu/patches-6.12/0005-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch [6]
  mvebu/patches-6.12/0006-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch [7]
  mvebu/patches-6.12/0007-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch [8]

Manually rebased patches:
  bcm27xx/patches-6.12/950-0392-fbdev-Allow-client-to-request-a-particular-dev-fbN-n.patch [9]

All other patches are automatically refreshed.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=b93864e0865f235a791e69dc9ef4f896e559ef77
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=1f78790d988c9d55cf8d4b4d511d4b3e38ecb81d
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=2bd434bb0eeb680c2b3dd6c68ca319b30cb8d47f
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=6dbda47fe8bd6aa978c150bc9d321a286d2cc3f4
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=2cd2022c38fa26257cc6eec100ae122de9c1541c
[6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=133f17922b3dbae44fe583fb898b92b03558a657
[7] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=aefe45843ea667366e35df4fcfef5ff9051a86c9
[8] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=461d5a73ae45fbe6c300a6e64600f9792684eb52
[9] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=3f2098f4fba7718eb2501207ca6e99d22427f25a

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19249
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-28 22:47:48 +02:00

52 lines
1.8 KiB
Diff

From 1db73c70052c07f57dbe909ab1233d714307418b Mon Sep 17 00:00:00 2001
From: Jonathan Bell <jonathan@raspberrypi.com>
Date: Tue, 26 Mar 2024 14:58:58 +0000
Subject: [PATCH] drivers: mmc: handle 1024-byte SD General Info lengths
The spec allows for up to two 512-byte pages to be allocated for the
Extension Register General Info block, so allocate accordingly.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
---
drivers/mmc/core/sd.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1188,7 +1188,7 @@ static int mmc_sd_read_ext_regs(struct m
if (!(card->scr.cmds & SD_SCR_CMD48_SUPPORT))
return 0;
- gen_info_buf = kzalloc(512, GFP_KERNEL);
+ gen_info_buf = kzalloc(1024, GFP_KERNEL);
if (!gen_info_buf)
return -ENOMEM;
@@ -1219,14 +1219,23 @@ static int mmc_sd_read_ext_regs(struct m
num_ext = gen_info_buf[4];
/*
- * We only support revision 0 and limit it to 512 bytes for simplicity.
+ * We only support revision 0 and up to the spec-defined maximum of 1K.
* No matter what, let's return zero to allow us to continue using the
* card, even if we can't support the features from the SD function
* extensions registers.
*/
- if (rev != 0 || len > 512) {
- pr_warn("%s: non-supported SD ext reg layout\n",
- mmc_hostname(card->host));
+ if (rev != 0 || len > 1024) {
+ pr_warn("%s: non-supported SD ext reg layout rev %u length %u\n",
+ mmc_hostname(card->host), rev, len);
+ goto out;
+ }
+
+ /* If the General Information block spills into the next page, read the rest */
+ if (len > 512)
+ err = mmc_sd_read_ext_reg(card, 0, 1, 0, 512, &gen_info_buf[512]);
+ if (err) {
+ pr_err("%s: error %d reading page 1 of general info of SD ext reg\n",
+ mmc_hostname(card->host), err);
goto out;
}