Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2219935imu; Sat, 12 Jan 2019 19:18:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN7lfASaMdATZwqOI9q1SNisD1f1o0mGLD9l+j26Jsk8sESIJnwakEroAyoGWT7N21QqvP2c X-Received: by 2002:a17:902:b494:: with SMTP id y20mr20993489plr.178.1547349504563; Sat, 12 Jan 2019 19:18:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547349504; cv=none; d=google.com; s=arc-20160816; b=S0DjHDdwIi0GsfDVxmvvqhcXRpCB8qazaM41cmh1S0fMidv4MaRDHi4w2KHxUG9Ct/ jARiJOUOOLijfK+PwVDtobDI28d8Mk16d2jHN2PcC9b60LNFP5Dvfk6Qrlj4QSvTaMKu s+6kd5PqzTVJvpZZfhFGam9p9WkcZLDKbfMxTZxsqjWSTgwb44ZkYE3dUldHj7u6JdGQ QpkEFJAYbH20/CNQCpOBU7CPKRiTV9cDrNc4ev476nLD6B206qVl1boxT3raNiuuXkD1 6fTVdccUvCK1mdP1ANK8b17ORloQxEngNTF2YI/iMLfjDsQPkEg5D9TpPqvnsOFJtUPn o2GQ== 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:dkim-signature:dkim-signature; bh=KCeY86tv8Fiaj4hdrOr70454H4fi8ibvju0WHHAlmjw=; b=AdiM7y3dzgkgADTj4402BxRTY8SAPeEbYpZnxVJZfZWBYIZ6Nv+XD4qloe1PqITC2H 4ijMnrMLqz4zYZW7o09q6b37Ngqj4nd4d8W9zY5QSRHHgEhP2zAWbzrlQ7zAOFk7yvdN R4T8p3SH/IQA12CXsnN/7oB64Opu5nSKiELrnCq5ofwd+Fx7rxt/qSIR03+aT6ca+L6X RnS27qXo8Cx5g7nptm/tYD2ctFhpSb/Z//Z2zEFGT/2ZlP19lir1GYWJJTk+F5cGPU31 StWR5zUT6TSso2qKDTDOa90ynFc4ASu6+id7YhcZoBgcBqQoZmMyhcDv59xCt8V9dEhV f2Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=uXzafqju; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=s0JaWZ8X; 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 a2si27023363pgm.154.2019.01.12.19.17.37; Sat, 12 Jan 2019 19:18:24 -0800 (PST) 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=@sholland.org header.s=fm1 header.b=uXzafqju; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=s0JaWZ8X; 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 S1726690AbfAMCRZ (ORCPT + 99 others); Sat, 12 Jan 2019 21:17:25 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:50977 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726615AbfAMCRY (ORCPT ); Sat, 12 Jan 2019 21:17:24 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5889521AC2; Sat, 12 Jan 2019 21:17:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 12 Jan 2019 21:17:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm1; bh=KCeY86tv8Fiaj4hdrOr70454H4 fi8ibvju0WHHAlmjw=; b=uXzafqju/gEunM7j5YYOVCAE9o3jWJ6bBUlae/2THr qx23gARtsLmDeNJ23EarOlYvRwec8Hy+ehHucTiuRY0poYiIrY7WVvcxGGuSyvph l44N8kXcIzrL6iTkmuxUtSFEahxxz1w407YmWupw/JJhzhV26JfTyWvag37VLjkc rt8RHu9sMYw6XnwSlET/B1Y4ZSP+yWMRama1kD8zyykKVal2604bgDp4nJN/2f1P m7LZc4Iq8a3Fm5/xL3w0jK1gDHFi/J13OkCgxs43kxY4QY7em9JBxMHCBxPofH7W TpmEkeIK0Vt8bLrIbL1HF9iHnpvRwDJFAkdKIXpxdr+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=KCeY86 tv8Fiaj4hdrOr70454H4fi8ibvju0WHHAlmjw=; b=s0JaWZ8XxK8p7bgGqPHxzC iG+uq89ijriMn6nEuh8j9Db5lP74foF15X2aWlTIjZvbm5S+03YWinYtLgesOP9W l7eaHlU4wr4cjrSXsyNQ9gruVg7ON/806f8uXpkpgHUko6bO0ES4v6uip9HvKsZI ITTRdnvdentRDix4ifgyCWl3WwZc4smQbLA8i3IPix2ouyZ5dJpadl5wsnPooMMj jcPTAYDaBy1vtUlM/Zdh5/hHmTlHV1wLjkmNaN5W7g5e1fj3HCYWlUU96s0qiO2D jq9l9+GfI7rWIsf8kgpdJUlhcgPuult9N43ckpO49ztYhBo2wlz+nAMvjy2OYZdg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrfeekgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffogg gtgfesthekredtredtjeenucfhrhhomhepufgrmhhuvghlucfjohhllhgrnhguuceoshgr mhhuvghlsehshhholhhlrghnugdrohhrgheqnecukfhppeejtddrudefhedrudegkedrud ehudenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghnugdr ohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id CDF3B100BB; Sat, 12 Jan 2019 21:17:20 -0500 (EST) From: Samuel Holland To: Catalin Marinas , Will Deacon , Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland , Daniel Lezcano , Thomas Gleixner , Marc Zyngier Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH v3 0/2] Allwinner A64 timer workaround Date: Sat, 12 Jan 2019 20:17:17 -0600 Message-Id: <20190113021719.46457-1-samuel@sholland.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is the third version of a patch series to fix system clock jumps and other timer instability on the Allwinner A64 SoC. It has now been tested for a week, and I've received no reports of date jumps with this version. So this is, as far as I can tell, a complete workaround. See the commit messages for a detailed description of the issue, but the summary is that, when a high counter bit rolls over, indeterminance in the low bits causes CNTPCT/CNTVCT and their respective TVAL registers to jump forward or backward. Backward jumps (or the next read after forward jumps) are sometimes seen by the kernel and interpreted as the timer wrapping around after 2^56 cycles. This causes the system clock to jump forward approximately 91 years. changes since v2; - Reduced workaround threshold from 11 to 10 bits based on reports from other hardare and the U-Boot version of this workaround - Added TVAL handling based on Marc's suggestion - Added erratum documentation and renamed symbols to match - Added Maxime's Acked-by changes since v1: - Add an iteration limit like most other arch timer workarounds - Added Andre's Tested-by Samuel Holland (2): arm64: arch_timer: Workaround for Allwinner A64 timer instability arm64: dts: allwinner: a64: Enable A64 timer workaround Documentation/arm64/silicon-errata.txt | 2 + arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 1 + drivers/clocksource/Kconfig | 10 ++++ drivers/clocksource/arm_arch_timer.c | 55 +++++++++++++++++++ 4 files changed, 68 insertions(+) -- 2.19.2