소스 검색

[MMC] mmci: allow small data transfers

If a data transfer is small (less than a FIFO size) we would
hang waiting for the data to be read due to the PIO interrupt
not occuring.  We allowed for this in our PIO interrupt handler,
but not when setting up a data transfer.

Apply the "fix" when setting up a data transfer as well.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Russell King 19 년 전
부모
커밋
0425a14213
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      drivers/mmc/mmci.c

+ 7 - 0
drivers/mmc/mmci.c

@@ -97,6 +97,13 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
 	if (data->flags & MMC_DATA_READ) {
 		datactrl |= MCI_DPSM_DIRECTION;
 		irqmask = MCI_RXFIFOHALFFULLMASK;
+
+		/*
+		 * If we have less than a FIFOSIZE of bytes to transfer,
+		 * trigger a PIO interrupt as soon as any data is available.
+		 */
+		if (host->size < MCI_FIFOSIZE)
+			irqmask |= MCI_RXDATAAVLBLMASK;
 	} else {
 		/*
 		 * We don't actually need to include "FIFO empty" here