Skip to content

Commit 796826b

Browse files
committed
mmc: Merge branch fixes into next
Merge the mmc fixes for v6.10-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.11. Signed-off-by: Ulf Hansson <[email protected]>
2 parents c17aecf + 16198ee commit 796826b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/mmc/host/davinci_mmc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ static void davinci_fifo_data_trans(struct mmc_davinci_host *host,
224224
}
225225
p = sgm->addr;
226226

227+
if (n > sgm->length)
228+
n = sgm->length;
229+
227230
/* NOTE: we never transfer more than rw_threshold bytes
228231
* to/from the fifo here; there's no I/O overlap.
229232
* This also assumes that access width( i.e. ACCWD) is 4 bytes

drivers/mmc/host/sdhci.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4708,6 +4708,21 @@ int sdhci_setup_host(struct sdhci_host *host)
47084708
if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC) {
47094709
host->max_adma = 65532; /* 32-bit alignment */
47104710
mmc->max_seg_size = 65535;
4711+
/*
4712+
* sdhci_adma_table_pre() expects to define 1 DMA
4713+
* descriptor per segment, so the maximum segment size
4714+
* is set accordingly. SDHCI allows up to 64KiB per DMA
4715+
* descriptor (16-bit field), but some controllers do
4716+
* not support "zero means 65536" reducing the maximum
4717+
* for them to 65535. That is a problem if PAGE_SIZE is
4718+
* 64KiB because the block layer does not support
4719+
* max_seg_size < PAGE_SIZE, however
4720+
* sdhci_adma_table_pre() has a workaround to handle
4721+
* that case, and split the descriptor. Refer also
4722+
* comment in sdhci_adma_table_pre().
4723+
*/
4724+
if (mmc->max_seg_size < PAGE_SIZE)
4725+
mmc->max_seg_size = PAGE_SIZE;
47114726
} else {
47124727
mmc->max_seg_size = 65536;
47134728
}

0 commit comments

Comments
 (0)