From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28514C4727F for ; Tue, 29 Sep 2020 11:17:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B261F20848 for ; Tue, 29 Sep 2020 11:17:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aCUrsrVR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B261F20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IRj2nu0c2Q9PQDyvWiVH1pnCwY2wdTZYaSZBOEysF2I=; b=aCUrsrVRO1lhFnifEF6PHNe/t V4lvcZN4eQ/vc5xJs1AcQ7SBhkw3igEWhtRD5wqhSVpYgUlwRq/f8XSrYAw1+ut97lypxIZp2BpXP lAuNYW+FsamrXwKBGlZt3kce1GdJQEhHGwKecePNTRXMADpr0b3K/tzvOVEOgDrXMHpvF7n6V6PmT 9uEJaQBbDsfiMA/BSp5zyv0Gq4Agy0t0n2VVPDePzAYMBQmYwhUQw5suIbU/HRGFgFnB38YF4fB7h 3d8LXe/dba3/CollCEa114zedtj8idLL48U/m/5NNgBq8flncyYxy9+Xtzv3+Tn3zOpFtIZVPH8kq 2EWz9qV6A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNDbp-0008DK-C6; Tue, 29 Sep 2020 11:15:49 +0000 Received: from szxga06-in.huawei.com ([45.249.212.32] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNDbl-0008Bu-J3 for linux-arm-kernel@lists.infradead.org; Tue, 29 Sep 2020 11:15:46 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id DCFDFD0187B43990C58A; Tue, 29 Sep 2020 19:15:37 +0800 (CST) Received: from [10.63.139.185] (10.63.139.185) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Tue, 29 Sep 2020 19:15:31 +0800 Subject: Re: [PATCH] iommu/arm-smmu-v3: Add rmb after reading event queue prod_reg To: Will Deacon , Robin Murphy , Jean-Philippe Brucker , Joerg Roedel References: <1601281922-117296-1-git-send-email-wangzhou1@hisilicon.com> <160132830305.1858738.13352352759100546799.b4-ty@kernel.org> From: Zhou Wang Message-ID: <5F731754.5040609@hisilicon.com> Date: Tue, 29 Sep 2020 19:15:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <160132830305.1858738.13352352759100546799.b4-ty@kernel.org> X-Originating-IP: [10.63.139.185] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200929_071545_947629_B6E3ABFE X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, iommu@lists.linux-foundation.org, kernel-team@android.com, linuxarm@huawei.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020/9/29 6:13, Will Deacon wrote: > On Mon, 28 Sep 2020 16:32:02 +0800, Zhou Wang wrote: >> In arm_smmu_evtq_thread, reading event queue is from consumer pointer, >> which has no address dependency on producer pointer, prog_reg(MMIO) and >> event queue memory(Normal memory) can disorder. So the load for event queue >> can be done before the load of prod_reg, then perhaps wrong event entry >> value will be got. >> >> Add rmb to make sure to get correct event queue entry value. > > Applied to will (for-joerg/arm-smmu/updates), thanks! > > [1/1] iommu/arm-smmu-v3: Add rmb after reading event queue prod_reg > https://git.kernel.org/will/c/a76a37777f2c > > (please note that I changed the patch to use readl() instead of an rmb() > in conjunction with the _relaxed() accessor, and then adjusted the cons > side to match in terms of DMB vs DSB). Thanks for taking this patch! Best, Zhou > > Cheers, > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel