From: Anton Vorontsov <anton@enomsg.org>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Kosina <jkosina@suse.cz>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] HID: input: return ENODATA if reading battery attrs fails
Date: Mon, 13 May 2013 16:20:17 -0700 [thread overview]
Message-ID: <20130513232017.GA25489@teo> (raw)
In-Reply-To: <1368457290-1734-1-git-send-email-dh.herrmann@gmail.com>
On Mon, May 13, 2013 at 05:01:30PM +0200, David Herrmann wrote:
[..]
> I really dislike the way power_supply core calls into the drivers during the
> "add" uevent. If a driver holds an I/O mutex (or anything else), it might
> even deadlock in a very non-obvious way. Is there a reason why we need to
> pass _all_ battery properties along "add" and "remove" uevents? Isn't it
> enough to pass them with "change" uevents? This would guarantee that the
> power_supply callbacks are only called from user-context and "change" events.
I don't think that there is a particular reason for that, but if you want
to change that, then I'd suggest to still keep uevent reporting of all the
properties on "add" and "remove" events, but don't actually call the
drivers' callback, just assume ENODATA.
This way we well preserve the behaviour of the older kernels, so that
userland will not break if, for example, it allocates needed memory on
"add" event, and then assumes that "change" will follow the pattern.
Thanks,
Anton
next prev parent reply other threads:[~2013-05-14 0:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-13 15:01 [PATCH] HID: input: return ENODATA if reading battery attrs fails David Herrmann
2013-05-13 21:17 ` Daniel Nicoletti
2013-05-24 14:02 ` David Herrmann
2013-05-29 13:21 ` Jiri Kosina
2013-05-13 23:20 ` Anton Vorontsov [this message]
2013-05-15 14:58 ` David Herrmann
2013-05-16 14:05 ` David Herrmann
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=20130513232017.GA25489@teo \
--to=anton@enomsg.org \
--cc=dh.herrmann@gmail.com \
--cc=dwmw2@infradead.org \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).