Re: [PATCH] watchdog: imx2_wdt: fix min() calculation in imx2_wdt_set_timeout
From: Rasmus Villemoes
Date: Mon Aug 26 2019 - 08:05:18 EST
On 12/08/2019 15.28, Guenter Roeck wrote:
> On 8/12/19 6:13 AM, Rasmus Villemoes wrote:
>> Converting from ms to s requires dividing by 1000, not multiplying. So
>> this is currently taking the smaller of new_timeout and 1.28e8,
>> i.e. effectively new_timeout.
>>
>> The driver knows what it set max_hw_heartbeat_ms to, so use that
>> value instead of doing a division at run-time.
>>
>> FWIW, this can easily be tested by booting into a busybox shell and
>> doing "watchdog -t 5 -T 130 /dev/watchdog" - without this patch, the
>> watchdog fires after 130&127 == 2 seconds.
>>
>> Fixes: b07e228eee69 "watchdog: imx2_wdt: Fix set_timeout for big
>> timeout values"
>> Cc: stable@xxxxxxxxxxxxxxx # 5.2 plus anything the above got
>> backported to
>> Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
>
> Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
I'm not seeing this in v5.3-rc6, did it get picked up?
Rasmus