From patchwork Tue Nov 15 12:16:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Tianhong X-Patchwork-Id: 82318 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1496116qge; Tue, 15 Nov 2016 04:18:19 -0800 (PST) X-Received: by 10.98.36.195 with SMTP id k64mr46350475pfk.126.1479212299664; Tue, 15 Nov 2016 04:18:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17si26314447pgi.130.2016.11.15.04.18.17; Tue, 15 Nov 2016 04:18:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932335AbcKOMSQ (ORCPT + 7 others); Tue, 15 Nov 2016 07:18:16 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:26725 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932560AbcKOMSQ (ORCPT ); Tue, 15 Nov 2016 07:18:16 -0500 Received: from 172.24.1.60 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.60]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DQR68935; Tue, 15 Nov 2016 20:16:33 +0800 (CST) Received: from localhost (10.177.23.32) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Tue, 15 Nov 2016 20:16:23 +0800 From: Ding Tianhong To: , , , , , , , , , , CC: Ding Tianhong Subject: [PATCH v4 6/6] arm64: arch_timer: acpi: add hisi timer errata data Date: Tue, 15 Nov 2016 20:16:07 +0800 Message-ID: <1479212167-5812-6-git-send-email-dingtianhong@huawei.com> X-Mailer: git-send-email 1.8.5.2.msysgit.0 In-Reply-To: <1479212167-5812-1-git-send-email-dingtianhong@huawei.com> References: <1479212167-5812-1-git-send-email-dingtianhong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.23.32] X-CFilter-Loop: Reflected Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Hanjun Guo Add hisi timer specific erratum fixes. v3: add hisilicon erratum 161601 for ACPI mode. v4: update some data structures. Signed-off-by: Hanjun Guo Signed-off-by: Ding Tianhong --- drivers/clocksource/arm_arch_timer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 1.9.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index d4f4a0d..649f7fe 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -1078,10 +1078,28 @@ struct gtdt_arch_timer_fixup { void *context; }; +#ifdef CONFIG_HISILICON_ERRATUM_161601 +static void __init erratum_workaround_enable(void *context) +{ + u64 erratum = (u64) context; + + if (erratum & HISILICON_161601) { + timer_unstable_counter_workaround = &arch_timer_hisi_161601; + static_branch_enable(&arch_timer_read_ool_enabled); + pr_info("Enabling workaround for HISILICON ERRATUM 161601\n"); + } +} +#endif + /* note: this needs to be updated according to the doc of OEM ID * and TABLE ID for different board. */ struct gtdt_arch_timer_fixup arch_timer_quirks[] __initdata = { +#ifdef CONFIG_HISILICON_ERRATUM_161601 + {"HISI", "hip05", 0, &erratum_workaround_enable, (void *) HISILICON_161601}, + {"HISI", "hip06", 0, &erratum_workaround_enable, (void *) HISILICON_161601}, + {"HISI", "hip07", 0, &erratum_workaround_enable, (void *) HISILICON_161601}, +#endif }; void __init arch_timer_acpi_quirks_handler(char *oem_id,