All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "Kay Sievers" <kay.sievers@vrfy.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"Tom Gundersen" <teg@jklm.no>,
	"Andy Whitcroft" <apw@canonical.com>,
	"Larry Finger" <Larry.Finger@lwfinger.net>,
	"Greg KH" <greg@kroah.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: calling request_firmware() from module init will not work with recent/future udev versions
Date: Mon, 20 Feb 2012 18:43:54 +0100	[thread overview]
Message-ID: <4F42865A.5060006@broadcom.com> (raw)
In-Reply-To: <CAPXgP11iT9K2KcDCJvw_druf5qdNjs0jLfrbpS7CcYh5vXrz_w@mail.gmail.com>

On 01/14/2012 04:25 PM, Kay Sievers wrote:
> We changed udev to strictly enforce sequence order and dependency
> handling of events. This seems to break some netdev drivers which
> block in modprobe until the firmware from userspace is loaded into the
> driver.

Working on the issue complicated the behavior of the driver so I decided 
to take a step back to determine the actual issue.

> These are the drivers we received bug reports so far. We didn't look
> into any of details of the drivers, but according to the logs, they
> seem to block for 60 seconds in modprobe, when userspace is not
> behaving like expected:
>    bnx2/bnx2-mips-06-6.2.1.fw
>    rtlwifi/rtl8192sefw.bin
>    brcm/bcm43xx-0.fw

The main problem is that the init_module() syscall should not block. 
However, the driver I am responsible for (brcm80211) does not request 
firmware in the init_module() path. It does that on the probe() 
callback. So the problem is that the probe() code path is done in the 
context of the init_module() syscall. So the thing to do is decouple the 
probe() callback from the init_module() syscall.

One option is using the nowait version of request_firmware(), but 
another option I am considering is to defer the driver registration 
using a workqueue and schedule it in the init_module() syscall. That way 
I think I can avoid having to call the device_unregister_driver() when 
firmware loading fails.

Another thing to consider is to change the driver core subsystem and 
assure the probe() callback is never done in the init_module() context.

Any opinions?

Gr. AvS


WARNING: multiple messages have this Message-ID (diff)
From: "Arend van Spriel" <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
To: "Kay Sievers" <kay.sievers-tD+1rO4QERM@public.gmane.org>
Cc: "netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Tom Gundersen" <teg-B22kvLQNl6c@public.gmane.org>,
	"Andy Whitcroft" <apw-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>,
	"Larry Finger"
	<Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>,
	"Greg KH" <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: calling request_firmware() from module init will not work with recent/future udev versions
Date: Mon, 20 Feb 2012 18:43:54 +0100	[thread overview]
Message-ID: <4F42865A.5060006@broadcom.com> (raw)
In-Reply-To: <CAPXgP11iT9K2KcDCJvw_druf5qdNjs0jLfrbpS7CcYh5vXrz_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 01/14/2012 04:25 PM, Kay Sievers wrote:
> We changed udev to strictly enforce sequence order and dependency
> handling of events. This seems to break some netdev drivers which
> block in modprobe until the firmware from userspace is loaded into the
> driver.

Working on the issue complicated the behavior of the driver so I decided 
to take a step back to determine the actual issue.

> These are the drivers we received bug reports so far. We didn't look
> into any of details of the drivers, but according to the logs, they
> seem to block for 60 seconds in modprobe, when userspace is not
> behaving like expected:
>    bnx2/bnx2-mips-06-6.2.1.fw
>    rtlwifi/rtl8192sefw.bin
>    brcm/bcm43xx-0.fw

The main problem is that the init_module() syscall should not block. 
However, the driver I am responsible for (brcm80211) does not request 
firmware in the init_module() path. It does that on the probe() 
callback. So the problem is that the probe() code path is done in the 
context of the init_module() syscall. So the thing to do is decouple the 
probe() callback from the init_module() syscall.

One option is using the nowait version of request_firmware(), but 
another option I am considering is to defer the driver registration 
using a workqueue and schedule it in the init_module() syscall. That way 
I think I can avoid having to call the device_unregister_driver() when 
firmware loading fails.

Another thing to consider is to change the driver core subsystem and 
assure the probe() callback is never done in the init_module() context.

Any opinions?

Gr. AvS

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-02-20 17:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-14 15:25 calling request_firmware() from module init will not work with recent/future udev versions Kay Sievers
2012-01-14 17:58 ` John W. Linville
2012-01-14 18:20   ` Larry Finger
2012-01-14 19:59     ` Arend van Spriel
2012-01-14 19:59       ` Arend van Spriel
2012-01-14 20:13       ` Larry Finger
2012-01-14 20:13         ` Larry Finger
2012-01-14 20:15         ` Emmanuel Grumbach
2012-01-14 20:15           ` Emmanuel Grumbach
2012-01-14 18:45 ` Larry Finger
2012-01-14 19:26   ` Tom Gundersen
2012-01-15 10:02 ` Johannes Berg
2012-01-15 15:33   ` Kay Sievers
2012-01-15 15:33     ` Kay Sievers
2012-01-16  8:57     ` Johannes Berg
2012-01-16 12:05       ` Kay Sievers
2012-01-16 12:16         ` Johannes Berg
2012-07-19 10:46           ` Kay Sievers
2012-07-24 14:16             ` Johannes Berg
2012-07-24 14:32               ` Tom Gundersen
2012-07-24 17:50                 ` Kay Sievers
2012-02-16 12:04       ` Arend van Spriel
2012-02-16 12:04         ` Arend van Spriel
2012-02-16 12:38         ` Johannes Berg
2012-02-16 13:09           ` Arend van Spriel
2012-02-16 13:09             ` Arend van Spriel
2012-02-16 14:39             ` Johannes Berg
2012-02-16 14:39               ` Johannes Berg
2012-02-20 17:43 ` Arend van Spriel [this message]
2012-02-20 17:43   ` Arend van Spriel

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=4F42865A.5060006@broadcom.com \
    --to=arend@broadcom.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=apw@canonical.com \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=teg@jklm.no \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.