From patchwork Tue Apr 23 22:59:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10913815 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12E8B1390 for ; Tue, 23 Apr 2019 23:00:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F39072887A for ; Tue, 23 Apr 2019 23:00:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E42AB28A0E; Tue, 23 Apr 2019 23:00:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6F6632887A for ; Tue, 23 Apr 2019 23:00:45 +0000 (UTC) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=AtqL1m0rL374vJrOoi3txXBL6wFJ5Xnl+YHM2gfo4FE=; b=RNuYNakVjrAB1i PRh4EAsdnLNqUDxNn9lrsT/noJcGy4MRChNh4bxlFsjQkLSy+rwmzvG5g0tOUBvdqfqBipaRHkhPE y22AXtr16fQuFdDpLno8TfwUVh3mzPOgq+w2efs1uUwTWG2GLdSXYWAvBc63mXPHcnybEiPmJt6g9 KaQ8Z7oEhd9jCsMfEWnTl12B60XjsAA1ORmoF44iH7KgkckVHXigHJpc5FjaiZHc0wjuRPmAb/6fn a27LHaeJla6olIRCSpZdwdAj2KLK9tWuDZjm43k2zcQqRf7x/Dx1TzB8LnVybd5wAt2zqBD0mTVA4 a3wXmyAorzBXUCTgtPXA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJ4P4-0006Wu-AS; Tue, 23 Apr 2019 23:00:42 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJ4P1-0006W8-9o for linux-rockchip@lists.infradead.org; Tue, 23 Apr 2019 23:00:40 +0000 Received: by mail-pl1-x642.google.com with SMTP id o7so5992932pll.13 for ; Tue, 23 Apr 2019 16:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ra8Ms5CUfBwXQRLy73kzr5XO2DuaX+tzW+qegRE+LGM=; b=XwvnvmUbLauRVIj4hvNXed/2GB6dgP6nTAJ4mI/51T2G61NvDJlzvPajYR08sH0oA+ NeMe9ChkLDPHVDr9ieDzVm6sGk8nMPgxApd/QoGwCgjr8vIj3lbstDd0j+taCdwK1Xa4 ky4untPiEV8NDidCJlxOIXfW9owEj5lAR48CA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ra8Ms5CUfBwXQRLy73kzr5XO2DuaX+tzW+qegRE+LGM=; b=Qo3uWk+9MMsXQ9XaT3bopx8qLV0FBq4RVe5CQPDcsUhNaSl7kO29DV8zed3KyOxVJy kPa8TlCr8vGpz5Yz+GU/z3Im0vTFS53/gn1dnhgn6cahhI/oViE7LynS5/kZpbudardA 9gOV89Oz69WfHu3Tv52FzlUcKXeUFbALEmy7uPUjrU6TN90VTc0xODLYqHIhMeuOHMx/ l3cbaUy/+J0znoxPAUlrNTwjY0m2zFyJEWA9WzsUX6Qepi9H6agOVx4kF2MV1eLaxAQG XU4riGpHE6JWkBSiBPCGdNC/n0MZS1X1i9sdIuPY1cDbQ+JALz6Tavuas8wkbjuVid/k W0mw== X-Gm-Message-State: APjAAAWBqgN2cZ+iKl8sLJaL91xkOgSGy6LhqBNYufWes4oUDtyI83UI unH1DFrz9UJLpnwbnBCR+mT1Rg== X-Google-Smtp-Source: APXvYqxCEK2LTIUfGGL05MZVufslqWsTB7Kv3HMeLX6IGw8zPEdUXkD39e7d0eqVk1oWDX1zvd5nEQ== X-Received: by 2002:a17:902:263:: with SMTP id 90mr29254648plc.257.1556060438495; Tue, 23 Apr 2019 16:00:38 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id f66sm854467pfa.5.2019.04.23.16.00.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 16:00:37 -0700 (PDT) From: Douglas Anderson To: Russell King Subject: [PATCH v2] ARM: errata: Workaround errata A12 857271 / A17 857272 Date: Tue, 23 Apr 2019 15:59:59 -0700 Message-Id: <20190423225959.43742-1-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190423_160039_363161_7AC11302 X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Douglas Anderson , heiko@sntech.de, Tony Lindgren , Palmer Dabbelt , will.deacon@arm.com, bbatacha@arm.com, Masahiro Yamada , Lorenzo Pieralisi , linux-rockchip@lists.infradead.org, mka@chromium.org, Salva.Climent@arm.com, Arnd Bergmann , marc.w.gonzalez@free.fr, Marc Zyngier , sonnyrao@chromium.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , linux-kernel@vger.kernel.org, Paul Burton , Andrew Morton , robin.murphy@arm.com Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds support for working around errata A12 857271 / A17 857272. These errata were causing hangs on rk3288-based Chromebooks and it was confirmed that this workaround fixed the problems. In the Chrome OS 3.14 kernel this was treated as two errata: ERRATA_FOOBAR [1] and ERRATA_CR711784 [2]. Apparently the two errata got lumped together at some point in time. Let's actually get the workaround landed. [1] https://crrev.com/c/342753 [2] https://crbug.com/711784 Signed-off-by: Douglas Anderson Signed-off-by: Sonny Rao --- Changes in v2: - Squashed bits 10 and 11 into one errata. arch/arm/Kconfig | 18 ++++++++++++++++++ arch/arm/mm/proc-v7.S | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index b509cd338219..59fdcd51d7ee 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1172,6 +1172,14 @@ config ARM_ERRATA_825619 DMB NSHST or DMB ISHST instruction followed by a mix of Cacheable and Device/Strongly-Ordered loads and stores might cause deadlock +config ARM_ERRATA_857271 + bool "ARM errata: A12: CPU might deadlock under some very rare internal conditions" + depends on CPU_V7 + help + This option enables the workaround for the 857271 Cortex-A12 + (all revs) erratum. Under very rare timing conditions, the CPU might + hang. The workaround is expected to have a < 1% performance impact. + config ARM_ERRATA_852421 bool "ARM errata: A17: DMB ST might fail to create order between stores" depends on CPU_V7 @@ -1193,6 +1201,16 @@ config ARM_ERRATA_852423 config option from the A12 erratum due to the way errata are checked for and handled. +config ARM_ERRATA_857272 + bool "ARM errata: A17: CPU might deadlock under some very rare internal conditions" + depends on CPU_V7 + help + This option enables the workaround for the 857272 Cortex-A17 erratum. + This erratum is not known to be fixed in any A17 revision. + This is identical to Cortex-A12 erratum 857271. It is a separate + config option from the A12 erratum due to the way errata are checked + for and handled. + endmenu source "arch/arm/common/Kconfig" diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 339eb17c9808..2966086d8a45 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -391,6 +391,11 @@ __ca12_errata: mrc p15, 0, r10, c15, c0, 1 @ read diagnostic register orr r10, r10, #1 << 24 @ set bit #24 mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register +#endif +#ifdef CONFIG_ARM_ERRATA_857271 + mrc p15, 0, r10, c15, c0, 1 @ read diagnostic register + orr r10, r10, #3 << 10 @ set bits #10 and #11 + mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register #endif b __errata_finish @@ -406,6 +411,11 @@ __ca17_errata: mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register orrle r10, r10, #1 << 12 @ set bit #12 mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register +#endif +#ifdef CONFIG_ARM_ERRATA_857272 + mrc p15, 0, r10, c15, c0, 1 @ read diagnostic register + orr r10, r10, #3 << 10 @ set bits #10 and #11 + mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register #endif b __errata_finish