linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] b43legacy: Fix machine check errors for PPC  architecture with BCM4306/2
@ 2007-09-16  0:52 Larry Finger
  2007-09-16  9:00 ` Michael Buesch
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2007-09-16  0:52 UTC (permalink / raw)
  To: John Linville; +Cc: Bcm43xx-dev, linux-wireless

In b43legacy, the variable gmode is always set. With a BCM4306/2,
a variable is needed to control the execution path through the PHY
and radio initialization, otherwise there are attempts to read from
invalid registers. On x86 platforms, these read failures cause no
problems; however they lead to machine check errors for the ppc
architecture. This problem is fixed by making the variable gmode mimic
the state of the GMODE bit of MACCTL. This patch has been tested on an
i386 platform using special code to detect these invalid reads, and on
at least one Powerbook.
 
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

John,

This patch fixes a problem with the Fedora Rawhide kernel reported by David
Woodhouse on the bcm43xx mailing list and by Will Woods at 
https://bugzilla.redhat.com/show_bug.cgi?id=233011. 

Larry

 drivers/net/wireless/b43legacy/b43legacy.h |    2 +-
 drivers/net/wireless/b43legacy/main.c      |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

Index: wireless-dev/drivers/net/wireless/b43legacy/main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/b43legacy/main.c
+++ wireless-dev/drivers/net/wireless/b43legacy/main.c
@@ -738,8 +738,11 @@ void b43legacy_wireless_core_reset(struc
 
 	macctl = b43legacy_read32(dev, B43legacy_MMIO_MACCTL);
 	macctl &= ~B43legacy_MACCTL_GMODE;
-	if (flags & B43legacy_TMSLOW_GMODE)
+	if (flags & B43legacy_TMSLOW_GMODE) {
 		macctl |= B43legacy_MACCTL_GMODE;
+		dev->phy.gmode = 1;
+	} else
+		dev->phy.gmode = 0;
 	macctl |= B43legacy_MACCTL_IHR_ENABLED;
 	b43legacy_write32(dev, B43legacy_MMIO_MACCTL, macctl);
 }
Index: wireless-dev/drivers/net/wireless/b43legacy/b43legacy.h
===================================================================
--- wireless-dev.orig/drivers/net/wireless/b43legacy/b43legacy.h
+++ wireless-dev/drivers/net/wireless/b43legacy/b43legacy.h
@@ -389,7 +389,7 @@ struct b43legacy_lopair {
 struct b43legacy_phy {
 	/* Possible PHYMODEs on this PHY */
 	u8 possible_phymodes;
-	/* GMODE bit enabled? */
+	/* GMODE bit enabled in MACCTL? */
 	bool gmode;
 	/* Possible ieee80211 subsystem hwmodes for this PHY.
 	 * Which mode is selected, depends on thr GMODE enabled bit */

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

* Re: [PATCH V3] b43legacy: Fix machine check errors for PPC architecture with BCM4306/2
  2007-09-16  0:52 [PATCH V3] b43legacy: Fix machine check errors for PPC architecture with BCM4306/2 Larry Finger
@ 2007-09-16  9:00 ` Michael Buesch
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2007-09-16  9:00 UTC (permalink / raw)
  To: bcm43xx-dev; +Cc: Larry Finger, John Linville, linux-wireless

On Sunday 16 September 2007 02:52:11 Larry Finger wrote:
> In b43legacy, the variable gmode is always set. With a BCM4306/2,
> a variable is needed to control the execution path through the PHY
> and radio initialization, otherwise there are attempts to read from
> invalid registers. On x86 platforms, these read failures cause no
> problems; however they lead to machine check errors for the ppc
> architecture. This problem is fixed by making the variable gmode mimic
> the state of the GMODE bit of MACCTL. This patch has been tested on an
> i386 platform using special code to detect these invalid reads, and on
> at least one Powerbook.
>  
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
> 
> John,
> 
> This patch fixes a problem with the Fedora Rawhide kernel reported by David
> Woodhouse on the bcm43xx mailing list and by Will Woods at 
> https://bugzilla.redhat.com/show_bug.cgi?id=233011. 
> 
> Larry
> 
>  drivers/net/wireless/b43legacy/b43legacy.h |    2 +-
>  drivers/net/wireless/b43legacy/main.c      |    5 ++++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> Index: wireless-dev/drivers/net/wireless/b43legacy/main.c
> ===================================================================
> --- wireless-dev.orig/drivers/net/wireless/b43legacy/main.c
> +++ wireless-dev/drivers/net/wireless/b43legacy/main.c
> @@ -738,8 +738,11 @@ void b43legacy_wireless_core_reset(struc
>  
>  	macctl = b43legacy_read32(dev, B43legacy_MMIO_MACCTL);
>  	macctl &= ~B43legacy_MACCTL_GMODE;
> -	if (flags & B43legacy_TMSLOW_GMODE)
> +	if (flags & B43legacy_TMSLOW_GMODE) {
>  		macctl |= B43legacy_MACCTL_GMODE;
> +		dev->phy.gmode = 1;
> +	} else
> +		dev->phy.gmode = 0;
>  	macctl |= B43legacy_MACCTL_IHR_ENABLED;
>  	b43legacy_write32(dev, B43legacy_MMIO_MACCTL, macctl);
>  }
> Index: wireless-dev/drivers/net/wireless/b43legacy/b43legacy.h
> ===================================================================
> --- wireless-dev.orig/drivers/net/wireless/b43legacy/b43legacy.h
> +++ wireless-dev/drivers/net/wireless/b43legacy/b43legacy.h
> @@ -389,7 +389,7 @@ struct b43legacy_lopair {
>  struct b43legacy_phy {
>  	/* Possible PHYMODEs on this PHY */
>  	u8 possible_phymodes;
> -	/* GMODE bit enabled? */
> +	/* GMODE bit enabled in MACCTL? */
>  	bool gmode;
>  	/* Possible ieee80211 subsystem hwmodes for this PHY.
>  	 * Which mode is selected, depends on thr GMODE enabled bit */

ACK

-- 
Greetings Michael.

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

end of thread, other threads:[~2007-09-16  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-16  0:52 [PATCH V3] b43legacy: Fix machine check errors for PPC architecture with BCM4306/2 Larry Finger
2007-09-16  9:00 ` Michael Buesch

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