linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: Firmware class breaks udev
Date: Tue, 15 Mar 2005 16:07:09 +0000	[thread overview]
Message-ID: <4237082D.7060008@suse.de> (raw)
In-Reply-To: <42369BE6.7020807@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]

Kay Sievers wrote:
> On Tue, 2005-03-15 at 14:09 +0100, Hannes Reinecke wrote:
[ .. ]
>>This is not what happens.
>>modprobe will return _after_ device initialisation finished, ie after
>>the firmware is loaded (or not, as the case might be).
>>The firmware event is triggered when modprobe is still running, so udev
>>thinks the device is still initialising and waits until modprobe returns
>>before executing that event.
> 
> Ick, I expected modprobe to return. This is what I saw the last time
> with the ipw2100 driver. 
> 
Well, yes. After the timeout :-(.

>>>>For now I'll be putting in a quick exit for firmware events (ie not wait
>>>>for the devices initialisation to finish) but this is nevertheless _nasty_.
>>>The time I stumbled across a similar problem with the firmware class, I
>>>thought about adding a TIMEOUT= to the hotplug environment which udev
>>>can use to prioritize such events. But we should better replace
>>>class_firmware.
>>>
>>That's what i thought also. (That's why I named the variable 'timeout').
> 
> You have put that into the kernel hotplug env? Or udev itself?
> 
udev. This time I've attached the patch :-).
It might be not a bad idea to have a 'TIMEOUT' variable within the
kernel, then we can set it to a proper value.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

[-- Attachment #2: udev-053-udevd-override-timeout-events.patch --]
[-- Type: text/plain, Size: 1550 bytes --]

diff -pur udev-glibc/udevd.c udev-053/udevd.c
--- udev-glibc/udevd.c	2005-03-15 09:34:08.000000000 +0100
+++ udev-053/udevd.c	2005-03-15 09:37:13.000000000 +0100
@@ -113,6 +113,15 @@ static void msg_queue_insert(struct hotp
 		return;
 	}
 
+	/* Always execute messages with timeout directly */
+	if (msg->timeout > 0) {
+		info("move seq %llu with timeout %u to exec queue",
+		     msg->seqnum, msg->timeout);
+		list_add(&msg->node, &exec_list);
+		run_exec_q = 1;
+		return;
+	}
+
 	/* sort message by sequence number into list */
 	list_for_each_entry_reverse(loop_msg, &msg_list, node) {
 		if (loop_msg->seqnum < msg->seqnum)
@@ -293,6 +303,10 @@ static struct hotplug_msg *running_with_
 	if (msg->devpath == NULL)
 		return NULL;
 
+	/* Skip any events with a timeout set */
+	if (msg->timeout > 0)
+		return NULL;
+
 	list_for_each_entry(loop_msg, &running_list, node) {
 		if (loop_msg->devpath == NULL)
 			continue;
@@ -490,6 +503,9 @@ static struct hotplug_msg *get_udevsend_
 
 		if (strncmp(key, "PHYSDEVPATH=", 12) == 0)
 			msg->physdevpath = &key[12];
+
+		if (strncmp(key, "FIRMWARE=", 9) == 0)
+			msg->timeout = 10;
 	}
 	msg->envp[i++] = "UDEVD_EVENT=1";
 	msg->envp[i] = NULL;
diff -pur udev-glibc/udevd.h udev-053/udevd.h
--- udev-glibc/udevd.h	2005-02-11 20:55:12.000000000 +0100
+++ udev-053/udevd.h	2005-03-15 09:34:50.000000000 +0100
@@ -60,6 +60,7 @@ struct hotplug_msg {
 	char *subsystem;
 	unsigned long long seqnum;
 	char *physdevpath;
+	unsigned int timeout;
 	char *envp[HOTPLUG_NUM_ENVP+1];
 	char envbuf[];
 };

  parent reply	other threads:[~2005-03-15 16:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-15  8:25 Firmware class breaks udev Hannes Reinecke
2005-03-15 12:17 ` Kay Sievers
2005-03-15 13:09 ` Hannes Reinecke
2005-03-15 15:06 ` Kay Sievers
2005-03-15 15:20 ` Jon Smirl
2005-03-15 16:07 ` Hannes Reinecke [this message]
2005-03-15 16:20 ` Greg KH
2005-03-16  7:27 ` Hannes Reinecke
2005-03-16 15:52 ` Jon Smirl
2005-03-16 20:25 ` Kay Sievers
2005-03-17  6:01 ` Greg KH
2005-03-17  6:03 ` Greg KH

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=4237082D.7060008@suse.de \
    --to=hare@suse.de \
    --cc=linux-hotplug@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).