Patchwork [Precise] (pre-stable) b43: only reload config after successful initialization

login
register
mail settings
Submitter Tim Gardner
Date April 30, 2012, 4:29 p.m.
Message ID <1335803397-28941-1-git-send-email-tim.gardner@canonical.com>
Download mbox | patch
Permalink /patch/155921/
State New
Headers show

Comments

Tim Gardner - April 30, 2012, 4:29 p.m.
From: Seth Forshee <seth.forshee@canonical.com>

Commit 2a19032 (b43: reload phy and bss settings after core restarts)
introduced an unconditional call to b43_op_config() at the end of
b43_op_start(). When firmware fails to load this can wedge the system.
There's no need to reload the configuration after a failed
initialization anyway, so only make the call if initialization was
successful.

BugLink: http://bugs.launchpad.net/bugs/950295
Cc: Felix Fietkau <nbd@openwrt.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/b43/main.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Leann Ogasawara - May 1, 2012, 6:38 p.m.
On 04/30/2012 09:29 AM, Tim Gardner wrote:
> From: Seth Forshee<seth.forshee@canonical.com>
>
> Commit 2a19032 (b43: reload phy and bss settings after core restarts)
> introduced an unconditional call to b43_op_config() at the end of
> b43_op_start(). When firmware fails to load this can wedge the system.
> There's no need to reload the configuration after a failed
> initialization anyway, so only make the call if initialization was
> successful.
>
> BugLink: http://bugs.launchpad.net/bugs/950295
> Cc: Felix Fietkau<nbd@openwrt.org>
> Cc:<stable@vger.kernel.org>
> Signed-off-by: Seth Forshee<seth.forshee@canonical.com>
> Signed-off-by: John W. Linville<linville@tuxdriver.com>

Patch has been sent upstream and has positive test feedback:

Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>

> ---
>   drivers/net/wireless/b43/main.c |   10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index c79e663..e4d6dc2 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -4827,8 +4827,14 @@ static int b43_op_start(struct ieee80211_hw *hw)
>    out_mutex_unlock:
>   	mutex_unlock(&wl->mutex);
>
> -	/* reload configuration */
> -	b43_op_config(hw, ~0);
> +	/*
> +	 * Configuration may have been overwritten during initialization.
> +	 * Reload the configuration, but only if initialization was
> +	 * successful. Reloading the configuration after a failed init
> +	 * may hang the system.
> +	 */
> +	if (!err)
> +		b43_op_config(hw, ~0);
>
>   	return err;
>   }
Stefan Bader - May 2, 2012, 9:11 a.m.
On 30.04.2012 18:29, Tim Gardner wrote:
> From: Seth Forshee <seth.forshee@canonical.com>
> 
> Commit 2a19032 (b43: reload phy and bss settings after core restarts)
> introduced an unconditional call to b43_op_config() at the end of
> b43_op_start(). When firmware fails to load this can wedge the system.
> There's no need to reload the configuration after a failed
> initialization anyway, so only make the call if initialization was
> successful.
> 
> BugLink: http://bugs.launchpad.net/bugs/950295
> Cc: Felix Fietkau <nbd@openwrt.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
>  drivers/net/wireless/b43/main.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index c79e663..e4d6dc2 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -4827,8 +4827,14 @@ static int b43_op_start(struct ieee80211_hw *hw)
>   out_mutex_unlock:
>  	mutex_unlock(&wl->mutex);
>  
> -	/* reload configuration */
> -	b43_op_config(hw, ~0);
> +	/*
> +	 * Configuration may have been overwritten during initialization.
> +	 * Reload the configuration, but only if initialization was
> +	 * successful. Reloading the configuration after a failed init
> +	 * may hang the system.
> +	 */
> +	if (!err)
> +		b43_op_config(hw, ~0);
>  
>  	return err;
>  }
Tim Gardner - May 2, 2012, 12:34 p.m.
Precise and Quantal

Patch

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index c79e663..e4d6dc2 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4827,8 +4827,14 @@  static int b43_op_start(struct ieee80211_hw *hw)
  out_mutex_unlock:
 	mutex_unlock(&wl->mutex);
 
-	/* reload configuration */
-	b43_op_config(hw, ~0);
+	/*
+	 * Configuration may have been overwritten during initialization.
+	 * Reload the configuration, but only if initialization was
+	 * successful. Reloading the configuration after a failed init
+	 * may hang the system.
+	 */
+	if (!err)
+		b43_op_config(hw, ~0);
 
 	return err;
 }