From mboxrd@z Thu Jan 1 00:00:00 1970 From: acourbot@nvidia.com (Alexandre Courbot) Date: Tue, 12 Apr 2016 21:25:04 +0900 Subject: [PATCH] ARM: mach-imx: sdhci-esdhc-imx: initialize DMA mask In-Reply-To: <570CC6F2.4090301@intel.com> References: <1460362846-2906-1-git-send-email-akurz@blala.de> <20160411083510.GN10108@pengutronix.de> <570B780E.7090801@intel.com> <570C902E.7090607@intel.com> <20160412084048.GM19428@n2100.arm.linux.org.uk> <570CC6F2.4090301@intel.com> Message-ID: <570CE920.4040204@nvidia.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 04/12/2016 06:59 PM, Adrian Hunter wrote: > On 12/04/16 11:40, Russell King - ARM Linux wrote: >> On Tue, Apr 12, 2016 at 09:05:34AM +0300, Adrian Hunter wrote: >>> On 11/04/16 19:13, Alexander Kurz wrote: >>>> Hi Adrian, >>>> On Mon, 11 Apr 2016, Adrian Hunter wrote: >>>> >>>>> On 11/04/16 11:35, Uwe Kleine-K?nig wrote: >>>>>> Hello, >>>>>> >>>>>> I added the people involved in 7b91369b4655 to Cc. >>>>>> >>>>>> On Mon, Apr 11, 2016 at 10:20:46AM +0200, Alexander Kurz wrote: >>>>>>> With commit 7b91369b DMA access got disabled for device drivers with zero >>>>> >>>>> Is that because dma_set_mask_and_coherent() fails? >>>> right, dma_set_mask_and_coherent() fails, thats the only reason for >>>> this patch. This popped up on a Kindle3 (IMX35 with eMMC based root fs). >>> >>> Arnd, Alexandre : Why should dma_set_mask_and_coherent() fail in this case >>> when DMA apparently doesn't need a dma_mask anyway? >> >> What do you mean "doesn't need a dma_mask" ? DMA _always_ requires a >> DMA mask. The DMA mask defines how many address bits are capable of >> being used on the bus. >> >> If there's no DMA mask, then there's no usable address bits, and so >> the device is not DMA capable. Hence, dma_set_mask_and_coherent() >> will fail because its not possible to negotiate a non-zero number of >> address bits. >> > > The point is, now we valid dma_set_mask_and_coherent(), DMA will stop > working for any other SDHCI device that hasn't allocated dev.dma_mask. Is > that OK? Clearly these devices need to be fixed. If we want to give them a grace period, we could also (temporarily) not propagate the return value of dma_set_mask_and_coherent() and limit ourselves to emitting a big warning about the inconsistency of having SDHCI_USE_SDMA/SDHCI_USE_ADMA in the host flags while not setting a dma mask. But in the past, how prompt have people been to react to such warnings vs. their device not working as expected?