Skip to content

Commit c09df94

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci: Fix incorrect ADMA2 descriptor table size
The ADMA2 descriptor table size was being calculated incorrectly Fix it. Note that it has been wrong for a long time and likely has not caused any problems because of a combination of 1) not needing alignment descriptors for block operations 2) more memory being allocated than was requested 3) the use of SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC which does not use an extra descriptor for the end marker. Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent 76d5556 commit c09df94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/mmc/host/sdhci.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@
4444

4545
#define MAX_TUNING_LOOP 40
4646

47-
#define ADMA_SIZE ((128 * 2 + 1) * 4)
47+
/*
48+
* The ADMA2 descriptor table size is calculated as the maximum number of
49+
* segments (128), times 2 to allow for an alignment descriptor for each
50+
* segment, plus 1 for a nop end descriptor, all multipled by the 32-bit
51+
* descriptor size (8).
52+
*/
53+
#define ADMA_SIZE ((128 * 2 + 1) * 8)
4854

4955
static unsigned int debug_quirks = 0;
5056
static unsigned int debug_quirks2;

0 commit comments

Comments
 (0)