From: Marc Pignat <marc.pignat@hevs.ch>
To: David Brownell <david-b@pacbell.net>
Cc: khali@linux-fr.org, linux-kernel@vger.kernel.org, i2c@lm-sensors.org
Subject: Re: [RFC,PATCH] i2c: fix device_init_wakeup place
Date: Mon, 11 Aug 2008 09:03:58 +0200 [thread overview]
Message-ID: <200808110903.58658.marc.pignat@hevs.ch> (raw)
In-Reply-To: <20080810230404.B2943B2AB@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
Hi all!
First, I would like to ask David to exuse me for saying something like "your
patch did nothing", it was crude.
David had a real good idea to add the flag I2C_CLIENT_WAKE.
On Monday 11 August 2008, David Brownell wrote:
> > > The current code calls device_init_wakeup() before device_register, but
...
> > Interesting point... David, what are you using this code for then? Same
> > question for you Marc.
...
I use it for an rtc chip (ds1374), but the board is not in tree (should be
soon).
>
>
> > > This patch also include a small functionnal change: the I2C_CLIENT_WAKE
> > > is no more removed from the client flags, but this should't hurt.
> >
> > Why do you want to change this?
>
> It's kind of essential to making this patch work! Else the flag
> won't be available when the i2c core gets control of that device
> node again, after device_initialize() code zeroes those flags.
Now the flag is used in the i2c_device_probe function and must be preserved
for future use (probe of another device or re-probe).
The downside is that it make this flag visible to the i2c_client.
To preserve the original behavior (hide the flag to the driver), the flag
should be saved, for instance in the i2c_device structure.
I think adding more code and adding a field in the i2c_device structure costs
more than making this flag visible (but if you think differently, I can fix the
patch).
>
>
...
> Better would be to preserve any existing settings:
>
> if (!device_can_wakeup(&client->dev))
> device_init_wakeup(...)
>
> That way the userspace policy setting is preserved unless the
> device itself gets removed ... instead of being clobbered by
> the simple act of (re)probing a driver.
Ok, will be fixed in version 2
Best regards
Marc
prev parent reply other threads:[~2008-08-11 7:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-29 13:35 [RFC,PATCH] i2c: fix device_init_wakeup place Marc Pignat
2008-08-09 16:56 ` Jean Delvare
2008-08-10 23:04 ` David Brownell
2008-08-11 7:03 ` Marc Pignat [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=200808110903.58658.marc.pignat@hevs.ch \
--to=marc.pignat@hevs.ch \
--cc=david-b@pacbell.net \
--cc=i2c@lm-sensors.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.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