Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349942

Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask
Date 2016-03-04 09:40 +0100
Message-ID <r8Trc-3ZI-5@gated-at.bofh.it> (permalink)
References <r7KpX-4hl-5@gated-at.bofh.it> <r8R61-2kp-1@gated-at.bofh.it> <r8RIK-2AC-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Friday 04 March 2016 15:43:56 Alexandre Courbot wrote:
> >
> > Yeah, I'm not too sure what is the point of setting the fake mask to
> > be honest, but you are definitely right that it is a contradiction to
> > call a DMA function on a device that is not DMA-capable.
> 
> Ah, I finally got it - we are just setting it to the *address* of
> host->dma_mask so the device's DMA mask does not end up being a NULL
> pointer.
> 
> That actually changes things a bit. DMA-capable devices are clearly
> expected to set the mask themselves, but the only one to do it is
> host/mtk-sd.c. And dma_set_mask() is only called in dw_mmc and
> sdhci-acpi's enable_dma callback.
> 
> This means most DMA-capable devices (including Tegra, but not only)
> are simply left with no DMA setup at all.
> 
> Probably we can detect when the host did not do any DMA setup in the
> probe function and attempt some sane defaults depending on what the
> hardware says it is capable of?

When the host leaves an empty DMA mask, the intended meaning is
that the device is not on a DMA capable bus, so if we run into
that case, we should instead fix the creation of the device
rather than the driver that looks at the data.

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] mmc: sdhci: Set DMA mask if specified Alexandre Courbot <acourbot@nvidia.com> - 2016-03-01 05:50 +0100
  [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask Alexandre Courbot <acourbot@nvidia.com> - 2016-03-01 05:50 +0100
    Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask Arnd Bergmann <arnd@arndb.de> - 2016-03-01 22:40 +0100
      Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask Alexandre Courbot <gnurou@gmail.com> - 2016-03-02 11:40 +0100
        Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask Arnd Bergmann <arnd@arndb.de> - 2016-03-02 12:30 +0100
          Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask Alexandre Courbot <gnurou@gmail.com> - 2016-03-04 07:10 +0100
            Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask Alexandre Courbot <gnurou@gmail.com> - 2016-03-04 07:50 +0100
              Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask Arnd Bergmann <arnd@arndb.de> - 2016-03-04 09:40 +0100

csiph-web