[systemd-devel] udev 182: response timeout for request_firmware in module_probe path

Ming Lei tom.leiming at gmail.com
Thu Aug 23 08:16:46 PDT 2012


Cc systemd-devel

Hi,

On Tue, Aug 21, 2012 at 1:34 PM, Ming Lei <tom.leiming at gmail.com> wrote:
> Hi Kay,
>
> I found that udev 182 doesn't response for the request_firmware in
> module_probe path until 30sec later after the 'ADD' event of firmware
> device, but no such problem in udev175, sounds like a regression of udev?

Looks udevd is capable of handling the firmware ADD event even though
the device ADD event is being processed( modprobe is triggered by device
ADD event).

The below patch[1] can fix the problem, could you give any comments on it?

>
> I find there was a related discussion in [1], so CC guys who discussed before.
>
> Just grep under kernel root dir, there are about 360 request_firmware callers,
> and looks most of them are called in .probe path.
>
>
> [1], https://lkml.org/lkml/2012/2/19/57


[1],

diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index b4fc624..806721c 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -96,6 +96,7 @@ struct event {
         const char *devpath_old;
         dev_t devnum;
         bool is_block;
+        bool is_firmware;
         int ifindex;
 };

@@ -439,6 +440,7 @@ static int event_queue_insert(struct udev_device *dev)
         event->devpath_old = udev_device_get_devpath_old(dev);
         event->devnum = udev_device_get_devnum(dev);
         event->is_block = (strcmp("block",
udev_device_get_subsystem(dev)) == 0);
+        event->is_firmware = (strcmp("firmware",
udev_device_get_subsystem(dev)) == 0);
         event->ifindex = udev_device_get_ifindex(dev);

         udev_queue_export_device_queued(udev_queue_export, dev);
@@ -520,7 +522,7 @@ static bool is_devpath_busy(struct event *event)
                 }

                 /* parent device event found */
-                if (event->devpath[common] == '/') {
+                if (event->devpath[common] == '/' && !event->is_firmware) {
                         event->delaying_seqnum = loop_event->seqnum;
                         return true;
                 }



Thanks,
-- 
Ming Lei


More information about the systemd-devel mailing list