From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Hanselmann <linux-kernel@hansmi.ch>
Cc: linuxppc-dev@ozlabs.org, johannes@sipsolutions.net,
linux-kernel@killerfox.forkbomb.ch
Subject: Re: [PATCH] SMU LED driver
Date: Mon, 08 Jan 2007 12:02:45 +1100 [thread overview]
Message-ID: <1168218165.22458.100.camel@localhost.localdomain> (raw)
In-Reply-To: <20070106211939.GB29846@hansmi.ch>
On Sat, 2007-01-06 at 22:19 +0100, Michael Hanselmann wrote:
> On Tue, Dec 26, 2006 at 08:25:52AM +1100, Benjamin Herrenschmidt wrote:
> > On Sun, 2006-12-24 at 12:23 +0100, Michael Hanselmann wrote:
> > > This patch adds a driver for the front LED in recent PowerMacs which
> > > have an SMU.
>
> > As for the PMU driver, I'm pretty unhappy that it sycnhronously waits
> > for the completion. The original code I wrote was fully asynchronous.
>
> Unfortunately, I can't see another way than doing it synchronously when
> one shouldn't use kmalloc(). The command (struct smu_simple_cmd) is kept
> on the stack. It contains the buffer used for both sending and
> retrieving data to/from the SMU. Making it module-global wouldn't work,
> because one request could conflict with another. struct smu_cmd can't be
> locked, so we can't check or wait for the status like via-pmu-led does.
> So, what should I do?
>
> On another note, it seems like the PMU LED driver is already
> asynchronous.
Just have 1 request allocated once for all. Then, have a global set to
what status you want the LED at. Once the completion of any request
arrives, if the new status is different from what you want, send a new
one to fix it up :-)
That's the easy way.
The old PMU code did something more subtle because it was based on the
assumption that the LED was used to emit "pulses" based on HD activity.
Ben.
next prev parent reply other threads:[~2007-01-08 1:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-24 11:23 [PATCH] SMU LED driver Michael Hanselmann
2006-12-25 21:25 ` Benjamin Herrenschmidt
2006-12-26 22:38 ` Johannes Berg
2007-01-06 21:19 ` Michael Hanselmann
2007-01-08 1:02 ` Benjamin Herrenschmidt [this message]
2007-01-14 13:31 ` Michael Hanselmann
2007-01-14 21:48 ` Benjamin Herrenschmidt
2007-01-15 0:26 ` Michael Hanselmann
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=1168218165.22458.100.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@hansmi.ch \
--cc=linux-kernel@killerfox.forkbomb.ch \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).