Page MenuHomeFreeBSD

Drop Giant before sleeping in linux_wait_for_timeout_common().
ClosedPublic

Authored by markj on Apr 17 2017, 10:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 8 2024, 12:42 AM
Unknown Object (File)
Jan 26 2024, 5:52 PM
Unknown Object (File)
Dec 23 2023, 10:52 AM
Unknown Object (File)
Dec 22 2023, 10:18 PM
Unknown Object (File)
Dec 17 2023, 12:13 AM
Unknown Object (File)
Dec 15 2023, 7:41 AM
Unknown Object (File)
Aug 17 2023, 11:15 PM
Unknown Object (File)
Jan 10 2023, 7:06 AM
Subscribers
None

Details

Summary

We may get here with Giant held during an ACPI resume.

Sleep routines are supposed to drop Giant before relinquishing
the CPU. _sleep() handles this, but the LinuxKPI calls the sleepqueue
functions directly.

Test Plan

Pete Wright reported a panic during resume that was addressed
by this patch.

Diff Detail

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

Event Timeline

markj edited the test plan for this revision. (Show Details)
markj added a reviewer: hselasky.
This revision is now accepted and ready to land.Apr 18 2017, 7:06 AM

Was it investigated if there are missing DROP/PICKUP GIANT macros in the pci resume / suspend device methods?

Was it investigated if there are missing DROP/PICKUP GIANT macros in the pci resume / suspend device methods?

Yes, I looked through a number of existing device suspend/resume methods and did not find any special handling for Giant.

Can this issue also be fixed by dropping / picking up giant in the suspend/resume device methods? The other device methods, attach, probe, shutdown already do this.

--HPS

Can this issue also be fixed by dropping / picking up giant in the suspend/resume device methods? The other device methods, attach, probe, shutdown already do this.

Presumably yes, but I'm not familiar with the newbus locking protocol. It seemed preferable to change the sleep code since it must drop Giant anyway to be correct, and I suspect that the existing methods drop Giant just to cover up this problem.

I hadn't noticed that the other methods in linux_pci.c drop Giant. I'll try removing those DROP/PICKUP_GIANT calls and see if any problems arise with this patch applied.

markj edited edge metadata.

Fix linux_wait_for_common() as well.

This revision now requires review to proceed.Apr 18 2017, 6:07 PM

I didn't observe any problems after removing the DROP/PICKUP_GIANT calls in the linuxkpi pci device methods, so I'm not sure what problem they solve.

This revision was automatically updated to reflect the committed changes.