From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Javier Pello <javier.pello@urjc.es>
Cc: linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: Re: [PATCH] request_firmware: skip timeout if userspace was not notified
Date: Tue, 7 Aug 2007 12:58:44 +0200 [thread overview]
Message-ID: <20070807125844.4d756b04@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <46B7832B.6010808@urjc.es>
On Mon, 06 Aug 2007 22:23:07 +0200,
Javier Pello <javier.pello@urjc.es> wrote:
> > > 2. The second part changes _request_firmware in
> > > drivers/base/firmware_class.c to actually check the return value
> > > of kobject_uevent and skip the loading_timeout delay if the
> > > loading event was not delivered to userspace at all.
> >
> > Note that kobject_uevent() returns 0 if the event has been filtered.
>
> Oops, yes, I had not noticed. This brings another point: When should
> kobject_uevent return a "failure"? The code, as it is, only returns a
> failure when things are really wrong (out of memory, etc.), and
> returns success when the event was simply dropped. This is reasonable
> behaviour, but it prevents callers from knowing whether the event was
> actually delivered (which is what request_firmware needs). On the
> other hand, my patch tries to make nondelivery an error, but on
> second thoughts that could prevent the caller from telling hard
> errors from simple nondelivery.
You could say that not delivering is caused by a hard error when trying
to deliver, though. OTOH, filtering an event is certainly not an error.
> I can think of two possibilities
> to sort this out:
>
> - kobject_uevent returns an error code both on a hard error and
> on nondelivery; the error codes for both situations are different,
> so the caller can tell them apart.
Tough. For example, both today's kobject_uevent() and
call_usermodehelper() may return -ENOMEM.
>
> - kobject_uevent returns an error code (<0) only on a hard error,
> returns 0 on nondelivery and 1 on delivery; this makes things
> even clearer.
Hm, I have an aversion against tri-state return values :( OTOH, a)
callers generally don't care and b) it is in line with how
kobject_uevent() is defined if !CONFIG_HOTPLUG.
- Use an extra parameter in which successful delivery can be indicated.
Make this
int kobject_uevent_env_check(struct kobject *kobject,
enum kobject_action action,
char *envp[], int delivered);
so existing callers that don't care don't have to be changed.
>
> I am biased towards the latter. Of course, we can do anything as
> the return value is actually never used, but I would still like
> to know other opinions about what the right thing is.
next prev parent reply other threads:[~2007-08-07 10:57 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-03 19:07 Javier Pello
2007-08-04 5:21 ` david
2007-08-04 8:50 ` Javier Pello
2007-08-04 17:09 ` david
2007-08-04 21:20 ` Javier Pello
2007-08-06 12:24 ` Cornelia Huck
2007-08-06 20:23 ` Javier Pello
[not found] ` <20070807125844.4d756b04@gondo lin.boeblingen.de.ibm.com>
2007-08-07 10:58 ` Cornelia Huck [this message]
2007-08-07 11:46 ` Kay Sievers
2007-08-07 12:10 ` Cornelia Huck
2007-08-07 12:31 ` Kay Sievers
2007-08-07 12:48 ` Cornelia Huck
2007-08-07 12:47 ` Javier Pello
2007-08-07 12:57 ` Kay Sievers
2007-08-07 13:15 ` Cornelia Huck
2007-08-07 13:59 ` Javier Pello
2007-08-07 14:08 ` Kay Sievers
2007-08-07 14:38 ` Cornelia Huck
2007-08-09 9:13 ` Javier Pello
2007-08-09 9:21 ` Kay Sievers
2007-08-09 9:26 ` Cornelia Huck
2007-08-07 14:26 ` Cornelia Huck
2007-08-09 9:36 ` Javier Pello
2007-08-09 11:58 ` Kay Sievers
2007-08-10 21:24 ` Javier Pello
2007-08-11 13:26 ` Kay Sievers
2007-08-07 20:05 ` Andrew Morton
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=20070807125844.4d756b04@gondolin.boeblingen.de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=greg@kroah.com \
--cc=javier.pello@urjc.es \
--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
all inboxes | Powered by JetHome®