All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nelson Johnson <nzjfr547@gmail.com>
To: linux-mmc@vger.kernel.org
Cc: adrian.hunter@intel.com, ulf.hansson@linaro.org,
	linux-kernel@vger.kernel.org, Nelson Johnson <nzjfr547@gmail.com>
Subject: [PATCH 1/3] mmc: sdhci-pci: disable aggressive runtime PM for Braswell SD on Lenovo N22
Date: Mon, 16 Mar 2026 16:23:23 -0500	[thread overview]
Message-ID: <20260316212325.4207-2-nzjfr547@gmail.com> (raw)
In-Reply-To: <20260316212325.4207-1-nzjfr547@gmail.com>

Lenovo N22 systems with the Braswell SD controller (PCI ID 8086:2296) regress on kernels newer than 4.9. On this machine the SD slot is exposed through both PCI and ACPI firmware nodes, and enabling the newer aggressive runtime PM/card-detect wake path causes the controller to stop behaving like the older working configuration.

Keep the Lenovo N22 on the pre-4.14 behavior by skipping MMC_CAP_AGGRESSIVE_PM and MMC_CAP_CD_WAKE for the 8086:2296 slot on this DMI match, and disable runtime PM for that host.

This preserves the rest of the Braswell/Atom handling while restoring the power-management behavior that allows the slot to function on the Lenovo N22.

Fixes: 6cf4156c0988 ("mmc: sdhci-pci: Enable card detect wake for Intel BYT-related SD controllers")
Signed-off-by: Nelson Johnson <nzjfr547@gmail.com>
---
 drivers/mmc/host/sdhci-pci-core.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 47a0a7388..4b3c61609 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -923,6 +923,13 @@ static bool jsl_broken_hs400es(struct sdhci_pci_slot *slot)
 			dmi_match(DMI_BIOS_VENDOR, "ASUSTeK COMPUTER INC.");
 }
 
+static bool sdhci_pci_is_lenovo_n22_bsw_sd(struct sdhci_pci_slot *slot)
+{
+	return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_SD &&
+	       dmi_match(DMI_SYS_VENDOR, "LENOVO") &&
+	       dmi_match(DMI_BOARD_NAME, "N22");
+}
+
 static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot)
 {
 	int ret = byt_emmc_probe_slot(slot);
@@ -1120,9 +1127,13 @@ static void byt_needs_pwr_off(struct sdhci_pci_slot *slot)
 
 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
 {
+	bool runtime_pm_ok = !sdhci_pci_is_lenovo_n22_bsw_sd(slot);
+
 	byt_probe_slot(slot);
-	slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY |
-				 MMC_CAP_AGGRESSIVE_PM | MMC_CAP_CD_WAKE;
+	slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY;
+	if (runtime_pm_ok)
+		slot->host->mmc->caps |= MMC_CAP_AGGRESSIVE_PM |
+					 MMC_CAP_CD_WAKE;
 	slot->cd_idx = 0;
 	slot->cd_override_level = true;
 	if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD ||
@@ -1135,7 +1146,10 @@ static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
 	    slot->chip->pdev->subsystem_device == PCI_SUBDEVICE_ID_NI_78E3)
 		slot->host->mmc->caps2 |= MMC_CAP2_AVOID_3_3V;
 
-	byt_needs_pwr_off(slot);
+	if (runtime_pm_ok)
+		byt_needs_pwr_off(slot);
+	else
+		slot->chip->allow_runtime_pm = false;
 
 	return 0;
 }
-- 
2.47.3


  reply	other threads:[~2026-03-16 21:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 21:23 [PATCH 0/3] mmc: Lenovo N22 Braswell SD slot fixes Nelson Johnson
2026-03-16 21:23 ` Nelson Johnson [this message]
2026-03-20 17:58   ` [PATCH 1/3] mmc: sdhci-pci: disable aggressive runtime PM for Braswell SD on Lenovo N22 Andy Shevchenko
2026-03-16 21:23 ` [PATCH 2/3] mmc: sdhci-pci: force polling card detect " Nelson Johnson
2026-03-16 21:23 ` [PATCH 3/3] mmc: sdhci-acpi: exclude INT33BB:00 from ACPI binding " Nelson Johnson
2026-03-20 18:02   ` Andy Shevchenko
2026-03-20 13:27 ` [PATCH 0/3] mmc: Lenovo N22 Braswell SD slot fixes Adrian Hunter
2026-03-20 16:47   ` Nelson Johnson
2026-03-20 17:55     ` Andy Shevchenko
2026-03-20 18:08       ` Andy Shevchenko
2026-03-20 23:07         ` Nelson Johnson
2026-03-21 11:07           ` Hans de Goede
2026-03-24 15:05     ` Adrian Hunter
2026-03-20 17:49 ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260316212325.4207-2-nzjfr547@gmail.com \
    --to=nzjfr547@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.