Skip to content

mmc: sdhci: Set DMA mask properly

Alexandre Courbot linux-mmc linux-pci lkml 4 versions – Applied

Status from this message: Thanks, applied for next!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 10 repliesApplied
  2. v33 patches 5 repliesSuperseded
  3. v22 patches 8 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch7 repliesSuperseded

Changes in v4 from the cover letter

- Unset the SDHCI_USE_64_BIT_DMA flag if setting of 64-bit mask failed
- Carry Acked-bys

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3mmc: sdhci: Set DMA mask when adding hostdrivers/mmc/host/sdhci.c+41 -74 replies
2/3mmc: sdhci-acpi: Remove enable_dma() hookdrivers/mmc/host/sdhci-acpi.c+0 -300 replies
3/3mmc: sdhci-pci: Do not set DMA mask in enable_dma()drivers/mmc/host/sdhci-pci-core.c+0 -154 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchArnd BergmannAdrian Hunter
SeriesA-b
1/3
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 v4 thread

Cover letter [PATCH v4 0/3] mmc: sdhci: Set DMA mask properly

64-bit capable devices are supposed to set their own DMA mask. Currently this does not happen for sdhci devices excepted for the two (sdhci-acpi and sdhci-pci) that define a enable_dma() hook and do it there. However this hook is called from several places while DMA mask is supposed to be set only once ; for instance the sdhci-acpi driver maintains a flag just to make sure the DMA mask is set only upon the first call of this hook.

For the vast majority of drivers that do not define a enable_dma() hook, the default 32-bit DMA mask is used and there is a risk of using unneeded bounce buffers on hosts capable of 64-bit addressing.

The first patch adds a default DMA mask setting function that is called when a DMA-capable host is added. It tries to set sane DMA masks according to the device's reported capabilities.

The addition of this function seems to make the same code in sdhci-acpi and sdhci-pci redundant, so it is removed from these drivers. On top of making this series a negative line count, it also removes one usage of the obsolete pci_set_dma_mask() function.

Changes since v3:
- Unset the SDHCI_USE_64_BIT_DMA flag if setting of 64-bit mask failed
- Carry Acked-bys

Alexandre Courbot (3):
mmc: sdhci: Set DMA mask when adding host
mmc: sdhci-acpi: Remove enable_dma() hook
mmc: sdhci-pci: Do not set DMA mask in enable_dma()

 drivers/mmc/host/sdhci-acpi.c     | 30 ------------------------
 drivers/mmc/host/sdhci-pci-core.c | 15 ------------
 drivers/mmc/host/sdhci.c          | 48 +++++++++++++++++++++++++++++++++------
 3 files changed, 41 insertions(+), 52 deletions(-)
Signature · 1 line
2.7.2