From: Michael Garofalo <officialtechflashyt@gmail.com>
To: adrian.hunter@intel.com, ulf.hansson@linaro.org
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael Garofalo <officialTechflashYT@gmail.com>
Subject: [PATCH 1/2] mmc: sdhci: add quirk to disable the bounce buffer
Date: Sun, 5 Oct 2025 18:36:59 -0700 [thread overview]
Message-ID: <20251006013700.2272166-2-officialTechflashYT@gmail.com> (raw)
In-Reply-To: <20251006013700.2272166-1-officialTechflashYT@gmail.com>
On some controllers, using a bounce buffer can have negative effects.
For example, on the SDHCI controller in the Nintendo Wii's "Hollywood"
chipset, using bounce buffers causes the internal Broadcom 4318 Wi-Fi to
fail on most data transfers. The SDHCI core already supports running
without bounce buffers, so this exposes a quirk to forcibly disable them
for a given controller.
Signed-off-by: Michael Garofalo <officialTechflashYT@gmail.com>
---
drivers/mmc/host/sdhci.c | 8 +++++---
drivers/mmc/host/sdhci.h | 4 ++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ac7e11f37af7..7bf531802057 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -4806,9 +4806,11 @@ int sdhci_setup_host(struct sdhci_host *host)
*/
mmc->max_blk_count = (host->quirks & SDHCI_QUIRK_NO_MULTIBLOCK) ? 1 : 65535;
- if (mmc->max_segs == 1)
- /* This may alter mmc->*_blk_* parameters */
- sdhci_allocate_bounce_buffer(host);
+ if (!(host->quirks2 & SDHCI_QUIRK2_NO_BOUNCE_BUFFER)) {
+ if (mmc->max_segs == 1)
+ /* This may alter mmc->*_blk_* parameters */
+ sdhci_allocate_bounce_buffer(host);
+ }
return 0;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 58fcbeaf281e..9a082add96db 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -536,6 +536,10 @@ struct sdhci_host {
#define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18)
/* Issue CMD and DATA reset together */
#define SDHCI_QUIRK2_ISSUE_CMD_DAT_RESET_TOGETHER (1<<19)
+/*
+ * Bounce buffers cannot work, don't use them.
+ */
+#define SDHCI_QUIRK2_NO_BOUNCE_BUFFER (1<<20)
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */
--
2.51.0
next prev parent reply other threads:[~2025-10-06 1:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 1:36 [PATCH 0/2] mmc: sdhci: add quirk to disable bounce buffer Michael Garofalo
2025-10-06 1:36 ` Michael Garofalo [this message]
2025-10-06 1:37 ` [PATCH 2/2] mmc: sdhci-of-hlwd: disable bounce buffer usage Michael Garofalo
2025-10-06 7:35 ` [PATCH 0/2] mmc: sdhci: add quirk to disable bounce buffer Adrian Hunter
2025-10-06 7:38 ` Adrian Hunter
2025-10-06 9:15 ` Michael Garofalo
2025-10-06 9:28 ` Michael Garofalo
2025-10-06 10:46 ` Adrian Hunter
2025-10-08 1:10 ` Michael Garofalo
2025-10-08 11:30 ` Adrian Hunter
2025-10-10 21:16 ` Michael Garofalo
2025-10-13 6:40 ` Adrian Hunter
2025-10-20 7:53 ` Michael Garofalo
2025-10-24 5:36 ` Adrian Hunter
2025-10-24 8:32 ` Linus Walleij
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=20251006013700.2272166-2-officialTechflashYT@gmail.com \
--to=officialtechflashyt@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.