linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFT] b43legacy: fix bcm4303 crash
@ 2008-03-15 18:01 Stefano Brivio
  2008-03-15 18:07 ` Michael Buesch
  2008-03-15 18:08 ` Stefano Brivio
  0 siblings, 2 replies; 5+ messages in thread
From: Stefano Brivio @ 2008-03-15 18:01 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: Michael Buesch

This should fix an hard crash which happened upon driver loading on bcm4303
rev. 2 devices. The bug was originally reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=384981.
Please test.

This won't make bcm4303 rev. 2 devices working anyway, there still are some
issues with initial values which I'm trying to fix.


-- 
Ciao
Stefano

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] [RFT] b43legacy: fix bcm4303 crash
  2008-03-15 18:01 [PATCH] [RFT] b43legacy: fix bcm4303 crash Stefano Brivio
@ 2008-03-15 18:07 ` Michael Buesch
  2008-03-15 18:08 ` Stefano Brivio
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Buesch @ 2008-03-15 18:07 UTC (permalink / raw)
  To: Stefano Brivio; +Cc: linux-wireless, John W. Linville

On Saturday 15 March 2008 19:01:21 Stefano Brivio wrote:
> This should fix an hard crash which happened upon driver loading on bcm4303
> rev. 2 devices. The bug was originally reported here:
> https://bugzilla.redhat.com/show_bug.cgi?id=384981.
> Please test.
> 
> This won't make bcm4303 rev. 2 devices working anyway, there still are some
> issues with initial values which I'm trying to fix.

-ENOPATCH? :)

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] [RFT] b43legacy: fix bcm4303 crash
  2008-03-15 18:01 [PATCH] [RFT] b43legacy: fix bcm4303 crash Stefano Brivio
  2008-03-15 18:07 ` Michael Buesch
@ 2008-03-15 18:08 ` Stefano Brivio
  2008-03-15 18:14   ` Michael Buesch
  1 sibling, 1 reply; 5+ messages in thread
From: Stefano Brivio @ 2008-03-15 18:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Michael Buesch

On Sat, 15 Mar 2008 19:01:21 +0100
Stefano Brivio <stefano.brivio@polimi.it> wrote:

> This should fix an hard crash which happened upon driver loading on bcm4303
> rev. 2 devices. The bug was originally reported here:
> https://bugzilla.redhat.com/show_bug.cgi?id=384981.
> Please test.

Ehr, sure. :/ Here it comes:

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
---
Index: wireless-testing/drivers/net/wireless/b43legacy/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43legacy/main.c
+++ wireless-testing/drivers/net/wireless/b43legacy/main.c
@@ -3047,7 +3047,6 @@ static void b43legacy_wireless_core_exit
 	}
 
 	ssb_device_disable(dev->dev, 0);
-	ssb_bus_may_powerdown(dev->dev->bus);
 }
 
 static void prepare_phy_data_for_init(struct b43legacy_wldev *dev)
@@ -3214,7 +3213,6 @@ err_kfree_tssitbl:
 err_kfree_lo_control:
 	kfree(phy->lo_control);
 	phy->lo_control = NULL;
-	ssb_bus_may_powerdown(bus);
 	B43legacy_WARN_ON(b43legacy_status(dev) != B43legacy_STAT_UNINIT);
 	return err;
 }
@@ -3534,7 +3532,7 @@ static int b43legacy_wireless_core_attac
 
 	err = b43legacy_phy_versioning(dev);
 	if (err)
-		goto err_powerdown;
+		goto out;
 	/* Check if this device supports multiband. */
 	if (!pdev ||
 	    (pdev->device != 0x4312 &&
@@ -3560,10 +3558,10 @@ static int b43legacy_wireless_core_attac
 
 	err = b43legacy_validate_chipaccess(dev);
 	if (err)
-		goto err_powerdown;
+		goto out;
 	err = b43legacy_setup_modes(dev, have_bphy, have_gphy);
 	if (err)
-		goto err_powerdown;
+		goto out;
 
 	/* Now set some default "current_dev" */
 	if (!wl->current_dev)
@@ -3573,14 +3571,9 @@ static int b43legacy_wireless_core_attac
 	b43legacy_radio_turn_off(dev, 1);
 	b43legacy_switch_analog(dev, 0);
 	ssb_device_disable(dev->dev, 0);
-	ssb_bus_may_powerdown(bus);
 
 out:
 	return err;
-
-err_powerdown:
-	ssb_bus_may_powerdown(bus);
-	return err;
 }
 
 static void b43legacy_one_core_detach(struct ssb_device *dev)
Index: wireless-testing/drivers/ssb/main.c
===================================================================
--- wireless-testing.orig/drivers/ssb/main.c
+++ wireless-testing/drivers/ssb/main.c
@@ -1082,6 +1082,10 @@ int ssb_bus_may_powerdown(struct ssb_bus
 		goto out;
 
 	cc = &bus->chipco;
+
+	if (cc->dev->id.revision < 5)
+		goto out;
+
 	ssb_chipco_set_clockmode(cc, SSB_CLKMODE_SLOW);
 	err = ssb_pci_xtal(bus, SSB_GPIO_XTAL | SSB_GPIO_PLL, 0);
 	if (err)


-- 
Ciao
Stefano

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] [RFT] b43legacy: fix bcm4303 crash
  2008-03-15 18:08 ` Stefano Brivio
