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>
94 lines
3.4 KiB
Diff
94 lines
3.4 KiB
Diff
From 42a3010523fc870a2d6d70a121a303d98a66af80 Mon Sep 17 00:00:00 2001
|
|
From: Jonathan Bell <jonathan@raspberrypi.com>
|
|
Date: Wed, 8 Jan 2025 16:02:27 +0000
|
|
Subject: [PATCH] mmc: use downstream DT property to modify CQE and/or SD CQ
|
|
behaviour
|
|
|
|
Implement a tristate-style option for "supports-cqe". If the property is
|
|
absent or zero, disable CQ completely. For 1, enable CQ unconditionally
|
|
for eMMC cards, and known-good SD cards. For 2, enable for eMMC cards,
|
|
and all SD cards that are not known-bad.
|
|
|
|
The sdhci-brcmstb driver needs to know about the tristate as its probe
|
|
sequence would otherwise override a disable in mmc_of_parse().
|
|
|
|
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
|
---
|
|
drivers/mmc/core/host.c | 11 ++++++++++-
|
|
drivers/mmc/core/sd.c | 4 ++--
|
|
drivers/mmc/host/sdhci-brcmstb.c | 6 ++++--
|
|
include/linux/mmc/host.h | 1 +
|
|
4 files changed, 17 insertions(+), 5 deletions(-)
|
|
|
|
--- a/drivers/mmc/core/host.c
|
|
+++ b/drivers/mmc/core/host.c
|
|
@@ -272,7 +272,7 @@ EXPORT_SYMBOL(mmc_of_parse_clk_phase);
|
|
int mmc_of_parse(struct mmc_host *host)
|
|
{
|
|
struct device *dev = host->parent;
|
|
- u32 bus_width, drv_type, cd_debounce_delay_ms;
|
|
+ u32 bus_width, drv_type, cd_debounce_delay_ms, cq_allow;
|
|
int ret;
|
|
|
|
if (!dev || !dev_fwnode(dev))
|
|
@@ -407,6 +407,15 @@ int mmc_of_parse(struct mmc_host *host)
|
|
host->caps2 &= ~(MMC_CAP2_HS400_1_8V | MMC_CAP2_HS400_1_2V |
|
|
MMC_CAP2_HS400_ES);
|
|
|
|
+ cq_allow = 0;
|
|
+ /*
|
|
+ * Downstream property - if a u32 and 2 instead of a bool,
|
|
+ * trust most A2 SD cards claiming CQ support.
|
|
+ */
|
|
+ device_property_read_u32(dev, "supports-cqe", &cq_allow);
|
|
+ if (cq_allow == 2)
|
|
+ host->caps2 |= MMC_CAP2_SD_CQE_PERMISSIVE;
|
|
+
|
|
/* Must be after "non-removable" check */
|
|
if (device_property_read_u32(dev, "fixed-emmc-driver-type", &drv_type) == 0) {
|
|
if (host->caps & MMC_CAP_NONREMOVABLE)
|
|
--- a/drivers/mmc/core/sd.c
|
|
+++ b/drivers/mmc/core/sd.c
|
|
@@ -1517,8 +1517,8 @@ cont:
|
|
goto free_card;
|
|
}
|
|
|
|
- /* Disallow command queueing on unvetted cards */
|
|
- if (!mmc_card_working_sd_cq(card))
|
|
+ /* Disallow command queueing on unvetted cards unless overridden */
|
|
+ if (!(host->caps2 & MMC_CAP2_SD_CQE_PERMISSIVE) && !mmc_card_working_sd_cq(card))
|
|
card->ext_csd.cmdq_support = false;
|
|
|
|
/* Enable command queueing if supported */
|
|
--- a/drivers/mmc/host/sdhci-brcmstb.c
|
|
+++ b/drivers/mmc/host/sdhci-brcmstb.c
|
|
@@ -571,7 +571,7 @@ static int sdhci_brcmstb_probe(struct pl
|
|
struct sdhci_pltfm_host *pltfm_host;
|
|
const struct of_device_id *match;
|
|
struct sdhci_brcmstb_priv *priv;
|
|
- u32 actual_clock_mhz;
|
|
+ u32 actual_clock_mhz, cqe;
|
|
struct sdhci_host *host;
|
|
struct resource *iomem;
|
|
bool no_pinctrl = false;
|
|
@@ -600,7 +600,9 @@ static int sdhci_brcmstb_probe(struct pl
|
|
pltfm_host->clk = clk;
|
|
|
|
priv = sdhci_pltfm_priv(pltfm_host);
|
|
- if (device_property_read_bool(&pdev->dev, "supports-cqe")) {
|
|
+ cqe = 0;
|
|
+ device_property_read_u32(&pdev->dev, "supports-cqe", &cqe);
|
|
+ if (cqe > 0) {
|
|
priv->flags |= BRCMSTB_PRIV_FLAGS_HAS_CQE;
|
|
match_priv->ops->irq = sdhci_brcmstb_cqhci_irq;
|
|
}
|
|
--- a/include/linux/mmc/host.h
|
|
+++ b/include/linux/mmc/host.h
|
|
@@ -404,6 +404,7 @@ struct mmc_host {
|
|
#define MMC_CAP2_CRYPTO 0
|
|
#endif
|
|
#define MMC_CAP2_ALT_GPT_TEGRA (1 << 28) /* Host with eMMC that has GPT entry at a non-standard location */
|
|
+#define MMC_CAP2_SD_CQE_PERMISSIVE (1 << 31) /* Ignore allow-list for CQ capable SD card detection */
|
|
|
|
int fixed_drv_type; /* fixed driver type for non-removable media */
|
|
|