From: Larry Finger <Larry.Finger@lwfinger.net>
To: linux-wireless@vger.kernel.org
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
linville@tuxdriver.com, chunkeey@web.de,
Max Filippov <jcmvbkbc@gmail.com>,
m@bues.ch, linux-kernel@vger.kernel.org,
devel@driverdev.osuosl.org
Subject: Re: [RFC/RFT 5/5] p54spi: Load firmware from work queue and not from probe routine
Date: Wed, 29 Feb 2012 10:00:11 -0600 [thread overview]
Message-ID: <4F4E4B8B.8090508@lwfinger.net> (raw)
In-Reply-To: <1329161826-11135-6-git-send-email-Larry.Finger@lwfinger.net>
On 02/13/2012 01:37 PM, Larry Finger wrote:
> Drivers that load firmware from their probe routine have problems with the
> latest versions of udev as they get timeouts while waiting for user
> space to start. The problem is fixed by loading the firmware and starting
> mac80211 from a delayed_work queue. By using this method, most of the
> original code is preserved.
>
> Signed-off-by: Larry Finger<Larry.Finger@lwfinger.net>
> ---
> This one is compile-tested only.
>
> Larry
> ---
Any testing done here?
Larry
> drivers/net/wireless/p54/p54spi.c | 38 ++++++++++++++++++++++++++----------
> drivers/net/wireless/p54/p54spi.h | 1 +
> 2 files changed, 28 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
> index 7faed62..87c2634 100644
> --- a/drivers/net/wireless/p54/p54spi.c
> +++ b/drivers/net/wireless/p54/p54spi.c
> @@ -595,6 +595,30 @@ static void p54spi_op_stop(struct ieee80211_hw *dev)
> cancel_work_sync(&priv->work);
> }
>
> +static void p54s_load_firmware(struct work_struct *work)
> +{
> + struct p54s_priv *priv = container_of(to_delayed_work(work),
> + struct p54s_priv, firmware_load);
> + struct ieee80211_hw *hw = priv->hw;
> + int ret;
> +
> + ret = p54spi_request_firmware(hw);
> + if (ret< 0)
> + goto err_free_common;
> +
> + ret = p54spi_request_eeprom(hw);
> + if (ret)
> + goto err_free_common;
> +
> + ret = p54_register_common(hw,&priv->spi->dev);
> + if (ret)
> + goto err_free_common;
> + return;
> +
> +err_free_common:
> + dev_err(&priv->spi->dev, "Failed to read firmware\n");
> +}
> +
> static int __devinit p54spi_probe(struct spi_device *spi)
> {
> struct p54s_priv *priv = NULL;
> @@ -658,17 +682,9 @@ static int __devinit p54spi_probe(struct spi_device *spi)
> priv->common.stop = p54spi_op_stop;
> priv->common.tx = p54spi_op_tx;
>
> - ret = p54spi_request_firmware(hw);
> - if (ret< 0)
> - goto err_free_common;
> -
> - ret = p54spi_request_eeprom(hw);
> - if (ret)
> - goto err_free_common;
> -
> - ret = p54_register_common(hw,&priv->spi->dev);
> - if (ret)
> - goto err_free_common;
> + /* setup and start delayed work to load firmware */
> + INIT_DELAYED_WORK(&priv->firmware_load, p54s_load_firmware);
> + schedule_delayed_work(&priv->firmware_load, HZ);
>
> return 0;
>
> diff --git a/drivers/net/wireless/p54/p54spi.h b/drivers/net/wireless/p54/p54spi.h
> index dfaa62a..5f7714b 100644
> --- a/drivers/net/wireless/p54/p54spi.h
> +++ b/drivers/net/wireless/p54/p54spi.h
> @@ -120,6 +120,7 @@ struct p54s_priv {
>
> enum fw_state fw_state;
> const struct firmware *firmware;
> + struct delayed_work firmware_load;
> };
>
> #endif /* P54SPI_H */
next prev parent reply other threads:[~2012-02-29 16:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-13 19:37 [RFC/RFT 0/5] Firmware load change for various wireless drivers Larry Finger
2012-02-13 19:37 ` [RFC/RFT 1/5] b43legacy: Load firmware from work queue instead of from probe routine Larry Finger
2012-02-13 19:37 ` [RFC/RFT 2/5] b43: Load firmware from a work queue and not from the " Larry Finger
2012-02-13 23:06 ` Julian Calaby
2012-02-13 23:28 ` Larry Finger
2012-02-13 23:41 ` Julian Calaby
2012-02-13 23:51 ` Larry Finger
2012-02-13 19:37 ` [RFC/RFT 3/5] p54usb: Load firmware from work queue and not from " Larry Finger
2012-02-13 19:37 ` [PATCH 4/5] p54pci: " Larry Finger
2012-02-29 15:59 ` Larry Finger
2012-02-29 17:43 ` Christian Lamparter
2012-02-29 18:15 ` Larry Finger
2012-02-29 18:27 ` Christian Lamparter
2012-02-13 19:37 ` [RFC/RFT 5/5] p54spi: " Larry Finger
2012-02-13 21:57 ` Michael Büsch
2012-02-29 16:00 ` Larry Finger [this message]
2012-02-29 19:54 ` Max Filippov
2012-02-29 20:01 ` Larry Finger
2012-02-14 10:56 ` [RFC/RFT 0/5] Firmware load change for various wireless drivers Johannes Berg
2012-02-14 16:34 ` Larry Finger
2012-02-14 16:37 ` Johannes Berg
2012-02-14 16:57 ` Larry Finger
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=4F4E4B8B.8090508@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=chunkeey@web.de \
--cc=devel@driverdev.osuosl.org \
--cc=jcmvbkbc@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=m@bues.ch \
/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.