Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2291132rdh; Sun, 29 Oct 2023 09:05:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9K4uSUR7V3l8NlHJQEkb9y6FiSPtBBypXPrgOCNZtv1CBVrcLHHVSVTeFMm7+lM8YxbrG X-Received: by 2002:a05:6a20:a483:b0:137:74f8:62ee with SMTP id y3-20020a056a20a48300b0013774f862eemr7632440pzk.18.1698595526852; Sun, 29 Oct 2023 09:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698595526; cv=none; d=google.com; s=arc-20160816; b=jEe0ezqfJHw+HQ/WOZTQeY0RCRF4d1j1xl8qqF/uY8CBS95DkJHy5GShKoifZ0nHyc Ao66c50PxahHZN46x03NGG2+DqitJcEBJzRyxcQ2BPZDOlpmC3yd5QC5KDEvF3nmXFKy px36LWXkOntcMyE/0xhDpS6fAToPHv9r8prAk7bt0QClDZsVEVMU/evZSr4u3+jjtwkr gvrP2lTzxfwCbAZjwTpLpSZX9gXIPuCmC9HwY/MGUhMgr6UCkDBjtYkTDAni+JHPLPBL Kc34bp81JP7Zb8Jric/T2M8TIgD3+LIXpwIjoMbtyQ3ZVvVRs8Bgp/rpLFcnU7P/WfsX cw/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=tzj07BfTq1274A/gR+8TEu5msRuCJbUGm2e9xLx0xIg=; fh=99pI/It7KNuedITB9nYjI+XEQXxSxy/MSUxE6R7n5Tg=; b=CfUfstmpQd3Ql5GNnBYvK39ugUAKPLLzlLW0QOyJ66nOQvoQN0X9D2cLKq2kKGrwCa VCGbOOS2IiJ11FS64m/8GYtIfwWJwTvAmvy8hGHdgKqLW98R6dGxrQp1ZOSJLWgfL2zE 2IqNYudKzkdfLBTYrhqDcldfNOMG7zxLZvhz00G24yxCq+J3sXuAw2/x9yjhKK6TZvkA h5Pu5ZTgJbGpzoA8MCyQkQT+C8YpTvif4pTyNrx5O35zAurJYgtKdL1om4fKxolwWXY4 1mKV7CRcj7Zi4OiW8yKa1qCnwok3JN4Pe7EJgTYmK5lp1DSu1/uXE6020+3ckZjXzMU4 YNDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-watchdog.org header.s=odk20180602 header.b=NfHfnPJx; 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=REJECT sp=REJECT dis=NONE) header.from=linux-watchdog.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b18-20020a056a000cd200b006bd66ce21d9si3795028pfv.322.2023.10.29.09.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 09:05:26 -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=@linux-watchdog.org header.s=odk20180602 header.b=NfHfnPJx; 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=REJECT sp=REJECT dis=NONE) header.from=linux-watchdog.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5B54F8061CE3; Sun, 29 Oct 2023 09:05:24 -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 S229689AbjJ2QFC (ORCPT + 99 others); Sun, 29 Oct 2023 12:05:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjJ2QFB (ORCPT ); Sun, 29 Oct 2023 12:05:01 -0400 X-Greylist: delayed 325 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 29 Oct 2023 09:04:58 PDT Received: from www.linux-watchdog.org (www.linux-watchdog.org [185.87.125.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B6CD8AC; Sun, 29 Oct 2023 09:04:58 -0700 (PDT) Received: by www.linux-watchdog.org (Postfix, from userid 500) id ABF7240A00; Sun, 29 Oct 2023 16:53:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 www.linux-watchdog.org ABF7240A00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-watchdog.org; s=odk20180602; t=1698594786; bh=vjgtNdp09F9UOhfV3Gr3oRE9ICiZm0+VKnTWsGj5CNg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NfHfnPJx9JODnaKZyjSqjaZqEAb+QUTye1x5oBuiQtUORKX7RM5+izy5mS45KnJOW MzUCsKDaVAa893gJ1jMTi6y1VD52OwfK7kNcyrDMMVJor8AcaHaISMva12E1zRyKRB Xi1mCSjl468uIluNw/xHcYcY547LT0cWmQE44fhU= Date: Sun, 29 Oct 2023 16:53:06 +0100 From: Wim Van Sebroeck To: Darren Hart Cc: Guenter Roeck , 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: <20231029155306.GA5887@www.linux-watchdog.org> References: <7d1713c5ffab19b0f3de796d82df19e8b1f340de.1695286124.git.darren@os.amperecomputing.com> <1fae4d2c-4bc7-f169-7b84-501674a82ee4@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) 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]); Sun, 29 Oct 2023 09:05:24 -0700 (PDT) Hi Darren, > 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? I'm picking this one up right now. So no need to ask it to the Arm maintainers. Kind regards, Wim.