Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752662AbbKCKoT (ORCPT ); Tue, 3 Nov 2015 05:44:19 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:58279 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbbKCKoQ (ORCPT ); Tue, 3 Nov 2015 05:44:16 -0500 From: Arnd Bergmann To: Sinan Kaya Cc: dmaengine@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Vinod Koul , Dan Williams , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] dma: add Qualcomm Technologies HIDMA channel driver Date: Tue, 03 Nov 2015 11:43:50 +0100 Message-ID: <4135705.fKCjnZtDgZ@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <56384623.80305@codeaurora.org> References: <1446174501-8870-1-git-send-email-okaya@codeaurora.org> <17979873.Bg2pv5SLy6@wuerfel> <56384623.80305@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:lOyWgg6xbfj7y+i2pl8wi4a/iyiKahErt7qWcFuJpBrRP3LFov+ n29ACltvWqiroVTClb/PdMxrVMaoFgerMwBnLuCceAbnzceTXlVJWCSNuRfqiu8J07+YfV8 CmC7g9KUgnnx++GOrtgYv4WHzxzNDa321r+DNzM66jSlm919H+rLtUfiD6VsrIK2hrl3k1Q Egypod6sZ7tjfOdn4ULkg== X-UI-Out-Filterresults: notjunk:1;V01:K0:lTTHi8QvnLo=:RkwZS+eUz/Gr9ZzII5Ljg5 q0qfZ4UwTwRkobivN4/wpA1zp3zzPrLK4OChAoyqdxRDntPuVDGgBwdr6IstzEb0K19zf7SyT SmvjF6xYrWcUW/jThdYqJ2pUIp5kqFuf77/KaYB6cCsLaqXL2RwcCoyS5IC7xLeGweJkzkNsT Qlvb3Lwfde+CBuD6NtW1odakL4cb/VGVqDfns/oxBtupw3Uj33qdrceES/gP9ElR4sQXgFfsJ 3w0QnAYKhrRG7UkrWWoGnRfi1XYVDYGZ4nQZnK11+0nXYq8MUioBAfOu4+07s011BFbFQF5sQ S+H0RLFKGKepYiUtch5TCl9c6EsWVBHZkCnPLtijE2TTXfm1sfOhbincdyk7olCvwkwsFe/Bn Hr5tNPrjrkzYFDDOr++LzBW403gy/FCurrgQXJbpAOLhQ/ynLe5j/dKAi4XVxaPyRgfOucnaT g8EpRHfb7S6orc68ZI2lXzPMP48sp9DFurOlK0nY+JJFwcMCL4GfekdZ2IFZ27HOIVT9pay6C Hp85tqj8j2aK7Eo8yDsUeLNfQY/CjLEtLPm1noXG6aFwF+9TwrB08g0YmnzXB2roxfBqS7AfI Ws0M0HCclT7PoJGns61TlmSZgligSB44iF0i9tn74jEB6MtSGvILa1lN0j1TGSotPe8z203qA W0YSlsJIrqtcc+IWLBUj6W2DoJmyA94Hdt2e3ijx8XQnuSZNXy3B9oZT0mESFVnQuAGWRfTbG jpBdNmx6k4g3Jl4s Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1877 Lines: 43 On Tuesday 03 November 2015 00:29:07 Sinan Kaya wrote: > On 11/2/2015 3:55 PM, Arnd Bergmann wrote: > > Are you using message signaled interrupts then? > > Typically MSI guarantees > > ordering against DMA, but level or edge triggered interrupts by definition > > cannot (at least on PCI, but most other buses are the same way), because > > the DMA master has no insight into when a DMA is actually complete. > > > > If you use MSI, please add a comment to the readl_relaxed() that it > > is safe because of that, otherwise the next person who tries to debug > > a problem with your driver has to look into this. > > No, using regular GIC SPI interrupts at this moment. I know that HW > doesn't use any of the typical AHB/AXI ARM buses. > > I'm familiar with how PCI endpoints works. While the first read in a > typical PCI endpoint ISR flushes all outstanding requests traditionally > to the destination, this concept does not apply here for this HW. > Ok, got it. Best add an explanation like the above in the interrupt handler, to prevent this from accidentally getting 'cleaned up' to use readl(), or copied into a driver that uses PCI ordering rules where it is actually wrong. I think it should be done like this: - anything that is not performance critical, use normal readl/writel - in the fast path, add a comment to each readl_relaxed()/writel_relaxed() that is safe in this driver but that would not be safe in a PCI device - For the ones that would be safe on PCI as weel, use readl_relaxed()/writel_relaxed() without a comment on each one, but clarify somewhere that these are all intentional. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/