From: Andres Salomon <dilinger@queued.net>
To: Daniel Drake <dsd@laptop.org>
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] OLPC: Add XO-1 poweroff support
Date: Thu, 7 Oct 2010 13:09:04 -0700 [thread overview]
Message-ID: <20101007130904.29350df2@debxo> (raw)
In-Reply-To: <20101007185952.A36859D401B@zog.reactivated.net>
On Thu, 7 Oct 2010 19:59:52 +0100 (BST)
Daniel Drake <dsd@laptop.org> wrote:
> Add a pm_power_off handler for the OLPC XO-1 laptop.
>
> Signed-off-by: Daniel Drake <dsd@laptop.org>
> ---
> arch/x86/Kconfig | 6 ++
> arch/x86/kernel/Makefile | 1 +
> arch/x86/kernel/olpc-xo1.c | 112
> ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 119
> insertions(+), 0 deletions(-) create mode 100644
> arch/x86/kernel/olpc-xo1.c
>
> The new olpc-xo1.c file will also be used for further functionality
> (suspend/resume, lid switch device, etc); patches to be submitted
> shortly after the review/merge of this one.
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index cea0cd9..19e6439 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -2065,6 +2065,12 @@ config OLPC
> Add support for detecting the unique features of the OLPC
> XO hardware.
>
> +config OLPC_XO1
> + bool "OLPC XO-1 support"
Any particular reason why this can't be modular?
[...]
> +
> + pm_power_off = xo1_power_off;
> +
If this were to be modular, I'm not sure what the best option is for
pm_power_off. If the old value was saved upon module load, and
restored upon module unload, I could imagine races like the following:
module A load:
saved_ppo = pm_power_off; /* NULL */
pm_power_off = frob;
module B load:
old_ppo = pm_power_off; /* frob */
pm_power_off = foo;
module A unload:
pm_power_off = saved_ppo; /* NULL */
So I guess just clobbering whatever's in pm_power_off and setting back
to NULL upon unload, with the assumption that driver's only really
going to clobber it in the case of actual OLPC hardware, and the
callbacks being clobbered wouldn't really have done the correct thing
anyways?
> + printk(KERN_INFO "OLPC XO-1 support registered\n");
> + return 0;
> +}
> +device_initcall(olpc_xo1_init);
> +
next prev parent reply other threads:[~2010-10-07 20:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 18:59 [PATCH] OLPC: Add XO-1 poweroff support Daniel Drake
2010-10-07 20:09 ` Andres Salomon [this message]
2010-10-07 20:42 ` Daniel Drake
2010-10-07 21:20 ` Andres Salomon
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=20101007130904.29350df2@debxo \
--to=dilinger@queued.net \
--cc=dsd@laptop.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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