From: David Balazic <david.balazic@uni-mb.si>
To: John Fremlin <chief@bandits.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-laptop@vger.kernel.org, apm@linuxcare.com.au,
apenwarr@worldvisions.ca, sfr@linuxcare.com.au
Subject: Re: kernel apm code
Date: Fri, 30 Mar 2001 12:20:28 +0200 [thread overview]
Message-ID: <3AC45DEC.4ABCC94B@uni-mb.si> (raw)
In-Reply-To: <3AC0A679.DFA9F74B@uni-mb.si> <"m28zlr58w9.fsf"@boreas.yi.org> <3AC1C406.652D0207@uni-mb.si> <"m2bsqmlyrh.fsf"@boreas.yi.org> <3AC2FF70.CA2317B6@uni-mb.si> <"m24rwcjziu.fsf"@boreas.yi.org>
John Fremlin wrote:
>
> David Balazic <david.balazic@uni-mb.si> writes:
>
> > John Fremlin wrote:
>
> [...]
>
> > > > To implement off-button you only need the APM_IOC_REJECT ioctl and
> > >
> > > The problem on my computer with my (re)implementation of
> > > APM_IOC_REJECT is that the screen goes into powersaving when the user
> > > suspend is received, then turns it back on when APM_IOC_REJECT is sent
> > > by apmd.
> >
> > What is wrong with that ?
>
> > Suspend is requested -> suspend is executed
>
> > Suspend is canceled (rejected) -> suspend is canceled
> >
> > Seems perfectly OK to me.
>
> The sequence is in fact: suspend requested by BIOS -> suspend accepted
> by kernel -> SUSPEND -> suspend rejected by apmd which is passed on by
> kernel to BIOS -> REJECT=RESUME (if I understand correctly, this is
> what seems to happen).
>
> Sequence should be as in pmpolicy patch: suspend requested by BIOS ->
> /sbin/powermanger decides to reject -> REJECT
AFAICT , the kernel does not accept(*) any APM_EVENT until all userspace
"listeners" say it is OK. So until apmd doesn't reply, the kernel does
not accept the SUSPEND. If apmd says OK, kernel says OK to BIOS and SUSPEND
is activated, but if apmd says NO-NO, then the kernel rejects the SUSPEND
request and "nothing happens"
This is of course with a proper implementation of REJECT functionality
in the kernel apm driver. I don't know if it behaves like this in the
current IOC_AOM_REJECT version, but it should :-)
* - by accept I mean : it receives a notification from BIOS and replies
OK to the BIOS. the BIOS doesn't change the powerstate until the kernel
responds with OK , IIRC
>
> [...]
>
> > > Anyway it is fixed in my pmpolicy patch, and I don't need no
> > > daemon so the code is a lot cleaner and simpler (no binary magic
> > > number interfaces).
> >
> > But there should be no policy in the kernel ! ;-)
>
> Read the patch. Read the webpage:
>
> http://john.snoop.dk/programs/linux/offbutton
>
> There is no policy in kernel.
>
> --
>
> http://www.penguinpowered.com/~vii
--
David Balazic
--------------
"Be excellent to each other." - Bill & Ted
- - - - - - - - - - - - - - - - - - - - - -
prev parent reply other threads:[~2001-03-30 10:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-27 14:40 kernel apm code David Balazic
2001-03-27 19:06 ` John Fremlin
[not found] ` <"m28zlr58w9.fsf"@boreas.yi.org>
[not found] ` <3AC1C406.652D0207@uni-mb.si>
[not found] ` <"m2bsqmlyrh.fsf"@boreas.yi.org>
2001-03-29 9:25 ` David Balazic
2001-03-29 16:44 ` John Fremlin
[not found] ` <"m24rwcjziu.fsf"@boreas.yi.org>
2001-03-30 10:20 ` David Balazic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3AC45DEC.4ABCC94B@uni-mb.si \
--to=david.balazic@uni-mb.si \
--cc=apenwarr@worldvisions.ca \
--cc=apm@linuxcare.com.au \
--cc=chief@bandits.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-laptop@vger.kernel.org \
--cc=sfr@linuxcare.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox