From patchwork Fri Apr 19 22:18:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10909833 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 C6E911850 for ; Fri, 19 Apr 2019 22:18:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6B6C28DA9 for ; Fri, 19 Apr 2019 22:18:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA9BF28DAA; Fri, 19 Apr 2019 22:18:55 +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=unavailable 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 4B00028DAB for ; Fri, 19 Apr 2019 22:18:55 +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=eykAy+HWARqlOvzIODLg6mLSGocJzF3gxD5L/d2QQQU=; b=ajVz47W7l5NODP YRq3gOscrlYXW1W+J+uEKXWettkP8CIqxxQZeU08QKZkZZdnEpWanzlqTzvvp9UvronzC2TmtQTBG ukcnJjp+cnseEIhVJDAdNfGLs4vl+vWwaxD/XcL7OJ7OAOnyiDwqb9tDdrE6G74LbnH7o9d7HSmWx f5RiXp7G0lDYW2wLbZIPUvnHrUpO9xHWLpVyp1erq0ozG6Pwuip6U9H1K2Al00PLmjJuEb/UiTuiU oMwhZMgBC/cbSHc2cUN3XVnX6vgx9VhxvGywaNsDH0vighMjPg1Z7fpKEmFgMlQXiAD89tr3Mxkep 0G/Ujvb8Gr2UzPJ5ogPg==; 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 1hHbqM-0008Rt-TP; Fri, 19 Apr 2019 22:18:50 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHbqE-0008KO-PT for linux-rockchip@lists.infradead.org; Fri, 19 Apr 2019 22:18:44 +0000 Received: by mail-pl1-x641.google.com with SMTP id o7so888000pll.13 for ; Fri, 19 Apr 2019 15:18:41 -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=s1sB1GoBG8jgYUqmC8R7BIjAuUM8QSOtRx/2W9R3rOk=; b=OAl71d2uuhHRB0be/hhOKjQWPonk8yDHaNCvHAhGIqFhy5mrexY0tRFlcAwxRXuyrC vEhUhFIdHv5scwPVQPSmWp8YTUunCNeVm+haVVpqktcrW/a4c4w4BEnh1r2n0tMOGLE1 X9lr3QfmQoprME/6UDLpaecSwcGzJWG2ySbbk= 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=s1sB1GoBG8jgYUqmC8R7BIjAuUM8QSOtRx/2W9R3rOk=; b=jYjOSvUv2PzmMA2lm+B5NDYEpWvFnpeMdmEMUOjlU7SxBpvd8MTok7E9HMjgjnFmU3 5f4CG3TeSpZxnko2l/+9VTwZb2H83oXL6lYplKKjIGdExjZ5qgNSwhuUqvJ6ULJnFXkS 7Vxv2I5pbhGMohusLbHS0Uyb5IQu/x4Z32H6qDVTuzTccRfB0jmvb+2oTmq3b/gpRpPo FTFVjKRb1Li6nKi1ynv6wldADuoui3IFRuQFTkv2MN2zmd2kcQ4lonQCP56L5G21qJpa Q/2HP+n0ktoUtOR/qn6w0XJyZQRrXmrv3+cBo9PtjjztAoTutP8Guk89nt/U7geNuvsB taHA== X-Gm-Message-State: APjAAAWJrHkWlsy25rpYMctYoCrvW7FDeE+iSJOoGMvI18lkhpypHpqC wW4UI7WlrFtmnehylAoSs/w4Kg== X-Google-Smtp-Source: APXvYqy040/JIipaz4jkwC3Bd/TwLllG3XTi4pBeE74yt9sxtLCjQEjMOrZ5EmDGWm4GllX6yy5SGg== X-Received: by 2002:a17:902:7043:: with SMTP id h3mr6404044plt.228.1555712321184; Fri, 19 Apr 2019 15:18:41 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id a3sm8162536pfn.182.2019.04.19.15.18.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2019 15:18:40 -0700 (PDT) From: Douglas Anderson To: Russell King Subject: [PATCH 1/2] ARM: errata: Workaround errata A12 857271 / A17 857272 Date: Fri, 19 Apr 2019 15:18:02 -0700 Message-Id: <20190419221803.99322-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-20190419_151842_824067_7CD38D2C X-CRM114-Status: GOOD ( 12.70 ) 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 , Florian Fainelli , linux-rockchip@lists.infradead.org, mka@chromium.org, Geert Uytterhoeven , Salva.Climent@arm.com, Arnd Bergmann , 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 From: Sonny Rao 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 [1] this erratum was known as ERRATA_FOOBAR due to lack of an official number from ARM (though the workaround of setting chicken bit 10 came from ARM). In the meantime ARM came up with official errata numbers but never published the workaround upstream. Let's actually get the workaround landed. [1] https://crrev.com/c/342753 Signed-off-by: Sonny Rao Signed-off-by: Douglas Anderson --- arch/arm/Kconfig | 19 +++++++++++++++++++ arch/arm/mm/proc-v7.S | 10 ++++++++++ 2 files changed, 29 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index b509cd338219..4376fe74f95e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1172,6 +1172,15 @@ 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 negligible 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 +1202,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..cd2accbab844 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, #1 << 10 @ set bit #10 + 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, #1 << 10 @ set bit #10 + mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register #endif b __errata_finish