diff options
author | Frank Shi <fshi@nvidia.com> | 2014-06-10 17:14:14 +0800 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2014-10-15 03:34:59 +0000 |
commit | 3668d4a8de12883a638721b88f25762136868227 (patch) | |
tree | 1ac2d669c2de9b2f4e23b4d92813d661b13130b9 | |
parent | a031345e2c7fc7cc3e6acf23bb23a5fa60f9b0fe (diff) | |
download | tegra-3668d4a8de12883a638721b88f25762136868227.tar.gz |
mmc: sdhci: check remaining len when creating ADMA descriptor
If len < 4, the extra transfer for alignment can do all job.
No need to creating another descriptor for aligned transfer.
Bug 200007889
Change-Id: I0a3a001600e6f752961955adebb43f688dede412
Signed-off-by: Frank Shi <fshi@nvidia.com>
Reviewed-on: http://git-master/r/421562
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
(cherry picked from commit 2d6c951eba10353873cb5d5a9ec117b2ba41d74c)
-rw-r--r-- | drivers/mmc/host/sdhci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 31f8801b7562..4b1c0c290e07 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -623,8 +623,10 @@ static int sdhci_adma_table_pre(struct sdhci_host *host, BUG_ON(len > 65536); /* tran, valid */ - sdhci_set_adma_desc(host, desc, addr, len, 0x21); - desc += next_desc; + if (len > 0) { + sdhci_set_adma_desc(host, desc, addr, len, 0x21); + desc += next_desc; + } /* * If this triggers then we have a calculation bug |