From patchwork Wed Sep 13 11:24:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 813378 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IwQQSQCO"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xsfTL23P4z9s81 for ; Wed, 13 Sep 2017 21:24:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=miaFhrm8RctsG0vCjBtHk/I3rMqeqC0WQJ4gLZDhUPw=; b=IwQ QSQCO8Ev0kPFB9bkzs6HZuGII4zzvC5MqXGxzaa29VRkznVAPc2tv6r2PWF+3/lSA35XBQo5l9n8X H2x3sS9XAqF/90FEzVqEQpOl8Bj9wLPd4B2W6RVQKildli75nVDT9q+6W+oZu3icbCSqcObBwFOPd TE4c5fHPsH2RMgU08KkauHq6VncIS7kkLzP6KTfGuo67TNPS8RD9iYCtY2oF2V6uZQMKBhGWvtF+E uAgOMn5DDS24HN4PrOX1b9/aAFPQXDda/6Lw6QDvjUcibg7OQCgwCzuQvoGVXuT164eQH2FNfwuuq CWcKeIhPsb+bVwzJWl7VKsnKVND3kgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ds5mk-0006wt-Ir; Wed, 13 Sep 2017 11:24:50 +0000 Received: from smtprelay.synopsys.com ([198.182.60.111]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ds5mg-0006tf-RI for linux-snps-arc@lists.infradead.org; Wed, 13 Sep 2017 11:24:48 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 35B8B10C1260 for ; Wed, 13 Sep 2017 04:24:22 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 16653DF3; Wed, 13 Sep 2017 04:24:22 -0700 (PDT) Received: from joabreu-VirtualBox.internal.synopsys.com (joabreu-e7440.internal.synopsys.com [10.107.19.118]) by mailhost.synopsys.com (Postfix) with ESMTP id B44C2DD8; Wed, 13 Sep 2017 04:24:20 -0700 (PDT) From: Jose Abreu To: linux-snps-arc@lists.infradead.org Subject: [PATCH] ARC: Memory barriers for everyone! Date: Wed, 13 Sep 2017 12:24:09 +0100 Message-Id: <0962ea206d9480abb7084bfbca86237cfc69b16b.1505301175.git.joabreu@synopsys.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170913_042446_974378_737F8CFF X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.60.111 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Joao Pinto , Vineet Gupta , Alexey Brodkin MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org By default __iormb() and __iowmb() translate into a do { } while(0) for AXS10x platform. As ARC700 supports the sync op we can use the standard memory barriers that are supplied by asm-generic headers. Signed-off-by: Jose Abreu Cc: Vineet Gupta Cc: Alexey Brodkin Cc: Joao Pinto --- Hi Vineet, This is the final patch for the series which should fix all the stacktracing mechanism for Bus Error messages. In this one we force memory barriers for all IO operations which will prevent op reordering by gcc and which will *really* correct blink and eret regs to show where exactly the error happened. With this fix I get a correct stacktrace upon a readl() from a non-existent register which causes a Bus Error. Without this, I would get non-correct blink and eret addresses because the ld operation would launch a bus error way after we performed readl(). I am sending this but I'm not exactly sure if all platforms support the sync op. Could you confirm this? Best regards, Jose Miguel Abreu --- arch/arc/include/asm/io.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h index c22b181..712defd 100644 --- a/arch/arc/include/asm/io.h +++ b/arch/arc/include/asm/io.h @@ -12,15 +12,10 @@ #include #include #include - -#ifdef CONFIG_ISA_ARCV2 #include + #define __iormb() rmb() #define __iowmb() wmb() -#else -#define __iormb() do { } while (0) -#define __iowmb() do { } while (0) -#endif extern void __iomem *ioremap(phys_addr_t paddr, unsigned long size); extern void __iomem *ioremap_prot(phys_addr_t paddr, unsigned long size,