Received: by 10.213.65.68 with SMTP id h4csp2643416imn; Mon, 2 Apr 2018 11:12:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/p1Uqtyv3GRFoQPLxLNmlcklOv+BqNWZGbB/dPkRfM50ZKVN+BURPbQBjQbtYjigVVLJ8z X-Received: by 2002:a17:902:7d8a:: with SMTP id a10-v6mr2488160plm.268.1522692739321; Mon, 02 Apr 2018 11:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522692739; cv=none; d=google.com; s=arc-20160816; b=n75LRIXccvnV8Mf+4zpZBm2Ny3VK8LU+xc4n8RU1h7K8x6dQQ0E6wjTRX+i4gUnM7E kOX0G39O2dDdzrBFtP9Ul+Nk8VLBFDqul+cARjHaoAExgZZARr4+WjNur3LqquNKdq5J jFWgBCJ43gRLknBYiuqimx/DfiukTY1Qd1s02rXSS1zLH994+hpLNEtnQemeKdVKNlWN 1nK9nSHAYeL2GdqctnVtvz0g0LrsnoPcuObHhHMlAqQp3VQlFGs+Q3orR6sKUolsqi0w KN32gEiR8F5g+1hbEQLK0EDz9VprTPo9XZNol5QCh15cVKp5W+u9yUDQp408Ih1ox5Zr yLWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=zL1ZiIoLjjcwm77ZA6q80HlhLh5lAGPPvUib6gVsXRs=; b=Dx0iiMImN0JIshYXbKXmm+S5ru0sVQ5EmlVWAhAvPHN25gq8i/0VlbS2V34bxPZBS6 uJxEHF2FgExnzGmI52vCHpP7lYWFdU1qWHhuBV5NSTktQA11ft/GhoOdwLH2vaM0sRwx jyyMWPo2Qa0o/Ki927Rs2RXacYU7frmjWNZ4tCNp9jJmKuuFu0R7xS+kXnoOKZ6SVdW7 TfYSrcioIyUNRTFyyBQ8RrsU3GwlU+7V7mWYMElWKQkQCYhHYvTDIglNKzKfrK4B60w+ Z2bKY0NHQOZ/260WqGCagfx4fKCWup6oxBU7THIJsPln0zzJ/F1xif05WqdeNPLXSP5h CYFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=BcRXbXHJ; dkim=pass header.i=@codeaurora.org header.s=default header.b=S10APZ6O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si756429pll.332.2018.04.02.11.12.04; Mon, 02 Apr 2018 11:12:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=BcRXbXHJ; dkim=pass header.i=@codeaurora.org header.s=default header.b=S10APZ6O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753354AbeDBSKt (ORCPT + 99 others); Mon, 2 Apr 2018 14:10:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48990 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030AbeDBSKr (ORCPT ); Mon, 2 Apr 2018 14:10:47 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 062206081A; Mon, 2 Apr 2018 18:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522692647; bh=B62/sFeRiDwOYW5ZX08hlViVI1q7DO+Kcxpop8wMsLM=; h=From:To:Cc:Subject:Date:From; b=BcRXbXHJ6sqOBIp/rkeTa4vjn5EhCxxcEqdOwobardwW422nFK+vogA61zPo3Y8X8 377aXJRznVSXIAJKMEmhNceqpO5cL9iD8oMEbe4mjQVO89NZl76xXK3O/2wuwi/Eby cgkW/77vGVjKKmo4SGolQHyIL4DjZl+Awgt8V/f4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 11AED60591; Mon, 2 Apr 2018 18:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522692646; bh=B62/sFeRiDwOYW5ZX08hlViVI1q7DO+Kcxpop8wMsLM=; h=From:To:Cc:Subject:Date:From; b=S10APZ6OE8JPyMJOmA7DWTYVvDSLe40yqb9LBZxtf6rap+JnpWkuPwGgkkAdAqkzX 2qk0XNXdH3mPK/SW3XcKXbpmnqR1vePKCEiZYhsXDuXfBWO/32n7IbywQl8RPyVQ9c ifSBFQsz8mgRCuCyJdJ3Rw6KCqMkBqvO26dFKtF4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 11AED60591 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-mips@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org Cc: arnd@arndb.de, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Ralf Baechle , James Hogan , Paul Burton , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: io: add a barrier after readX() Date: Mon, 2 Apr 2018 14:10:32 -0400 Message-Id: <1522692633-24304-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While a barrier is present in writeX() function before the register write, a similar barrier is missing in the readX() function after the register read. This could allow register accesses following readX() to observe stale data. Signed-off-by: Sinan Kaya Reported-by: Arnd Bergmann --- arch/mips/include/asm/io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 0cbf3af..7f9068d 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -377,6 +377,7 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \ BUG(); \ } \ \ + war_io_reorder_wmb(); \ return pfx##ioswab##bwlq(__mem, __val); \ } -- 2.7.4