All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wim Van Sebroeck <wim@linux-watchdog.org>
To: Darren Hart <darren@os.amperecomputing.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	linux-kernel@vger.kernel.org,
	Vanshidhar Konda <vanshikonda@os.amperecomputing.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	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
Date: Sun, 29 Oct 2023 16:53:06 +0100	[thread overview]
Message-ID: <20231029155306.GA5887@www.linux-watchdog.org> (raw)
In-Reply-To: <ZTqfQJiEMRD0Xc9S@Fedora>

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 <vanshikonda@os.amperecomputing.com>
> > > > > Signed-off-by: Darren Hart <darren@os.amperecomputing.com>
> > > > > Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
> > > > > Cc: Guenter Roeck <linux@roeck-us.net>
> > > > > Cc: linux-watchdog@vger.kernel.org
> > > > > Cc: linux-kernel@vger.kernel.org
> > > > > Cc: linux-arm-kernel@lists.infradead.org
> > > > > Cc: <stable@vger.kernel.org> # 5.14.x
> > > > 
> > > > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > > 
> > > 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.


WARNING: multiple messages have this Message-ID (diff)
From: Wim Van Sebroeck <wim@linux-watchdog.org>
To: Darren Hart <darren@os.amperecomputing.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	linux-kernel@vger.kernel.org,
	Vanshidhar Konda <vanshikonda@os.amperecomputing.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	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
Date: Sun, 29 Oct 2023 16:53:06 +0100	[thread overview]
Message-ID: <20231029155306.GA5887@www.linux-watchdog.org> (raw)
In-Reply-To: <ZTqfQJiEMRD0Xc9S@Fedora>

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 <vanshikonda@os.amperecomputing.com>
> > > > > Signed-off-by: Darren Hart <darren@os.amperecomputing.com>
> > > > > Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
> > > > > Cc: Guenter Roeck <linux@roeck-us.net>
> > > > > Cc: linux-watchdog@vger.kernel.org
> > > > > Cc: linux-kernel@vger.kernel.org
> > > > > Cc: linux-arm-kernel@lists.infradead.org
> > > > > Cc: <stable@vger.kernel.org> # 5.14.x
> > > > 
> > > > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > > 
> > > 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

  reply	other threads:[~2023-10-29 16:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21  9:02 [PATCH] sbsa_gwdt: Calculate timeout with 64-bit math Darren Hart
2023-09-21  9:02 ` Darren Hart
2023-09-26 12:45 ` Guenter Roeck
2023-09-26 12:45   ` Guenter Roeck
2023-10-14  9:12   ` Darren Hart
2023-10-14  9:12     ` Darren Hart
2023-10-22 16:58     ` Guenter Roeck
2023-10-22 16:58       ` Guenter Roeck
2023-10-26 17:17       ` Darren Hart
2023-10-26 17:17         ` Darren Hart
2023-10-29 15:53         ` Wim Van Sebroeck [this message]
2023-10-29 15:53           ` Wim Van Sebroeck
2023-10-29 16:10       ` Wim Van Sebroeck
2023-10-29 16:10         ` Wim Van Sebroeck
2023-10-29 17:00         ` Guenter Roeck
2023-10-29 17:00           ` Guenter Roeck
2023-10-30 16:21           ` Darren Hart
2023-10-30 16:21             ` Darren Hart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231029155306.GA5887@www.linux-watchdog.org \
    --to=wim@linux-watchdog.org \
    --cc=darren@os.amperecomputing.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=stable@vger.kernel.org \
    --cc=vanshikonda@os.amperecomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.