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)
Sat, Feb 22, 12:41 AM
Unknown Object (File)
Sat, Feb 22, 12:10 AM
Unknown Object (File)
Fri, Feb 21, 11:55 PM
Unknown Object (File)
Fri, Feb 21, 8:12 PM
Unknown Object (File)
Fri, Feb 21, 7:44 PM
Unknown Object (File)
Feb 6 2025, 2:15 AM
Unknown Object (File)
Feb 3 2025, 7:28 AM
Unknown Object (File)
Jan 18 2025, 3:42 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.