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)
Sat, Nov 23, 1:44 PM
Unknown Object (File)
Fri, Nov 22, 5:51 AM
Unknown Object (File)
Thu, Nov 7, 5:35 PM
Unknown Object (File)
Oct 21 2024, 8:38 AM
Unknown Object (File)
Sep 23 2024, 4:39 PM
Unknown Object (File)
Sep 23 2024, 4:20 PM
Unknown Object (File)
Sep 22 2024, 7:57 AM
Unknown Object (File)
Sep 22 2024, 4:16 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.