Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932358AbcCDP7Q (ORCPT ); Fri, 4 Mar 2016 10:59:16 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:50967 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbcCDP7M (ORCPT ); Fri, 4 Mar 2016 10:59:12 -0500 From: Arnd Bergmann To: Alexandre Courbot Cc: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, gnurou@gmail.com Subject: Re: [PATCH v3 0/3] mmc: sdhci: Set DMA mask properly Date: Fri, 04 Mar 2016 16:59:01 +0100 Message-ID: <2058077.gkPpZ9jbXd@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1457087925-992-1-git-send-email-acourbot@nvidia.com> References: <1457087925-992-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:fV9QCbHbbPg7/fYdf4ksKXeRDXFZoGyWPH4hyh7VoNka7w5zdeO QSTpTLOG271SeHSDv0htcRqXcV+Um/qNkrCWi7FJAF5cMFPT/xC6ceQA+zYBN7FIPOmZ4N6 kjhwrwiT51KFw9RZdS5X0GI2oHoPX++I75vjqDP+onVGINUGZwGGwlv99d+xET/9ZSTdXF9 GcNfUcpzmX0KdCubDF6tw== X-UI-Out-Filterresults: notjunk:1;V01:K0:s8hfayIrv2Q=:SrGoFjAIHNJKxZWuVWi+js ci0paWGM87bAlWYUDwU3lK0n0TRUzkpye5Jtq9WR73IPGAvXtOnMygXkF3TN94WSbSp8Vkvl1 Yl/ZAvVclCE4XBhs0/7w+P8pR1JOxf4D6IsCj30XuuTXFzXMl1SyiSxE35zYERywFTeOvmESv lIV0wLm4ab83R7jYj8ukovKlnwWCLipRE0q5OuAFqthMIHVSqbYdVDn9KsndAmTfN8tMk2Uck JwuOerdJ7ngdex2aYD6Jzi6oam89jJqNlLeepblBjFPW6rqCHrO1IiK2ivf9wSttVXjzq3cXv 2MkjAAXjDVnrKSINv2oQdATQtXrkD/YT2jbL2Gyisplsp+OQtV/0Y9W8ki1jYA9zLkV9qVwI4 d8Ih5wkZSCtvPm6B+3YtP8itX2K0/4i6LZq3nY0vUMJ5LSYvV3HTx6AiYVmE9vWKA+h9TXJn9 OpvZS5kVOr+tlZNLPJoIQDEI/NPSBCVYCE6tQgYzdCiculr7R/hJDCSZB4Sng9EcFzZjkw+X2 QBdafre2C5a9kVriq90eLvEzCYcKgakZaiW4HxRicJ/sY8dFMFIm7CJPR1/oNtcXZVAjwAAl9 grnNqF58pey4gHRNmloxQmnWHHDXDRVLaoDrtHJ5mvmSsnGgLXWFnkb8BzouHE9nIJkZ69KDS Fekj/NSIC1SBCYOobk5jwFa44b4zSjsYrA0SIW/Fin2DEEe3FnYCAd6yPv+nkar4kEIXgSn8M KwyUzP9jXbBxgwb1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1710 Lines: 34 On Friday 04 March 2016 19:38:42 Alexandre Courbot wrote: > Well that's far from the two-liner I had in mind to fix our bounce-buffers > problem with Tegra, but it feels correct. Testing for ACPI and PCI would be > appreciated (I am rather confident that ACPI will be ok, but the PCI part > should be reviewed by someone who knows better). > > 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. > > Thanks to Arnd for the insightful discussion that led to this. Looks great overall, much simpler and saner in the new version. I found one small bug, which appears to have been preexisting, but you moved it to a different file now. Arnd