From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753249AbcBXMhm (ORCPT ); Wed, 24 Feb 2016 07:37:42 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:61210 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbcBXMhj (ORCPT ); Wed, 24 Feb 2016 07:37:39 -0500 From: Arnd Bergmann To: Alexandre Courbot Cc: Ulf Hansson , Stephen Warren , Thierry Reding , linux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, gnurou@gmail.com Subject: Re: [PATCH] mmc: sdhci-tegra: Set DMA mask Date: Wed, 24 Feb 2016 13:37:30 +0100 Message-ID: <2393024.oLdk3CGNWo@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1456305079-27779-1-git-send-email-acourbot@nvidia.com> References: <1456305079-27779-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:jWPf8Irv6bt2z298GOCM0ic+VgoTYg61abj4v93QKv2tYdODS/W Td/8NQQmFy9ex7qBAtmXKRQtOWe5gybQqLctMR+ZAzgeJNnn2qbo4n+DauU2DEH6s1+KCp4 AUtYzVSHJygwzcyLHyIzsuuDkdbdEX46IhpZeNy9Ti7Tna8d7SZjqLNB4NVna3zj+TrADxK rnE5Wj1nBIqS0IoAHQJlw== X-UI-Out-Filterresults: notjunk:1;V01:K0:LsqHfyOBebg=:vc+ThXpUm7QUwUWvd8IeFM Hi4K6IfeymLHQCTbb54nHqelBTSsiOtrg6/z2sdBOOy8dR1wrUFN6S99IJJHdgyzpJkJfZCRb AtK4TME/g5wkexLU2m/ZE2glMLp+VpZ75x1fj14TV8wDVvs5tQF7Nly+vfVrPC7aWx5U6bNRV gSSVDErLjoh8fmTd8FdQgkTuYxvN8GjTmWctZZWXvb2VHRNPtV1juZpo98Z9pCoXl7Q1J1+rk k2CyepRx6TkTxfQcN8DphsG2mCDnJMGYg3fyFdRmmG6tk8bcNx7ZiFD3b0P/8HW3rAgsZJsJI 7ukJvTagX1UdK2mQobTgWiLGnFLKI3pWM6PWQI2sY/luUaYQnB1myP9xFzNpmaFMFaQaxGcRo E4wd+sYTVOuBXXVcHaLEcD1ZG4H+Avl+pm03k5yOp/PVM/7rBu/FvKXdq+6EKL8t3C7GIelTN WKOyBeIg9gCnw71PVuYb6/KNjwHvO7Bxhlq5iC7OOuMb+aB3mKHmKMjrMVRt/Wieq1dghms0b rn7dEqxjtl2dXp94Llbq7A/wQ0XcmX6p0wENIVfGuEnrrq9N5eZV7wJnhBlr0SRPlEPqhL+oc UhiU/1YHq87VDoTUNz+P8dXb58VN4IwbAO7ZxCNxwtmoXDXLG36exY/oSXODo7iiWsYRpLzZS qXghubkDIOVjTN687ZQZoZrwUqoiizYdmn6cwFLSUbBBh160XthHbBbIFhPq58RPLHRKn8GjI qouziyJzCFvDqOU8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 24 February 2016 18:11:19 Alexandre Courbot wrote: > On T210, the sdhci controller can address more than 32 bits of address > space. Failing to express this fact results in the use of bounce > buffers and affects performance. > > Signed-off-by: Alexandre Courbot > --- > I am pretty sure this one is wrong in some way, but just to get the ball > rolling as the use of bounce buffers is currently quite heavy on Jetson TX1. > > Thierry, Stephen, could you confirm that I got the DMA masks correctly? I > am not sure about the actual addressable size on TX1, and also suspect TK1 can > also address more than 32 bits. > > Also, I noticed that sdhci_host has a dma_mask member which I thought would do > the trick but actually doesn't seem to be used for anything useful. Could the > MMC maintainers comment on this and let me know if the DMA mask setting should > be moved at the core level instead of being done per-driver? So the question is what the DMA capabilities of the sdhci device are. Usually I think SDHCI should just support a 64-bit mask, and you can request that in the driver, but the platform might reject it, e.g. if the parent bus is lacking a dma-ranges property. On 32-bit platforms with no RAM above the 4GB boundary, setting a 64-bit mask typically succeeds, because there is no harm in using it. You should only set a 34-bit mask in the specific case that: * SDHCI reports that it supports 64-bit addressing * The parent bus supports 64-bit addressing and correctly sets up its dma-ranges property * The device is connected incorrectly to the parent bus and any access above 0x400000000ull fail to end up in the correct memory for this particular device, but not other devices on the same bus. Arnd