git: 016f965722c6 - main - Revert "sdhci: extend bus_dma_tag boundary to 64-bit space"

From: Marcin Wojtas <mw_at_FreeBSD.org>
Date: Mon, 07 Mar 2022 16:46:15 UTC
The branch main has been updated by mw:

URL: https://cgit.FreeBSD.org/src/commit/?id=016f965722c67551af444dd7fd6207568d85c076

commit 016f965722c67551af444dd7fd6207568d85c076
Author:     Marcin Wojtas <mw@FreeBSD.org>
AuthorDate: 2022-03-07 16:40:51 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
CommitDate: 2022-03-07 16:45:59 +0000

    Revert "sdhci: extend bus_dma_tag boundary to 64-bit space"
    
    This reverts commit 7d8700bc291b4b3be1a592cae539f9e682592d9d.
    
    Reason for revert: the patch is incomplete. 64-bit operation
    is supported fully in SDHCI v4.0, v3.0 does it only for ADMA mode.
    This differentiation is missing and should be taken into consideration
    in case the reverted code is re-introduced.
    
    Reported by: mmel
---
 sys/dev/sdhci/sdhci.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c
index 541310ba421c..0438e6afc8d9 100644
--- a/sys/dev/sdhci/sdhci.c
+++ b/sys/dev/sdhci/sdhci.c
@@ -132,7 +132,7 @@ static int sdhci_cam_update_ios(struct sdhci_slot *slot);
 #endif
 
 /* helper routines */
-static int sdhci_dma_alloc(struct sdhci_slot *slot, uint32_t caps);
+static int sdhci_dma_alloc(struct sdhci_slot *slot);
 static void sdhci_dma_free(struct sdhci_slot *slot);
 static void sdhci_dumpcaps(struct sdhci_slot *slot);
 static void sdhci_dumpcaps_buf(struct sdhci_slot *slot, struct sbuf *s);
@@ -788,7 +788,7 @@ sdhci_card_poll(void *arg)
 }
 
 static int
-sdhci_dma_alloc(struct sdhci_slot *slot, uint32_t caps)
+sdhci_dma_alloc(struct sdhci_slot *slot)
 {
 	int err;
 
@@ -821,8 +821,7 @@ sdhci_dma_alloc(struct sdhci_slot *slot, uint32_t caps)
 	 * be aligned to the SDMA boundary.
 	 */
 	err = bus_dma_tag_create(bus_get_dma_tag(slot->bus), slot->sdma_bbufsz,
-	    0, (caps & SDHCI_CAN_DO_64BIT) ? BUS_SPACE_MAXADDR :
-	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+	    0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
 	    slot->sdma_bbufsz, 1, slot->sdma_bbufsz, BUS_DMA_ALLOCNOW,
 	    NULL, NULL, &slot->dmatag);
 	if (err != 0) {
@@ -1107,7 +1106,7 @@ no_tuning:
 		slot->opt &= ~SDHCI_HAVE_DMA;
 
 	if (slot->opt & SDHCI_HAVE_DMA) {
-		err = sdhci_dma_alloc(slot, caps);
+		err = sdhci_dma_alloc(slot);
 		if (err != 0) {
 			if (slot->opt & SDHCI_TUNING_SUPPORTED) {
 				free(slot->tune_req, M_DEVBUF);