Repository navigation
media: pwm-ir-tx: Correct timer calculation - #7680
Conversation
|
Draft PR for reporter to test. |
|
@t-8ch - I think this wants fixing upstream. |
Yes, agreed. @6by9 Can you submit this upstream? Maybe it should change to this: } while (hrtimer_get_expires(timer) < hrtimer_cb_get_time(timer));This is closer to the original logic and IMO easier to understand. |
|
Yup, happy to submit it upstream, making your suggested change first. I'll update this PR too so hopefully we'll avoid merge conflicts when it does merge back through stable. |
Commit 44d7fb8 ("media: pwm-ir-tx: Avoid direct access to hrtimer clockbase") converted a loop conditional from now = timer->base->get_time(); } while (hrtimer_get_expires_tv64(timer) < now); to while (hrtimer_expires_remaining(timer) > 0); hrtimer_expires_remaining returns (expires - now), so the change has inverted the condition. Convert back to follow the original pattern, but using the proper API call. Fixes: 44d7fb8 ("media: pwm-ir-tx: Avoid direct access to hrtimer clockbase") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
PR updated based on suggested option. |
|
Tested by the original reporter and confirmed working Sent upstream - https://lore.kernel.org/linux-media/20261014-media-rc-pwm-ir-tx-v1-1-1ae862427fd2@raspberrypi.com/T/#u Merging here. |
Commit 44d7fb8 ("media: pwm-ir-tx: Avoid direct access to hrtimer clockbase") converted a loop conditional from
now = timer->base->get_time();
} while (hrtimer_get_expires_tv64(timer) < now);
to
while (hrtimer_expires_remaining(timer) > 0);
hrtimer_expires_remaining returns (expires - now), so the change has inverted the condition.
Correct the > to < to restore the old behaviour
#7678
Fixes: 44d7fb8 ("media: pwm-ir-tx: Avoid direct access to hrtimer clockbase")