From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756162AbbKRPqA (ORCPT ); Wed, 18 Nov 2015 10:46:00 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:63128 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754017AbbKRPp7 (ORCPT ); Wed, 18 Nov 2015 10:45:59 -0500 From: Arnd Bergmann To: Andy Shevchenko Cc: Ulf Hansson , Jaehoon Chung , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-arm Mailing List Subject: Re: [PATCH] mmc: dw_mmc: use resource_size_t to store physical address Date: Wed, 18 Nov 2015 16:45:23 +0100 Message-ID: <7083277.bjzG62aVmx@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <28102387.ALpaBHpim0@wuerfel> <5141236.CHnzdS7Lto@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:loEqTY9vd+L+xgMsNSrCtiT+hmNrSw9xnYC6DaBmcq1+DqvvMcr TRpA2+FKgk7JmJGVMbsy3Qmjn+AMg7x5/35/XgVlHZTZhWbAXcgUZPbFqY7keNbUB+RDLiQ fnbMt3UKaR8J5Rus46v4Mg9VtFEwE7Kx6xGcAiC0Uj6NdJi2cmIKdGGqoTE0/eQ1sA39Zw5 izXphBnWvArmfFNnfuyPw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Mohjl7JN8bw=:AHJTbxZdgqPc2VoftcegNC HQ1Jz3FfN3b3rtfqZ60sEFYsoDWTzFyW+OLUYegZk7t/zzSWybHlFj7i7Aos+NyilNUq9nURs zRGMMRB8UOhEQNcO6TcVW1IBalAEMDAZgdYo3RtQkZnfIo2X44vEf+/1C7VQZy71sHBYydNOm fqW0UQgpMtUzdpjXt1vLgiX2RJg7bCgn7joV/1yabDdxXvnilhcaTSlVFYUY5eV4Y42ZJl9e0 2z/EiQ8mnBibU2Umn908SOykpPkgNDpwMf3lUyCZdiiqz7Av3UVk6j0cCN7Zp214CuqGlnZHu jbqbYQ3DTSN4yQpx/ZhWKOXNRYRiv0Arf3pVLnB1IbHpZpgCCpEal8E4cXqRf4TaleIwidpPM S2Bx1Mlf7r9rRYlKKaMJZ0W5JVuu/qDYwU0AWrId8Qjuaws6oW3VjXVOWVMZmdPWmjTNSmWbv xt1Ho9kb5zhBvRs1rt2X6ttYYP3cIYsf1KO98X6kJU9sA02R5t8NeaTRX6ho6sZkTk9kOdfmD 8XcwN/X+j9nouBGS+/KeS5fX1/HTOfTxdgJm8hKQNo/wobMK44+URXDPUuo8bSjZ87y7xQz5c 4a93Sa2PaRW2Wqme2mZlry14nc2kmuMgE+tB9jnWBSxJsnund6BeH7HHNYtKAZe4GaW+beT7b KCxshhONztR6VF5N4L4EE2FJB9pLKc0/0OdK+twrqvg9tjuf8beS2ubeW2oAJTvL2NNlhWbDO LqvdO0wqcOKSGBVb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 18 November 2015 17:29:19 Andy Shevchenko wrote: > > I understand most of the things here, what I don't is how a platform > is supposed to work if you have the following: > a) HW, that uses register space let's say higher than 32-bit; > b) DMA engine, which should provide a DMA capability for above HW block; > c) dma_addr_t which does not cover the HW register space. On this platform, the current code is obviously broken, because the pointer is 32-bit wide and cannot reach the registers. I assume you agree on that part. With my patch, the 64-bit resource_size_t in dw_mci helps get the correct FIFO address to this line: cfg.dst_addr = host->phy_regs + fifo_offset; There, it remains broken because of the dma_addr_t being too short, and we also need Linus' patch from https://lkml.org/lkml/2013/4/26/120 in addition to mine. > For me it clearly looks like a platform (HW / SW) configuration issue. I think some people have argued in the past that we should always use the same type for dma_addr_t, resource_size_t and phys_addr_t. That would certainly fix the problem you describe as well. In practice, everyone has that already, and my patch by itself fixes all the cases where the FIFO is at a high address and dma_addr_t is already 64-bit wide. > In case of bounce buffers I can't understand how it helps there. Right, bounce buffers are irrelevant here, because the FIFO address is never translated and never bounced. Arnd