Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp613922rdh; Thu, 26 Oct 2023 10:44:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5PomnRS6JoPMVsHtMAvypeWbykY0ahPoFFQvaSqo50aGm0PSKalNs5wRU41vZ3rZ+qFUl X-Received: by 2002:a81:ad4e:0:b0:5a7:af1f:62fc with SMTP id l14-20020a81ad4e000000b005a7af1f62fcmr175032ywk.19.1698342241387; Thu, 26 Oct 2023 10:44:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698342241; cv=pass; d=google.com; s=arc-20160816; b=quMAu0ReLoO0taJ4bzrVJ+WbQA411hnUwVnsNGophLcW9iuQpGTBlAhiPQiZ1JgF6m WhKZpAmnv9JjuhPjQkUR6Ms6OCDegylwn/9V6RNKbL4A591S7Tc+g6VBPeCF7YoU3jCz kljalSY6s2F43aoIYLPJ5rOVeN0KhCYUWelQHhDlmE0z4rSY8M+4sVBxuRP3AVI4AXGs XC2duW4oA7/z06ficULvn7KESGESRSEk2lHH5/UgTd8MuA6lAqVE9ehuyNjODvDaM5UX ctigJ4WtIWbIhs5RvHGsCATKb5oitW595nwc9CPbH1G1N2tuXldO0v5C5FKfkz5PLlf8 MWhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=p/THWklT+fPIR5nd89Ul1wo6gmCDIC7GU2c2afx5BkI=; fh=fXfMPAssBlboSmJbBeHqVChI0/ANU+eGaqoWgA/HFNs=; b=cJQUwVn2ULZ1QPnEQkmeKOcv+M0AWMjl64Fcri4Lz4JR68MZIc0LVgaMC6/7FrPn0i eRcoqAXIYHJFyFB2MVd4I0jWw5R7lJC9DLoJ2XwVxpPsHSqkzJnSOzXm2tix2pQZNrY8 iF8BxbWvnBo5YZjrOqmiWCdu2qGNDKDvWWTYWgF5+qjEPBhk+mZman67RGbUB5ZjlII8 suf3i9CGPIsuu17Qa+RRw5QTjdrcVqE7LoBBBR+4aF6xy/u5lXaNGXAnd+fhZOoYwCqw NA0CTPje9zxAWyYeYaUM4SKZH/ErilEHH+vxJO2eNl+ZHrKBQ5nAUNYoHxPM9Vdzrq1F cPuA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=ZAvaJNQ4; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k2-20020a0dfa02000000b0059232b5f170si14952158ywf.382.2023.10.26.10.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 10:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=ZAvaJNQ4; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B8EC6828C49C; Thu, 26 Oct 2023 10:43:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231842AbjJZRnr (ORCPT + 99 others); Thu, 26 Oct 2023 13:43:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231841AbjJZRnp (ORCPT ); Thu, 26 Oct 2023 13:43:45 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2112.outbound.protection.outlook.com [40.107.92.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 636B590; Thu, 26 Oct 2023 10:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ndg1C7yG5dnrqYJ0f4tN1TdL0xO8ywl2zI9VwegP7C19dmTHKKRkxRyLBV8ii31YwNrDjxPs2MI1SbrIkgVGZyGbFCg1BDyi5hjtpK+2RYTSX8fNdVmwry4Dc4IItvR/PbDjoJO9eDAaP8U+wD0UJymOWvJNxcYAbsyXhrw8varLUDCEjfODOBxKWnCwbmeMMFVAzTuq+LPsN9M5/jfEc6mS5baJigm/1ggbdYoODYBBqeTeXvX2H6zalrD9muBS41kIyvVHrFLKYLU4imOdmzscLZNJpNcS3oifPQpcyeKOdLbnUPfqQfdbEDOTt2YMP4iLiCfgJJ+Ed31wkHjocQ== 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=p/THWklT+fPIR5nd89Ul1wo6gmCDIC7GU2c2afx5BkI=; b=G98+gki9tLyvhXABVPVcAdmX5MmmLuPro3300M4ltlOsa6YAIEt0QPAM2lK3+tGEbN2oF5z+KY57aUQUG5QaywjpdkHNw2+z5xA6SK+UnHO4Wr+djLU1q3PqzFfOHy5nC8+AoNZWnwPnrW1e+Amyfl8DTzsW6x+VdSdy5qKWANUtHsYfp32RV4wcWohRFpyb5hvaTIESxfr2TIJP89cStiRX5njqxXsJKpPCyWYFPd8IydeCknyfAyz6xslVUqa1OewmZRiRLeBgk/HfYyJg1hhqYUGK3q2qnvAI6dfBlvIGbbsZOdHv4Dcgsj3lO/uFN/FfuxG3zNRu7+eKPn3n4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p/THWklT+fPIR5nd89Ul1wo6gmCDIC7GU2c2afx5BkI=; b=ZAvaJNQ4kn7wsvKueF6VPScPlZS5+AYs2xGN0a4d9JbJdSOmqH3x8UzjJvjL8qWYE2/KpHlqWO3SK0q2PFcdY39kdlyn7GMy6M+zakijnL1LzLgqeCCyjlKDjcGnAdy8ugss9jRDdE6TVGcNrH7IzjWcUjf+6eO80+zBs4nWfRo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB6795.prod.exchangelabs.com (2603:10b6:510:91::18) by SJ0PR01MB6462.prod.exchangelabs.com (2603:10b6:a03:29f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29; Thu, 26 Oct 2023 17:43:38 +0000 Received: from PH0PR01MB6795.prod.exchangelabs.com ([fe80::9da1:e537:76d7:8a52]) by PH0PR01MB6795.prod.exchangelabs.com ([fe80::9da1:e537:76d7:8a52%5]) with mapi id 15.20.6907.032; Thu, 26 Oct 2023 17:43:38 +0000 Date: Thu, 26 Oct 2023 10:17:52 -0700 From: Darren Hart To: Guenter Roeck Cc: linux-kernel@vger.kernel.org, Vanshidhar Konda , Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH] sbsa_gwdt: Calculate timeout with 64-bit math Message-ID: References: <7d1713c5ffab19b0f3de796d82df19e8b1f340de.1695286124.git.darren@os.amperecomputing.com> <1fae4d2c-4bc7-f169-7b84-501674a82ee4@roeck-us.net> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1fae4d2c-4bc7-f169-7b84-501674a82ee4@roeck-us.net> X-ClientProxiedBy: CH0PR03CA0091.namprd03.prod.outlook.com (2603:10b6:610:cd::6) To PH0PR01MB6795.prod.exchangelabs.com (2603:10b6:510:91::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB6795:EE_|SJ0PR01MB6462:EE_ X-MS-Office365-Filtering-Correlation-Id: c42e0860-c29a-4b34-8cba-08dbd64b1561 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0WGu2PbyMtd5z3ttwE9JDPYYUXJU4WkNckfjlr1aUFKcyYxZ6We2bOiwDwqtla/hQ8zCPscFMnzwsBF3H63VU9PJOkaEhMK9ZNcuVjEGWnA+t5x0llXHzmbx7Rf+EU0rRHsinQ7VlHTwKxiV8guAozaRiX6g8g7Zxi/2IOZI7KCPlRmN9AM4QGyfGrhHQNuKkMndIwRXoFLnlnjojkSyHI6oryKRrR33gSg0ViBKdNqgpDMuDIMwENvGdU00fn1+ee2bP+/l5uNxsMhU5oZnC4XrTmozvKYaV45tTOCpTP2mi40X5m216ztz3Ons5C5PpfwP/5Toe8iJ7AcaPHIbqPMzQorM8rbumSe5j4YuzIP0v+ZG7DVF5TvqES3ps07bqNtgFDglNC60IKRM5s8REnuhS735F5SyLmABKuEo0VEiDejDhWglGqZEWt8/2AVdA9Y+QRqWOyaxcBONg/boTZq1xeKlVMNgoHb2ukXE3xCtYe+jfWPCPTXsd6zwOVyxLLONUAB/N94ARuoz91oLUSQURJBbw3XcnxcAi+F1lCNak8xpKj6bj590rihALal4PsRYfZXP9B5XKZF9j8U958NO5xe4ONc5KncB9eljn1QV3jqE/3nw96j9jR+Mb5pm X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6795.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(39850400004)(366004)(346002)(376002)(136003)(396003)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(33716001)(26005)(66899024)(38100700002)(2906002)(41300700001)(5660300002)(86362001)(4326008)(316002)(8936002)(8676002)(38350700005)(478600001)(6506007)(66946007)(9686003)(66476007)(66556008)(6916009)(54906003)(83380400001)(53546011)(6486002)(52116002)(6512007)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7DiB6cPTr+lbmBaLcXfykX2DZaCRbg3zmc2mMiUvygO0m+Z9JIvqh2GijFhX?= =?us-ascii?Q?ZwJ4L4B668be4uS6TSVlTZ4Dp9IONDcF3f9OOKKzDlnW9rZGPaC6fEYCScgH?= =?us-ascii?Q?zxSUdLeIYFs+PuQeC7letsYHN+G40rH4K/xelp3UZhzBoUT4ixyKMpVbPmyR?= =?us-ascii?Q?nPW2wIH/pYTZEpvRtY8IHXO6hF7aWHakL/zcCb51W9yIgmzZ6UfsWZ/VLaiw?= =?us-ascii?Q?u1utkaN9rY/seXFsvXimUlOOt2OKgkvtQfGUMa+MXbaDyjhzyJGSvsBY0ntk?= =?us-ascii?Q?fErqHNMY5utZP2+WwdpYYYTZ+7/30ycMfMYc9leMXpN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rBcvTWGd3J9gOSdnyMcZhiKxy9KYKtsZr/uH6tOaRH0a3J?= =?us-ascii?Q?FQHj3yrXWusbtEMMjeNbBySRjJIdW8ske/pOxZ89pHoEmXDYRp51ZhEzi7BI?= =?us-ascii?Q?atjqxQ5C2abgd9qZAhFuTkAxuERBPxRln/IizqKdPWeYYdJ1heDzrbDhy+yR?= =?us-ascii?Q?clxtt1Ef2bEmOa0sXsTdcwgBfBnfs/ltEJ4NcbOdgBTu7sOyxZMAZalk1/HX?= =?us-ascii?Q?VRTZRytKTPdcVD+HiEBXNNa5nVlJNY3hB3Mq0NwT8sk5qjNn82CJ+rd1c+ZH?= =?us-ascii?Q?rQ5MIlj3V7RGKDDN1T5A1KL2C4hjNoPT9cv0xIy7aOpGOEUy4sw5fksRx6IC?= =?us-ascii?Q?dA4A1Jc9u0HHRO1aCcEdwXMiDpH/g2thBgIyEU4/8Uq1/hMVD9+gPNNj7VEk?= =?us-ascii?Q?0cWRdk0xB7jIvrfOgFRYJFY=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c42e0860-c29a-4b34-8cba-08dbd64b1561 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6795.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2023 17:43:38.0538 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FgbOBQetg3Eh490i58pr2IplIlhbWcjw5LCaKI6xS0DFXHQIt/F6nfti8xMYwZ4e+tUcj6DtOAYfoMnqUjnPbmeBFLkkoEHoYOlvJN+Y9z9TIbZvzSMuAemlXoWMYDls X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6462 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 26 Oct 2023 10:43:58 -0700 (PDT) On Sun, Oct 22, 2023 at 09:58:26AM -0700, Guenter Roeck wrote: > On 10/14/23 02:12, Darren Hart wrote: > > On Tue, Sep 26, 2023 at 05:45:13AM -0700, Guenter Roeck wrote: > > > On Thu, Sep 21, 2023 at 02:02:36AM -0700, Darren Hart wrote: > > > > Commit abd3ac7902fb ("watchdog: sbsa: Support architecture version 1") > > > > introduced new timer math for watchdog revision 1 with the 48 bit offset > > > > register. > > > > > > > > The gwdt->clk and timeout are u32, but the argument being calculated is > > > > u64. Without a cast, the compiler performs u32 operations, truncating > > > > intermediate steps, resulting in incorrect values. > > > > > > > > A watchdog revision 1 implementation with a gwdt->clk of 1GHz and a > > > > timeout of 600s writes 3647256576 to the one shot watchdog instead of > > > > 300000000000, resulting in the watchdog firing in 3.6s instead of 600s. > > > > > > > > Force u64 math by casting the first argument (gwdt->clk) as a u64. Make > > > > the order of operations explicit with parenthesis. > > > > > > > > Fixes: abd3ac7902fb ("watchdog: sbsa: Support architecture version 1") > > > > Reported-by: Vanshidhar Konda > > > > Signed-off-by: Darren Hart > > > > Cc: Wim Van Sebroeck > > > > Cc: Guenter Roeck > > > > Cc: linux-watchdog@vger.kernel.org > > > > Cc: linux-kernel@vger.kernel.org > > > > Cc: linux-arm-kernel@lists.infradead.org > > > > Cc: # 5.14.x > > > > > > Reviewed-by: Guenter Roeck > > > > Guenter or Wim, I haven't seen this land in the RCs or in next yet. Have > > you already picked it up? Anything more needed from me? > > > > Thanks, > > > > Sorry, I am suffering from what I can only describe as a severe case of > maintainer/reviewer PTSD, and I have yet to find a way of dealing with that. > I'm sorry to hear it Guenter, it can be a thankless slog of a treadmill sometimes. I found having a co-maintainer a huge help to even out the human factors while maintaining the x86 platform drivers (in the before times). In the short term, should I ask if one of the Arm maintainers would be willing to pick this patch up? Thanks, -- Darren Hart Ampere Computing / Linux Enabling