From: David Woodhouse Date: Tue, 11 Dec 2007 16:55:37 +0000 (-0500) Subject: libertas: don't run thread while firmware not yet ready X-Git-Tag: v2.6.25-rc1~1162^2~389 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b15152a4033d4c82015bb79c6b81eeb0a2edeeea;p=~emulex%2Finfiniband.git libertas: don't run thread while firmware not yet ready Signed-off-by: David Woodhouse Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 88664024bf8..9a231099212 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c @@ -671,6 +671,8 @@ static int lbs_thread(void *data) shouldsleep = 1; /* Sleep mode. Nothing we can do till it wakes */ else if (priv->intcounter) shouldsleep = 0; /* Interrupt pending. Deal with it now */ + else if (!priv->fw_ready) + shouldsleep = 1; /* Firmware not ready. We're waiting for it */ else if (priv->dnld_sent) shouldsleep = 1; /* Something is en route to the device already */ else if (priv->tx_pending_len > 0) @@ -753,6 +755,9 @@ static int lbs_thread(void *data) } else spin_unlock_irq(&priv->driver_lock); + if (!priv->fw_ready) + continue; + /* Check if we need to confirm Sleep Request received previously */ if (priv->psstate == PS_STATE_PRE_SLEEP && !priv->dnld_sent && !priv->cur_cmd) {