Skip to contentSkip to conversation

APM driver patch summary

DISCUSSION Thomas Hood 2 participants 3 messages Dec 18, 2001 – Dec 19, 2001

lore
Share & tools
lore
#0 lore raw

Here is an updated list of the patches:

Notify listener of suspend before notifying driver (Russell King / me)
(appended)
Fix idle handling (Andreas Steinmetz)

    http://marc.theaimsgroup.com/?l=linux-kernel&m=100754277600661&w=2
Control apm idle calling by runtime parameter       (Andrej Borsenkow)
    http://marc.theaimsgroup.com/?l=linux-kernel&m=100852862320955&w=2
Detect failure to stop CPU on apm idle call         (Andrej Borsenkow)
    http://marc.theaimsgroup.com/?l=linux-kernel&m=100869841008117&w=2

I added the last one which was posted today.

I have modified Russell's patch to notify (of standbys & suspends) listeners before drivers. I made the following changes:

Return EBUSY instead of EIO (or EAGAIN) on rejection of request.
(Suggestion from apmd maintainer. Is this okay?)
Move "sti()" up a bit inside suspend() function. (Should be harmless.) Move "out:" after "queue_event" so that no RESUME event will be queued.
(Listeners should notice the EBUSY and undo whatever they did.)
Recode suspend() a bit to make it easier to read.
(Unfortunately this makes the patch harder to read.)
Skip actual suspend even if APM version is 0x100 (... just don't
try to set APM_STATE_REJECT. I don't see why this should be a problem, judging from a quick read of the APM spec).

The driver compiles with this patch, but I haven't tested it yet.

I still have one worry about the driver with this patch applied. If a user requests a suspend and it is rejected by a driver (and the APM version > 0x100) then APM_STATE_REJECT is sent to the BIOS. If the BIOS didn't generate the request then this REJECT is comes out of the blue. Is that acceptable, or should we refrain from sending such REJECTS when the suspend request didn't come from the BIOS?

--
Thomas

#1 lore raw
Quoted 1 line · Thomas Hood

Move "sti()" up a bit inside suspend() function. (Should be harmless.)

Doesn't guarantee that you'll keep interrupts disabled.

suspend() calls pm_send_all() which calls down() which might call schedule(), which I think you'll find will re-enable interrupts.

--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html