Skip to content

Commit 27ec9dc

Browse files
AlamyLiustorulf
authored andcommitted
mmc: cqhci: fix space allocated for transfer descriptor
There is not enough space being allocated when DCMD is disabled. CQE_DCMD is not necessary to be enabled when CQE is enabled. (Software could halt CQE to send command) In the case that CQE_DCMD is not enabled, it still needs to allocate space for data transfer. For instance: CQE_DCMD is enabled: 31 slots space (one slot used by DCMD) CQE_DCMD is disabled: 32 slots space Fixes: a408022 ("mmc: cqhci: support for command queue enabled host") Signed-off-by: Alamy Liu <alamy.liu@gmail.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent e5723f9 commit 27ec9dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/host/cqhci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static int cqhci_host_alloc_tdl(struct cqhci_host *cq_host)
201201
cq_host->desc_size = cq_host->slot_sz * cq_host->num_slots;
202202

203203
cq_host->data_size = cq_host->trans_desc_len * cq_host->mmc->max_segs *
204-
(cq_host->num_slots - 1);
204+
cq_host->mmc->cqe_qdepth;
205205

206206
pr_debug("%s: cqhci: desc_size: %zu data_sz: %zu slot-sz: %d\n",
207207
mmc_hostname(cq_host->mmc), cq_host->desc_size, cq_host->data_size,

0 commit comments

Comments
 (0)