From nobody Tue Apr 7 04:20:02 2026 Received: from mail-yx1-f48.google.com (mail-yx1-f48.google.com [74.125.224.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C05463644C6 for ; Mon, 16 Mar 2026 21:23:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773696211; cv=none; b=I28DMZ0sBCugDGSwa1LrkYeqtkBRDoVIw7cc0gEDaX/3OYyzMQuslzsNZIcnH/nvFitdkzbjFpsAx3joOpebXIuqy9Iy5Enmf4Z8O81dyKPEn9mSDBD7Q1dEdGiRq/mObJNaeIqYzIct6u5mIHFOYjNCzD3uMn6hoKvYG6KBQ/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773696211; c=relaxed/simple; bh=qx4z8Ob8SnELEodjvWmMWyv1xv4wlLOYDgg4+waEj+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E9uLHjP+JXnmYlj29/jCOnIeUt0nOsCFVW8AwYIPDamnYlxMPbaKFQHB48aRMywFN+Yp/eWeKDEZSOGSabQd+T0NU3WXO594LAWx3yfpuWPjBXqY0SPIL6OpaB3MhGYLEffcnmT7qQveV2aQVZcfJmfYVWc5u7x5gwhk7hsgQg0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nn4JvhYW; arc=none smtp.client-ip=74.125.224.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nn4JvhYW" Received: by mail-yx1-f48.google.com with SMTP id 956f58d0204a3-64cb577e79cso5548347d50.0 for ; Mon, 16 Mar 2026 14:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773696209; x=1774301009; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e79VH+YX5m54FYYzBazND4kInl10p/kEBJg77AgNJYU=; b=nn4JvhYWRHh7HRYuVmFuvGF12yRtpBTOHZM3qvow1yNf/b50mJxqr8lnWJ9PzbaWWZ GcK4q/PV3vVxWDFbmYWwZG9fx9WtJFtFCpzifQ1kO4YCOqD7bgo6bFFqT40iGKyExuM7 JfqWbFkSkZAnHJssiUDMPT6Iani5HfchbNQk/MIf/Mw+UaOZU7t3ULJvs1t3ADwWQqme REhwxIH8Egltr9icGfKrEtBYeOSxkKLtxYrnUw5T8CQAtbeLrgnTgmzepR1F/NAD2coy ah1jnfHzReDy4st4rWK+JMFtPYlaB1YsOg3CLqvuAtODKjJzMSdZYH/4TvOlnuriE6mo JHDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773696209; x=1774301009; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=e79VH+YX5m54FYYzBazND4kInl10p/kEBJg77AgNJYU=; b=Jd1j90On1ZGwCyfVNpxss3TQ5AKw97q4lyD4yZ5HViO9/yipslyKqxUWbOOJmU8a75 XFSQeF18MQOjrSHiBI07+e+y29v8yKwghwRXRzvnW/6f4PnyIJ/TqsSsMwiPdaDw3en0 yJS5IDHufFOLDXx79UUOyMGzrYDf58vFtSt48lNHpuRSTQ4xfQLz20KCE8uek9KbkM8t eIhnxFWN3GL/Ya+3JEHWYgGIfH9BppYoAVVC1fCG12NXggZjFiEaCfwUW0xTiqHU2ikq RU8fORFKbRzyj8AC0Q5HC0YhqqyECO6FfmkG9ZW8zpVy14lkhs9pFrveF3RcqbAzyCAZ XXuw== X-Forwarded-Encrypted: i=1; AJvYcCVIvbkzey9RSJp+C+lrVX1TV6+j+dKObf/35p3fJpy2AMvfHHvkbrsl4+B4PEmWq31h+7clUWt31dliFFA=@vger.kernel.org X-Gm-Message-State: AOJu0YwOIUFqCeXSnNHJH8p1hE+9ZNOLt9yQzw8fZSBfDQbFwb8xdr95 Kbcm/Dq9YL8qIWjOoXVKyieVVSBBTKpWExN5LgrI7FGsRSokf962ZPIL X-Gm-Gg: ATEYQzwgFHvVJES6SvW2oALkN+21NaxEDn14crwwAcxwUzD5yxa+83Lxvdphrs07W3W gZrofI7PfkfAFnWtnrjUbfgbpvrWOi2+Mj+cPLiq6DymmlOl3xBixhHvvPpLOYGcGsYAhB8Uz01 zajBhBJc9hRTm1UVGtiZP/shLdsIrBnslxLldFn3stkHJUY3emTvbJ4lyzuw3efFsx7LTUpta9h T/WrI5UVSF1L41t5ytm9zuGtnECZfz8Qam1YAGDf7lCKKZHhS7wafBlSqwLNXPnAg5IxW9TA4nz sB1w1rjHNJYqOWihyvZ4/k/RKasw+T1n+9XZDqvKxoJtsC9OlQnbFzEHlSlPONM1Xh9rbG7SheM orjIDBSBhz2lQuAdmH863adsbx9Aita6OqACxDqA6EtRTT61BETc1M63CjC+ekYm5FKWF9c2xCv YWpMOJd4gciksjadu3QN19+DcdZEPUo3xwQGsLYLQOZV7TsGdGDQ== X-Received: by 2002:a05:690c:c4f1:b0:79a:610a:2d76 with SMTP id 00721157ae682-79a610a33f6mr14075587b3.40.1773696208835; Mon, 16 Mar 2026 14:23:28 -0700 (PDT) Received: from Starblazer007.localdomain ([12.206.154.114]) by smtp.gmail.com with ESMTPSA id 00721157ae682-79a5e1ae50asm8180437b3.2.2026.03.16.14.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 14:23:28 -0700 (PDT) From: Nelson Johnson To: linux-mmc@vger.kernel.org Cc: adrian.hunter@intel.com, ulf.hansson@linaro.org, linux-kernel@vger.kernel.org, Nelson Johnson Subject: [PATCH 2/3] mmc: sdhci-pci: force polling card detect for Braswell SD on Lenovo N22 Date: Mon, 16 Mar 2026 16:23:24 -0500 Message-ID: <20260316212325.4207-3-nzjfr547@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260316212325.4207-1-nzjfr547@gmail.com> References: <20260316212325.4207-1-nzjfr547@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Lenovo N22 uses the Braswell SD controller at PCI ID 8086:2296, but its= firmware exposes a broken card-detect path. On modern kernels the slot rep= eatedly fails to come up because the normal GPIO card-detect path never bec= omes usable on this machine. Force the Lenovo N22 to skip the firmware GPIO card-detect path for the Bra= swell SD slot and use polling instead. This keeps the quirk tightly scoped = to the affected DMI match while leaving the default behavior unchanged on o= ther Braswell systems. With the polling fallback in place, the PCI SDHCI path can detect card inse= rtion reliably again on the Lenovo N22. Fixes: 6cf4156c0988 ("mmc: sdhci-pci: Enable card detect wake for Intel BYT= -related SD controllers") Signed-off-by: Nelson Johnson --- drivers/mmc/host/sdhci-pci-core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci= -core.c index 4b3c61609..05ab17e72 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -1134,8 +1134,17 @@ static int byt_sd_probe_slot(struct sdhci_pci_slot *= slot) if (runtime_pm_ok) slot->host->mmc->caps |=3D MMC_CAP_AGGRESSIVE_PM | MMC_CAP_CD_WAKE; - slot->cd_idx =3D 0; - slot->cd_override_level =3D true; + if (!runtime_pm_ok) { + /* + * Lenovo N22 Braswell card-detect bypass: ignore the broken + * firmware GPIO path and poll the slot instead. + */ + slot->cd_idx =3D -1; + slot->host->mmc->caps |=3D MMC_CAP_NEEDS_POLL; + } else { + slot->cd_idx =3D 0; + slot->cd_override_level =3D true; + } if (slot->chip->pdev->device =3D=3D PCI_DEVICE_ID_INTEL_BXT_SD || slot->chip->pdev->device =3D=3D PCI_DEVICE_ID_INTEL_BXTM_SD || slot->chip->pdev->device =3D=3D PCI_DEVICE_ID_INTEL_APL_SD || --=20 2.47.3