Page MenuHomeFreeBSD

Fix hrtimer_active() in case of cancelllation.
ClosedPublic

Authored by mav on Aug 6 2017, 11:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 26 2024, 6:49 AM
Unknown Object (File)
Mar 18 2024, 11:02 AM
Unknown Object (File)
Feb 10 2024, 9:25 PM
Unknown Object (File)
Feb 3 2024, 9:41 PM
Unknown Object (File)
Jan 12 2024, 10:03 AM
Unknown Object (File)
Dec 20 2023, 1:44 AM
Unknown Object (File)
Dec 20 2023, 12:19 AM
Unknown Object (File)
Sep 18 2023, 8:28 PM
Subscribers

Details

Summary

While trying drm-next suspend on Skylake I found it complaining "Timed out waiting for forcewake timers to finish". Investigation shown that hrtimer_active() return false positive after hrtimer_cancel() was used.

My patch fixes that bug while also switching to FreeBSD internal active status. If there is some good reason to use external flag please explain it to me, for which case I have alternative patch.

Test Plan

drm-next code no longer complains about this during suspend.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/compat/linuxkpi/common/src/linux_hrtimer.c
58 ↗(On Diff #31666)

Can you upload patch with full context?

What locks are protecting callout_active() ?

sys/compat/linuxkpi/common/src/linux_hrtimer.c
58 ↗(On Diff #31666)

Uploaded.

What do you mean by "what locks"? According to man page it is protected by user lock, in this case -- hrtimer->mtx. But some cases seem also covered by callout internal lock.

I can't quite remember why I made the flag external. I might have forgotten about the existence of the callout_deactivate() KPI.

Thanks for fixing this.

This revision is now accepted and ready to land.Aug 6 2017, 4:39 PM

Looks good. Please add a comment describing the return value of hrtimer_cancel() before commit.

sys/compat/linuxkpi/common/src/linux_hrtimer.c
64 ↗(On Diff #31669)

Can you add a comment above this function describing the return values.

This revision was automatically updated to reflect the committed changes.