@ 2008-03-15 18:14   ` Michael Buesch
  2008-03-16 19:22     ` [PATCH v2] " Stefano Brivio
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Buesch @ 2008-03-15 18:14 UTC (permalink / raw)
  To: Stefano Brivio; +Cc: linux-wireless, John W. Linville

On Saturday 15 March 2008 19:08:36 Stefano Brivio wrote:
> On Sat, 15 Mar 2008 19:01:21 +0100
> Stefano Brivio <stefano.brivio@polimi.it> wrote:
> 
> > This should fix an hard crash which happened upon driver loading on bcm4303
> > rev. 2 devices. The bug was originally reported here:
> > https://bugzilla.redhat.com/show_bug.cgi?id=384981.
> > Please test.
> 
> Ehr, sure. :/ Here it comes:
> 
> Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
> ---
> Index: wireless-testing/drivers/net/wireless/b43legacy/main.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/b43legacy/main.c
> +++ wireless-testing/drivers/net/wireless/b43legacy/main.c
> @@ -3047,7 +3047,6 @@ static void b43legacy_wireless_core_exit
>  	}
>  
>  	ssb_device_disable(dev->dev, 0);
> -	ssb_bus_may_powerdown(dev->dev->bus);
>  }
>  
>  static void prepare_phy_data_for_init(struct b43legacy_wldev *dev)
> @@ -3214,7 +3213,6 @@ err_kfree_tssitbl:
>  err_kfree_lo_control:
>  	kfree(phy->lo_control);
>  	phy->lo_control = NULL;
> -	ssb_bus_may_powerdown(bus);
>  	B43legacy_WARN_ON(b43legacy_status(dev) != B43legacy_STAT_UNINIT);
>  	return err;
>  }
> @@ -3534,7 +3532,7 @@ static int b43legacy_wireless_core_attac
>  
>  	err = b43legacy_phy_versioning(dev);
>  	if (err)
> -		goto err_powerdown;
> +		goto out;
>  	/* Check if this device supports multiband. */
>  	if (!pdev ||
>  	    (pdev->device != 0x4312 &&
> @@ -3560,10 +3558,10 @@ static int b43legacy_wireless_core_attac
>  
>  	err = b43legacy_validate_chipaccess(dev);
>  	if (err)
> -		goto err_powerdown;
> +		goto out;
>  	err = b43legacy_setup_modes(dev, have_bphy, have_gphy);
>  	if (err)
> -		goto err_powerdown;
> +		goto out;
>  
>  	/* Now set some default "current_dev" */
>  	if (!wl->current_dev)
> @@ -3573,14 +3571,9 @@ static int b43legacy_wireless_core_attac
>  	b43legacy_radio_turn_off(dev, 1);
>  	b43legacy_switch_analog(dev, 0);
>  	ssb_device_disable(dev->dev, 0);
> -	ssb_bus_may_powerdown(bus);
>  
>  out:
>  	return err;
> -
> -err_powerdown:
> -	ssb_bus_may_powerdown(bus);
> -	return err;
>  }
>  
>  static void b43legacy_one_core_detach(struct ssb_device *dev)
> Index: wireless-testing/drivers/ssb/main.c
> ===================================================================
> --- wireless-testing.orig/drivers/ssb/main.c
> +++ wireless-testing/drivers/ssb/main.c
> @@ -1082,6 +1082,10 @@ int ssb_bus_may_powerdown(struct ssb_bus
>  		goto out;
>  
>  	cc = &bus->chipco;
> +
> +	if (cc->dev->id.revision < 5)
> +		goto out;
> +
>  	ssb_chipco_set_clockmode(cc, SSB_CLKMODE_SLOW);
>  	err = ssb_pci_xtal(bus, SSB_GPIO_XTAL | SSB_GPIO_PLL, 0);
>  	if (err)
> 

Note that this is not the final patch, yet. So please just test,
but not apply it to the tree.

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] [RFT] b43legacy: fix bcm4303 crash
  2008-03-15 18:14   ` Michael Buesch
@ 2008-03-16 19:22     ` Stefano Brivio
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Brivio @ 2008-03-16 19:22 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: Michael Buesch

This should fix an hard crash which happened upon driver loading on bcm4303
rev. 2 devices. The bug was originally reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=384981.
Please test.

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
---
Sorry, I forgot to run 'quilt refresh'.

Index: wireless-testing/drivers/ssb/main.c
===================================================================
--- wireless-testing.orig/drivers/ssb/main.c
+++ wireless-testing/drivers/ssb/main.c
@@ -1082,6 +1082,12 @@ int ssb_bus_may_powerdown(struct ssb_bus
 		goto out;
 
 	cc = &bus->chipco;
+
+	if (!cc->dev)
+		goto out;
+	if (cc->dev->id.revision < 5)
+		goto out;
+
 	ssb_chipco_set_clockmode(cc, SSB_CLKMODE_SLOW);
 	err = ssb_pci_xtal(bus, SSB_GPIO_XTAL | SSB_GPIO_PLL, 0);
 	if (err)



-- 
Ciao
Stefano

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-16 19:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-15 18:01 [PATCH] [RFT] b43legacy: fix bcm4303 crash Stefano Brivio
2008-03-15 18:07 ` Michael Buesch
2008-03-15 18:08 ` Stefano Brivio
2008-03-15 18:14   ` Michael Buesch
2008-03-16 19:22     ` [PATCH v2] " Stefano Brivio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).