Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758061AbbLBNGM (ORCPT ); Wed, 2 Dec 2015 08:06:12 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:50201 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756218AbbLBNGK (ORCPT ); Wed, 2 Dec 2015 08:06:10 -0500 From: Arnd Bergmann To: Stanimir Varbanov Cc: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dmaengine@vger.kernel.org, Vinod Koul , Mark Rutland , Archit Taneja , Pawel Moll , Ian Campbell , Rob Herring , Andy Gross Subject: Re: [PATCH 2/4] dmaengine: qcom_bam_dma: clear BAM interrupt only if it is rised Date: Wed, 02 Dec 2015 14:05:28 +0100 Message-ID: <11168224.Usic9kvUpA@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <565EEA99.3070207@linaro.org> References: <1448961299-15161-1-git-send-email-stanimir.varbanov@linaro.org> <6461444.oollnBsbrb@wuerfel> <565EEA99.3070207@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:6o5WgklynaKhq6ZcS1zrdYlYCF2UrngifPHLvqLrPURNuBTWGXq wOFJIXFxOiclFRftbUVNmuNnfqzQ9r4yusJXq90BeZ2sJbWg0o6BKjoLjp3exwTFmQK3Ohe 0g/lIlMkl1WgDGCc2JCUCqNOsEooSLkB0L7CVVgz5/UN1801K6VbEDfnYMaMJ5BQdE4JzIU zTrNgP0bY874ajepoeZBw== X-UI-Out-Filterresults: notjunk:1;V01:K0:4yYYTIUAmaI=:ShZjZHHJNAVtOo97nxsQNb cmuVVIaWq6LRztjN1AAafP9GsFq56iJKlsBmAGKxaHYqr3cEZ7WZLxjPIikwU7Ae9xGLNnJBN JX2pdckeRaLsqYGGXBWOnpuCFtx1UMErIilWFa6DK1m8nWLn6uWfi4F2naKnZmHs85wVEZ0fB QUKPc19NiwdSzm13xo+PUKOCnET9IfdOJzB+XsowSDc1pxE3VFUxvypsCiGNLOh1pFrvSjKNm IW/J7giuhY1CSSSqUmYodNCe/akVFsISQ1dRYqGq1ySw1iKiUl/0Wq6rrXQURqiq78vFE6mrp Ja3kcoy9qjSorgwYxd0mTGJt+Kgqqze6jy+RpNnoeinBbjv9hntrRwjSSIE9QjWPMnQvDrmBK NDwg4mOCU2D9xlsu1xTCXtfEz2/k9HsVYGu5VshHz1ZaB7SIiqA/VqqJW2hxBL0BIeGcVxruC r3seNli/17lExng1GZvuDtiQD0BD/wZpfsxFrMF7HPI7jjvc/tRhbV9tE1Q0Ufr7QtsAlzCsS /VNSOrs5sb6w/i/4Kp1OiKAXeZ8QpRtUUpGMpNu/zgzE8r16p4Cv7NIlrjMBRUL+OiCfWAghJ I00AX3kYNxH7GtAvDPilFwgv9ksJx8AzGUjvw2rU71VK3gg41WiU6MLQrdXCsY36bELfyXJRi +e6D+dcqT1EAAmKZYONNY9Okb9Vec9DIG7vh6CaM3XcjfSPrRV3JO96msjlwtizUuMiq06XjM uJKvMcu+7KoJVrbl Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1912 Lines: 47 On Wednesday 02 December 2015 14:56:57 Stanimir Varbanov wrote: > On 12/01/2015 12:29 PM, Arnd Bergmann wrote: > > On Tuesday 01 December 2015 11:14:57 Stanimir Varbanov wrote: > >> + if (srcs & BAM_IRQ) { > >> clr_mask = readl_relaxed(bam_addr(bdev, 0, BAM_IRQ_STTS)); > >> > >> - /* don't allow reorder of the various accesses to the BAM registers */ > >> - mb(); > >> + /* > >> + * don't allow reorder of the various accesses to the BAM > >> + * registers > >> + */ > >> + mb(); > >> > >> - writel_relaxed(clr_mask, bam_addr(bdev, 0, BAM_IRQ_CLR)); > >> + writel_relaxed(clr_mask, bam_addr(bdev, 0, BAM_IRQ_CLR)); > >> + } > >> > > > > I think the comment here should be moved: change the writel_relaxed() > > to writel(), which already includes the appropriate barriers, and > > If we agree with such a change it should be subject to another patch. Correct. > > add a comment at the readl_relaxed() to explain why it doesn't need > > a barrier. > > Infact I'm not sure that readl_relaxed(BAM_IRQ_STTS) does not need > barrier. If I read the code above correctly the mb() should guarantee > that all load and store operations before it are happened before the > write to BAM_IRQ_CLR register, and on the other hand if we replace > writel_relaxed with writel, the writel has wmb() which guarantees only > store operations. Did I miss something? You are right, we only guarantee that stores to memory are complete before we writel() an MMIO register. What do you gain from synchronizing reads before an MMIO write? 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/