Revert "mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB"
This reverts commit 14c3ce30dd
which is
commit 3d7c194b7c9ad414264935ad4f943a6ce285ebb1 upstream.
It breaks the abi and is only needed on systems that have PAGE_SIZE >=
64kb, which is not Android systems at the moment.
Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I52b344609b63e66b96511790a9bd4025157ff3cc
This commit is contained in:
@@ -774,19 +774,7 @@ static void sdhci_adma_table_pre(struct sdhci_host *host,
|
||||
len -= offset;
|
||||
}
|
||||
|
||||
/*
|
||||
* The block layer forces a minimum segment size of PAGE_SIZE,
|
||||
* so 'len' can be too big here if PAGE_SIZE >= 64KiB. Write
|
||||
* multiple descriptors, noting that the ADMA table is sized
|
||||
* for 4KiB chunks anyway, so it will be big enough.
|
||||
*/
|
||||
while (len > host->max_adma) {
|
||||
int n = 32 * 1024; /* 32KiB*/
|
||||
|
||||
__sdhci_adma_write_desc(host, &desc, addr, n, ADMA2_TRAN_VALID);
|
||||
addr += n;
|
||||
len -= n;
|
||||
}
|
||||
BUG_ON(len > 65536);
|
||||
|
||||
/* tran, valid */
|
||||
if (len)
|
||||
@@ -3967,7 +3955,6 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
|
||||
* descriptor for each segment, plus 1 for a nop end descriptor.
|
||||
*/
|
||||
host->adma_table_cnt = SDHCI_MAX_SEGS * 2 + 1;
|
||||
host->max_adma = 65536;
|
||||
|
||||
return host;
|
||||
}
|
||||
@@ -4631,12 +4618,10 @@ int sdhci_setup_host(struct sdhci_host *host)
|
||||
* be larger than 64 KiB though.
|
||||
*/
|
||||
if (host->flags & SDHCI_USE_ADMA) {
|
||||
if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC) {
|
||||
host->max_adma = 65532; /* 32-bit alignment */
|
||||
if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC)
|
||||
mmc->max_seg_size = 65535;
|
||||
} else {
|
||||
else
|
||||
mmc->max_seg_size = 65536;
|
||||
}
|
||||
} else {
|
||||
mmc->max_seg_size = mmc->max_req_size;
|
||||
}
|
||||
|
@@ -339,8 +339,7 @@ struct sdhci_adma2_64_desc {
|
||||
|
||||
/*
|
||||
* Maximum segments assuming a 512KiB maximum requisition size and a minimum
|
||||
* 4KiB page size. Note this also allows enough for multiple descriptors in
|
||||
* case of PAGE_SIZE >= 64KiB.
|
||||
* 4KiB page size.
|
||||
*/
|
||||
#define SDHCI_MAX_SEGS 128
|
||||
|
||||
@@ -542,7 +541,6 @@ struct sdhci_host {
|
||||
unsigned int blocks; /* remaining PIO blocks */
|
||||
|
||||
int sg_count; /* Mapped sg entries */
|
||||
int max_adma; /* Max. length in ADMA descriptor */
|
||||
|
||||
void *adma_table; /* ADMA descriptor table */
|
||||
void *align_buffer; /* Bounce buffer */
|
||||
|
Reference in New Issue
Block a user