From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBD07C4332F for ; Sun, 29 Oct 2023 16:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d2kZiv9qxvDRueAzc4HtYYrpLiby//S5nrwyGWF9GOM=; b=RCXB02hKQ+Ws3e wxxfXjeCC6/JLn5DOH3De7sjTi5PX0KFKkX3GZRW0rTYF609lURMV+aoMox67Mg8sL6J2Kokg1irX l5JzTSoXKgltfX9hxhGh36u8fNB1Zc3EWBJ9eSE+4dHlg/Qep1uoq3DsweTu5frIue/uXf8raJiTK RsQ/BAtzYuL5aaY/5v96iLJd5+bXsk3st1mQyaNDff6A/7vLFqsBYGjyCiW0sTgxlDYpOmO1f7nHY kltJ/bUV5AZXNqrQdBRxv/S4EUNz+RTx6AmqXozSKJby5AjVUQoXmr+sbh6ZZZPv7Tp0VF55qJyeD 2GCHtSDoWj/A1/c3tqWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qx8CS-001saH-28; Sun, 29 Oct 2023 15:59:40 +0000 Received: from www.linux-watchdog.org ([185.87.125.42]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qx8CP-001sZt-11 for linux-arm-kernel@lists.infradead.org; Sun, 29 Oct 2023 15:59:39 +0000 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231029_085937_847362_74C06DD0 X-CRM114-Status: GOOD ( 26.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel