linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] b43: fix memory leak on bcm5354
@ 2012-02-20 23:38 Hauke Mehrtens
  2012-02-21  0:57 ` Larry Finger
  2012-02-21  9:48 ` Florian Fainelli
  0 siblings, 2 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2012-02-20 23:38 UTC (permalink / raw)
  To: zajec5, Larry.Finger; +Cc: b43-dev, linux-wireless, m, Hauke Mehrtens

When using the bcm5354 with a recent firmware >= 478.104 it runs into a
memory very shortly after doing an active scan or any thing else where
packages are send. This was cased by a gpio misconfiguration, the
firmware triggered the GPIO pins used for buttons on some devices and
that caused an other driver (OpenWrt diag) listening for these buttons
to send many user space messages.
This patch fixes the bug for my devices (Asus WL-520GU) and makes it
work with firmware 666.2, but I do not know if this patch is correct.
The spec for this part is out of date:
http://bcm-specs.sipsolutions.net/GPIO

GPIO pin layout:
pin#	name	type
0	power	led
1	wlan	led
2	reset	button
3	ses	buttom

related nvram configuration:
wl0gpio2=11
wl0gpio3=11
wl0gpio0=11
wl0gpio1=0x02
reset_gpio=2

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/wireless/b43/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 23ffb1b..f782723 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2720,6 +2720,8 @@ static int b43_gpio_init(struct b43_wldev *dev)
 		mask |= 0x0060;
 		set |= 0x0060;
 	}
+	if (dev->dev->chip_id == 0x5354)
+		set &= 0xff02;
 	if (0 /* FIXME: conditional unknown */ ) {
 		b43_write16(dev, B43_MMIO_GPIO_MASK,
 			    b43_read16(dev, B43_MMIO_GPIO_MASK)
-- 
1.7.5.4


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

* Re: [RFC] b43: fix memory leak on bcm5354
  2012-02-20 23:38 [RFC] b43: fix memory leak on bcm5354 Hauke Mehrtens
@ 2012-02-21  0:57 ` Larry Finger
  2012-02-21 19:11   ` Hauke Mehrtens
  2012-02-21  9:48 ` Florian Fainelli
  1 sibling, 1 reply; 4+ messages in thread
From: Larry Finger @ 2012-02-21  0:57 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: zajec5, b43-dev, linux-wireless, m

On 02/20/2012 05:38 PM, Hauke Mehrtens wrote:
> When using the bcm5354 with a recent firmware>= 478.104 it runs into a
> memory very shortly after doing an active scan or any thing else where

You are missing a word after memory.

> packages are send. This was cased by a gpio misconfiguration, the
> firmware triggered the GPIO pins used for buttons on some devices and
> that caused an other driver (OpenWrt diag) listening for these buttons
> to send many user space messages.
> This patch fixes the bug for my devices (Asus WL-520GU) and makes it
> work with firmware 666.2, but I do not know if this patch is correct.
> The spec for this part is out of date:
> http://bcm-specs.sipsolutions.net/GPIO

I just updated the specs based on additional info I found. Everything I see say 
that there are 4 bits for the LEDs. Do you have a source for what you posted below?

>
> GPIO pin layout:
> pin#	name	type
> 0	power	led
> 1	wlan	led
> 2	reset	button
> 3	ses	buttom
>
> related nvram configuration:
> wl0gpio2=11
> wl0gpio3=11
> wl0gpio0=11
> wl0gpio1=0x02
> reset_gpio=2

Larry

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

* Re: [RFC] b43: fix memory leak on bcm5354
  2012-02-20 23:38 [RFC] b43: fix memory leak on bcm5354 Hauke Mehrtens
  2012-02-21  0:57 ` Larry Finger
@ 2012-02-21  9:48 ` Florian Fainelli
  1 sibling, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2012-02-21  9:48 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: zajec5, Larry.Finger, b43-dev, linux-wireless, m

Hi Hauke,

Le 02/21/12 00:38, Hauke Mehrtens a écrit :
> When using the bcm5354 with a recent firmware>= 478.104 it runs into a
> memory very shortly after doing an active scan or any thing else where
> packages are send. This was cased by a gpio misconfiguration, the
> firmware triggered the GPIO pins used for buttons on some devices and
> that caused an other driver (OpenWrt diag) listening for these buttons
> to send many user space messages.

and this is what really exhausts memory in fact (the send of many 
messages). The real bug is actually the B43 driver taking over GPIOs 
used by the system for other purposes: buttons and LEDs, this is what 
your subject should reflect.

> This patch fixes the bug for my devices (Asus WL-520GU) and makes it
> work with firmware 666.2, but I do not know if this patch is correct.
> The spec for this part is out of date:
> http://bcm-specs.sipsolutions.net/GPIO
>
> GPIO pin layout:
> pin#	name	type
> 0	power	led
> 1	wlan	led
> 2	reset	button
> 3	ses	buttom
>
> related nvram configuration:
> wl0gpio2=11
> wl0gpio3=11
> wl0gpio0=11
> wl0gpio1=0x02
> reset_gpio=2
>
> Signed-off-by: Hauke Mehrtens<hauke@hauke-m.de>
> ---
>   drivers/net/wireless/b43/main.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index 23ffb1b..f782723 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -2720,6 +2720,8 @@ static int b43_gpio_init(struct b43_wldev *dev)
>   		mask |= 0x0060;
>   		set |= 0x0060;
>   	}
> +	if (dev->dev->chip_id == 0x5354)
> +		set&= 0xff02;
>   	if (0 /* FIXME: conditional unknown */ ) {
>   		b43_write16(dev, B43_MMIO_GPIO_MASK,
>   			    b43_read16(dev, B43_MMIO_GPIO_MASK)

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

* Re: [RFC] b43: fix memory leak on bcm5354
  2012-02-21  0:57 ` Larry Finger
@ 2012-02-21 19:11   ` Hauke Mehrtens
  0 siblings, 0 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2012-02-21 19:11 UTC (permalink / raw)
  To: Larry Finger; +Cc: zajec5, b43-dev, linux-wireless, m

On 02/21/2012 01:57 AM, Larry Finger wrote:
> On 02/20/2012 05:38 PM, Hauke Mehrtens wrote:
>> When using the bcm5354 with a recent firmware>= 478.104 it runs into a
>> memory very shortly after doing an active scan or any thing else where
> 
> You are missing a word after memory.
It leaked to somewhere else. ;-)

>> packages are send. This was cased by a gpio misconfiguration, the
>> firmware triggered the GPIO pins used for buttons on some devices and
>> that caused an other driver (OpenWrt diag) listening for these buttons
>> to send many user space messages.
>> This patch fixes the bug for my devices (Asus WL-520GU) and makes it
>> work with firmware 666.2, but I do not know if this patch is correct.
>> The spec for this part is out of date:
>> http://bcm-specs.sipsolutions.net/GPIO
> 
> I just updated the specs based on additional info I found. Everything I
> see say that there are 4 bits for the LEDs. Do you have a source for
> what you posted below?
Thanks for updating the spec, but this is nothing special for the
bcm5354. My device just has one WLAN LED, like many SoCs.

>> GPIO pin layout:
>> pin#    name    type
>> 0    power    led
>> 1    wlan    led
>> 2    reset    button
>> 3    ses    buttom

This is from the Asus WL-520GU section of the the OpenWrt diag driver
[0] and I verified it myself on this device.

>> related nvram configuration:
>> wl0gpio2=11
>> wl0gpio3=11
>> wl0gpio0=11
>> wl0gpio1=0x02
>> reset_gpio=2

This was extracted from the nvram of the Asus W-520GU with "nvram show
|grep gpio". This was a used device, so I do not know if someone else
already did some modifications to the nvram.

Hauke

[0]: https://dev.openwrt.org/browser/trunk/package/broadcom-diag/src/diag.c

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

end of thread, other threads:[~2012-02-21 19:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 23:38 [RFC] b43: fix memory leak on bcm5354 Hauke Mehrtens
2012-02-21  0:57 ` Larry Finger
2012-02-21 19:11   ` Hauke Mehrtens
2012-02-21  9:48 ` Florian Fainelli

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).