Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758866AbcCDIih (ORCPT ); Fri, 4 Mar 2016 03:38:37 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:54983 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbcCDIie (ORCPT ); Fri, 4 Mar 2016 03:38:34 -0500 From: Arnd Bergmann To: Alexandre Courbot Cc: Alexandre Courbot , Ulf Hansson , Stephen Warren , Thierry Reding , linux-mmc , "linux-tegra@vger.kernel.org" , Linux Kernel Mailing List Subject: Re: [PATCH v2 2/2] mmc: sdhci-tegra: Specify valid DMA mask Date: Fri, 04 Mar 2016 09:38:21 +0100 Message-ID: <27028474.SJJak25cUc@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1456806764-16467-1-git-send-email-acourbot@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:MmzbI06PkTJ5Fw+mnDOhXY6NAG2xXrsntcyLHXUziOsp8dOmx1e dV+x8MartDL/oN9e8rt++c+pcoT0PeG5SIlacocjENXeoRbWY5qRuDAIyOYGcSViIFyNQLS 1Ytt/8jT7OOcAKWFWHNgpX6h8MxGJac75nyxFduPCT/N1+gNlh6gpuaEMPvEld0x04LN4fz ea0AqJfxQH/BUqftyUekA== X-UI-Out-Filterresults: notjunk:1;V01:K0:jwullbiUZJY=:O41/UlItl6MsYaCERss770 H0UgrS/xlxMtVhENfKNC+XT67fcEBEmVmj9nAzSF8JKdeaT7VKy8KDPJLqQyaizmb5lW6sMFt cDyDZqpBNxpM7lJSIS23xHMgouIfFSw+PL5pOVxWIlGWFsVh4oSPvsj5MKZ6Pxaju5L5Gi3ws TSGaxREXJsDZyWuv4oHX6QEIO0aJ+dkbXmVGjT/WwVUikguQTYx+R+1/++WoErIbTqBCrzo0B QQk9/6Ks7gR/9s40PsUq1Q94i1QHLDEgDPLACtKF3fY699SUCfu4NA/cMSX+w8sLylGQkv0Fc VC0W7nmZGQvnYQGOTrleWMUvuBuwBv/ToBtXRJciPu6H3IxIloeAo6EgdrUGA98nWCrId4UwF 7sopWJSWTAcEvTDbggg1SJWaG4OZRJq3s7lBHzkoXaQcIbeACrSly6+p9G7F80A+5fju0ne+w 9/o9k5IT8A0/iaErchWm86WJ06O8xNhwJIzQ9yxdeaaBKQTERew95GnCo9SxpqE7o4e2fotBx h7hQcD9mLgJCVUumeWRmC3OfchzOAywdx5SiZIcp2OJvF5GagK6bwERfZ5pvf9JE/l2fKdwb8 lATijkYrPoPVYPd3EW+q89xky7WlTz/ian/ZveDh+7whFqX85ftNlGfcvuQEBy0h5FJV7zboQ Jrv3HCvXFNhTMn8Oteay2jmsF3QB4q0Dq6gPjoS26aGVyiVwXuvZhTZ4okei/ee2wZVPC5ir9 T0G99TmoPbQ4JQ3t Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1202 Lines: 28 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