Commit 885c3e800cf99db3391247776bfa2d262b21a72b

Authored by Seungwon Jeon
Committed by Chris Ball
1 parent 9beee912a3

mmc: dw_mmc: Regression fix for non-IDMAC DMA

3ec7699d3bb1b0ee7 ("mmc: dw_mmc: Add support for pre_req and post_req")
broke non-IDMAC DMA, because dw_mci_pre_dma_transfer() is valid only if
using internal DMA. In case of using other DMA it returns -ENOSYS. It
prevents the DMA operations.  This patch makes dw_mci_pre_dma_transfer()
effective in all DMA cases again.

Reported-by: James Hogan <james@albanarts.com>
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>

Showing 1 changed file with 9 additions and 16 deletions Side-by-side Diff

drivers/mmc/host/dw_mmc.c
... ... @@ -429,6 +429,15 @@
429 429 return 0;
430 430 }
431 431  
  432 +static struct dw_mci_dma_ops dw_mci_idmac_ops = {
  433 + .init = dw_mci_idmac_init,
  434 + .start = dw_mci_idmac_start_dma,
  435 + .stop = dw_mci_idmac_stop_dma,
  436 + .complete = dw_mci_idmac_complete_dma,
  437 + .cleanup = dw_mci_dma_cleanup,
  438 +};
  439 +#endif /* CONFIG_MMC_DW_IDMAC */
  440 +
432 441 static int dw_mci_pre_dma_transfer(struct dw_mci *host,
433 442 struct mmc_data *data,
434 443 bool next)
... ... @@ -467,22 +476,6 @@
467 476  
468 477 return sg_len;
469 478 }
470   -
471   -static struct dw_mci_dma_ops dw_mci_idmac_ops = {
472   - .init = dw_mci_idmac_init,
473   - .start = dw_mci_idmac_start_dma,
474   - .stop = dw_mci_idmac_stop_dma,
475   - .complete = dw_mci_idmac_complete_dma,
476   - .cleanup = dw_mci_dma_cleanup,
477   -};
478   -#else
479   -static int dw_mci_pre_dma_transfer(struct dw_mci *host,
480   - struct mmc_data *data,
481   - bool next)
482   -{
483   - return -ENOSYS;
484   -}
485   -#endif /* CONFIG_MMC_DW_IDMAC */
486 479  
487 480 static void dw_mci_pre_req(struct mmc_host *mmc,
488 481 struct mmc_request *mrq,