From patchwork Fri Oct 21 15:34:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Korty X-Patchwork-Id: 6754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp763719wrr; Fri, 21 Oct 2022 08:35:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM694R2Oifs4Ks41L9MLCrZ/UUe4RXuBshNPaZl19mLD8s61ikhxQBD5HRM9qgXsiyNZawwW X-Received: by 2002:a17:903:18c:b0:185:51cb:3619 with SMTP id z12-20020a170903018c00b0018551cb3619mr19616211plg.6.1666366553612; Fri, 21 Oct 2022 08:35:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666366553; cv=pass; d=google.com; s=arc-20160816; b=wE/hs/0RBSt6Eh9dBqZb007gaiA/6W2F3BwQ/QfR0PAa8SsRfuImxY1ySGH410Wo+K W+tSM/i2qr8AuTbH6SM8JxlsWr7BL91hGF3Z7dSZzq3tYz1QELV2RtpvB03Hjw2CBPB8 Ux41RukaA8w7f0L82VL0VXUKmYeYT/MsQT0GUfssKfkyQnwPemn5f9+akSY9+0SNYNMi 1Cz7ZjYjkXGrXxWiTQZ5qQywUWLenKODbvAcNwF78SGGr14K6R2Kv/un1pLz4Nxyrc/t O2E05YZ32wRcAuwSfZUXadZ5M8BZUaQ/YKI0bGZx1w4AInKYGEl8IFlNkql3IgVSJfEW Q3jQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:content-disposition :reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=6IR26zvGQfYXSBKJCweO48Zc6askbHt7qx2j8/ElUvU=; b=WJOvl3iCvH9JQixmKkzGLpj3p6kjhHvt0NYTeI/3ZHpgCk7RAqViNQp45HGhpjiBj1 1e4sj1uSZ3QPX8HGzYtDUz3a4hgeMiuGGI0k5LHK+HDygyEe6qF+p1K8TvSW/uaaIlwq TaE/FwX1eqQFuwpHGdSKEAsOFFC13aGUEr4DpXYgwqgIVs/CV6eMp9ojAG3YSsFpIFqV COSfCzH8MqpV18/UsCVUyxrwwQCRt6k6rqjGtjFZd2fHisRYmbR8lT55gUtplW3n5aUt KHiTuy5FKu+bOw7ILKX+VGtKIvveBtvynsUs4cvVwiosylWZ48ebaDAgP5CwOyRvzxqx VJ2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bksv.onmicrosoft.com header.s=selector1-bksv-onmicrosoft-com header.b=RqsdNJSU; arc=pass (i=1 spf=pass spfdomain=concurrent-rt.com dkim=pass dkdomain=concurrent-rt.com dmarc=pass fromdomain=concurrent-rt.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=concurrent-rt.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y23-20020a170902b49700b00180a7ff784csi22302498plr.360.2022.10.21.08.35.38; Fri, 21 Oct 2022 08:35:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bksv.onmicrosoft.com header.s=selector1-bksv-onmicrosoft-com header.b=RqsdNJSU; arc=pass (i=1 spf=pass spfdomain=concurrent-rt.com dkim=pass dkdomain=concurrent-rt.com dmarc=pass fromdomain=concurrent-rt.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=concurrent-rt.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbiJUPeh (ORCPT + 99 others); Fri, 21 Oct 2022 11:34:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbiJUPed (ORCPT ); Fri, 21 Oct 2022 11:34:33 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2135.outbound.protection.outlook.com [40.107.20.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FAB029815; Fri, 21 Oct 2022 08:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=deff8E3+n14d/ifocU8evORG/mv/i+ggXvqyHK0D9b7kHqoxPIuFWC86+lKJ3CpVFFXydc8zY1eCtl/bnwtsrnW7VBqh1P5/vvNyNX4APd0SL/egDjq0wPS908pAEKRsfJwBut1+5pNgSc5F7e2vz1eVc8W6HYxYV7BbjCBqw1U1km5f58jLkBEg6DuvFJ/CHkXJRhftXPvmGzHO+L1TYyLoue9NbcNVocse+MfaryFXEQRA+IqFBvGDD4okaeva6NZr7A31lUuErN2C8uABtzk9qRjP0mb5kBCwnsRoI8451fqKA3Rk5TBQPjEHFamrmx07HY+a30FcyZH703Nwjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6IR26zvGQfYXSBKJCweO48Zc6askbHt7qx2j8/ElUvU=; b=i0BuBY0XzvPECjFWBdF1hDemk0FUbJjZvdH5IkuCdXRyUrmMOgQJslWjGYBM0x4GbzkT0Zemhd0mpnJTidRfoMCxxrHlc/veWuB5H08bvkEJzbZ5Ckc6gkmnHW8KU2NDfksIUTYgCIzOyCd4P8SgCz+zCL30GqMfSgZH6yG+kDc/f5vA7FsvipTORYU3iHX7vF5QJoh/bf+hcye4fudTvdYtiq9RwH8U8Bci2voxtdjBnhaZIZpdI2aC7zZiahycU7H2pxRZWDE2tn6or5qBWy5RP3zpXZ/FrB+XOMR93oSnPnPhbpP95dmi4siEo1oNiq3MPwsJtN4am4r7wFiCHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=concurrent-rt.com; dmarc=pass action=none header.from=concurrent-rt.com; dkim=pass header.d=concurrent-rt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bksv.onmicrosoft.com; s=selector1-bksv-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6IR26zvGQfYXSBKJCweO48Zc6askbHt7qx2j8/ElUvU=; b=RqsdNJSUDUM2LU2nQnMKNpO999iKcsvw2RwGYnlIaNxQHqXcvJPqrPebP83VHm+eOgbiqwOL5lFe4F9zc7LwpGTe4p8sO8kJ88GXdORCSVULFv+JtoEdO9YWZRtos86NSeLy7aGu/Pq2pjPwToU1lJoq4i1hgTgWzUplOEjC89g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=concurrent-rt.com; Received: from DB8PR09MB3580.eurprd09.prod.outlook.com (2603:10a6:10:119::23) by AS2PR09MB6079.eurprd09.prod.outlook.com (2603:10a6:20b:55a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.35; Fri, 21 Oct 2022 15:34:29 +0000 Received: from DB8PR09MB3580.eurprd09.prod.outlook.com ([fe80::c48e:11a3:c89c:f655]) by DB8PR09MB3580.eurprd09.prod.outlook.com ([fe80::c48e:11a3:c89c:f655%7]) with mapi id 15.20.5723.033; Fri, 21 Oct 2022 15:34:29 +0000 Date: Fri, 21 Oct 2022 11:34:24 -0400 From: Joe Korty To: Marc Zyngier Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] arm64: arch_timer: XGene-1 has 31 bit, not 32 bit, arch timer. Message-ID: <20221021153424.GA25677@zipoli.concurrent-rt.com> Reply-To: Joe Korty Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-ClientProxiedBy: BN9PR03CA0236.namprd03.prod.outlook.com (2603:10b6:408:f8::31) To DB8PR09MB3580.eurprd09.prod.outlook.com (2603:10a6:10:119::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8PR09MB3580:EE_|AS2PR09MB6079:EE_ X-MS-Office365-Filtering-Correlation-Id: c05c053d-a16d-4c7d-4543-08dab379be79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G1Fo3kQHUzc7QNODtDfr9cAXAZ8BAQDkcYqqq1J3sAM4IsaP9QN4nnEcZkHQL4ca41FeTOPlImlXYB/3ijPSQd9eKQ+iUZ0KZylsJIdhqei9D+kMKi8hqvy1U2Um3F7lXCSZbpJTYJI0jbnaLbmUEmj+KYzZwDH0nrb15exSmLa5zbvtQd3Xt8sJWrEsTli4rQHve06Q6AmOT6/V8kw5nPaa7tOik/W40kUXvdNdRW3KSHAUhaX+k/6/+8PmuKt3qqU2NtDdvfIHEZ+GyZA6xWeY2PYskwZrUyWJhN3yoSxPHn7pSJjl3xX0x6XY9ltZyZBymmNr8wje+RZhPFrRyeON7bFMoVmFMmosLrQnZembXTT/RGCe406OFgG+bw3qYvG2GGQprKM+pEhbvRDRD1S9eLzJexbd1lvY7AVyfsgUDxuuMcgFWMmINAilFUG6W7uL5++CE22EcT4rK7VxABvZe6PLpo3lMhy7ct2gvb0Yy545Ti/Kb67a/+a+sqwEFyWXG74R0UHxil6gzeSOpGtczVfrit57HtbKR7Ni6cYPAH4QPnU6qsaVxCv14jAPbmnEu0GqSjoSxK3zWYZl3bUSYKCxc8v/KVdtjRCN0cD783+SjevmEvsWtrjvcX8OBkC1DFKrdpIPc0SeM5BEFbGbjcxMUH/SJRXl83qsr+HhTPCHEE7lGCeHso43SRnnk5MwhOyJ2PkR6OwhQ5pk/0V38SyZlSOgeKOjtSpI4rTgiYz6ayQEDTpZnJj3A0lsmHsaGkffjun8X5B8AdtGpg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR09MB3580.eurprd09.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39850400004)(376002)(346002)(366004)(396003)(136003)(451199015)(6916009)(478600001)(316002)(6666004)(6506007)(6486002)(66946007)(66476007)(66556008)(4326008)(8676002)(3450700001)(41300700001)(8936002)(6512007)(1076003)(26005)(2906002)(52116002)(186003)(5660300002)(44832011)(83380400001)(38100700002)(38350700002)(86362001)(33656002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hw3Y8t1OsW5eg1p50x96xJCDx8uWqUoWSy3huFbfsA5zxGmvXQBOLFikZJANNYlMVLoh0yCzQFnWbXs58kMKwTg85Y6W/ODEgRS3Dd5wtuydO8jnBhDC2hjg7FyGgDNpAS2NLn0ziQJQttAO/1FBTheE2Dg2w8EpiUH9RoDmlNULduxaQMtO46IhCSSnnIwT9mgf3gApuF/g9puu38zSghRFg09bKjP9+gmcQQFm68TVfvDDGaqK8PPrp9TPfKpPLeutgMEmy2UgJVKuL2UAokNer22CIRmcVLTigEihna4NLOF2L6EJWf1U6tMfp5oClC2eWanh2oaa115LoI+mtXXc4DWJOCEZSF2jLPN7tzDqisTlbmn5sKyAOvvOeBR5jJsWMm5kO6tleMUFFERe0/XF3VgGTdOkTWc8ocy2Xgd+vg2wo0nmhlYTXDbWVwG7+iifc6nAHgB1K5rs2oWEz7M8XY4+1CDLo4osTrV3RB3VKRM04ifWg/mpdIRi7Vvj1AkOGtKBkv9wXXtp2yz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FLpTvRw== X-OriginatorOrg: concurrent-rt.com X-MS-Exchange-CrossTenant-Network-Message-Id: c05c053d-a16d-4c7d-4543-08dab379be79 X-MS-Exchange-CrossTenant-AuthSource: DB8PR09MB3580.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 15:34:29.5160 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6cce74a3-3975-45e0-9893-b072988b30b6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Trsj/awzwBjkABz8ZT6mzhBFWMBmXgLpQlUJB39alDXojWgvM73W6EQ9YsfQ6vE9HjDstoN78OFGOj47lTVoOaxLXm4a/DLPYO3EiM78k7o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR09MB6079 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747311974944178696?= X-GMAIL-MSGID: =?utf-8?q?1747311974944178696?= arm64: XGene-1 has a 31 bit, not a 32 bit, arch timer. Fixes: 012f188504528b8cb32f441ac3bd9ea2eba39c9e ("clocksource/drivers/arm_arch_timer: Work around broken CVAL implementations") Testing: On an 8-cpu Mustang, the following sequence no longer locks up the system: echo 0 >/proc/sys/kernel/watchdog for i in {0..7}; do taskset -c $i echo hi there $i; done Stable: To be applied to 5.16 and above, once accepted by mainline. Signed-off-by: Joe Korty Index: b/drivers/clocksource/arm_arch_timer.c =================================================================== --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -805,7 +805,7 @@ static u64 __arch_timer_check_delta(void const struct midr_range broken_cval_midrs[] = { /* * XGene-1 implements CVAL in terms of TVAL, meaning - * that the maximum timer range is 32bit. Shame on them. + * that the maximum timer range is 31bit. Shame on them. */ MIDR_ALL_VERSIONS(MIDR_CPU_MODEL(ARM_CPU_IMP_APM, APM_CPU_PART_POTENZA)), @@ -813,8 +813,8 @@ static u64 __arch_timer_check_delta(void }; if (is_midr_in_range_list(read_cpuid_id(), broken_cval_midrs)) { - pr_warn_once("Broken CNTx_CVAL_EL1, limiting width to 32bits"); - return CLOCKSOURCE_MASK(32); + pr_warn_once("Broken CNTx_CVAL_EL1, limiting width to 31bits"); + return CLOCKSOURCE_MASK(31); } #endif return CLOCKSOURCE_MASK(arch_counter_get_width());