Skip to content

solve SDHCI DWC MSHC 128MB DMA boundary limitation

Jisheng Zhang linux-arm-kernel linux-mmc lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 2 repliesIn review
  2. v53 patches 2 repliesSuperseded
  3. v43 patches 4 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches7 repliesSuperseded
v23 patches3 repliesSuperseded
v13 patches1 replySuperseded

Changes in v6 from the cover letter

- use dma_get_required_mask() to calculate the extra adma_table_cnt

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mmc: sdhci: add adma_table_cnt member to struct sdhci_hostdrivers/mmc/host/sdhci.c drivers/mmc/host/sdhci.h+12 -80 replies
2/3mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_opsdrivers/mmc/host/sdhci.c drivers/mmc/host/sdhci.h+27 -140 replies
3/3mmc: sdhci-of-dwcmshc: solve 128MB DMA boundary limitationdrivers/mmc/host/sdhci-of-dwcmshc.c+39 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAdrian Hunter
1/3A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/3] solve SDHCI DWC MSHC 128MB DMA boundary limitation

When using DMA, if the DMA addr spans 128MB boundary, we have to split the DMA transfer into two so that each one doesn't exceed the boundary.

patch1 adds adma_table_cnt to struct sdhci_host so that driver can control the ADMA table count.
patch2 introduces adma_write_desc() hook to struct sdhci_ops so that driver can override it.
patch3 finally solves the 128MB boundary limitation.

since v5:
- use dma_get_required_mask() to calculate the extra adma_table_cnt

since v4:
- add Adrian's ack to patch 1 and patch 2
- address Adrian's comment -- if the boundary is fine, we have to return after writing dma desc once; adma_table_cnt updating could make use of the fact that it's already initialized by the common sdhci code, we just need to tune.

since v3:
- s/adma_table_num/adma_table_cnt
- add comment to adma_table_cnt
- make the exported function name without the _
- let sdhci_adma_write_desc() accept &desc param and set the new desc value

since v2:
- make use of "likely" to check (!len || BOUNDARY_OK(addr, len))
- explicitly include <linux/sizes.h> for SZ_128M

since v1:
- fix BOUNDARY_OK macro if addr+len is aligned to 128MB
- use DIV_ROUND_UP to cal extra desc num
- fix !len for dwcmshc_adma_write_desc()

Jisheng Zhang (3):
mmc: sdhci: add adma_table_cnt member to struct sdhci_host
mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops
mmc: sdhci-of-dwcmshc: solve 128MB DMA boundary limitation

 drivers/mmc/host/sdhci-of-dwcmshc.c | 39 +++++++++++++++++++++
 drivers/mmc/host/sdhci.c            | 54 +++++++++++++++++------------
 drivers/mmc/host/sdhci.h            |  7 ++++
 3 files changed, 78 insertions(+), 22 deletions(-)
Signature · 1 line
2.18.0