diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2009-11-23 19:40:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-04 13:28:49 -0500 |
commit | c2ff581acab16c6af56d9e8c1a579bf041ec00b1 (patch) | |
tree | 28f3e0a0cd1ba7582f5681a6a3902b78fe8bb9ec /drivers/net/wireless/b43/rfkill.c | |
parent | 9bf22f2c4607dbb68beb26153d83fa52b82e2d2f (diff) |
b43: avoid PPC fault during resume
The routine b43_is_hw_radio_enabled() has long been a problem.
For PPC architecture with PHY Revision < 3, a read of the register
B43_MMIO_HWENABLED_LO will cause a CPU fault unless b43_status()
returns a value of 2 (B43_STAT_STARTED) (BUG 14181). Fixing that
results in Bug 14538 in which the driver is unable to reassociate
after resuming from hibernation because b43_status() returns 0.
The correct fix would be to determine why the status is 0; however,
I have not yet found why that happens. The correct value is found for
my device, which has PHY revision >= 3.
Returning TRUE when the PHY revision < 3 and b43_status() returns 0 fixes
the regression for 2.6.32.
This patch fixes the problem in Red Hat Bugzilla #538523.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Christian Casteyde <casteyde.christian@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/rfkill.c')
-rw-r--r-- | drivers/net/wireless/b43/rfkill.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c index ffdce6f3c909..78016ae21c50 100644 --- a/drivers/net/wireless/b43/rfkill.c +++ b/drivers/net/wireless/b43/rfkill.c | |||
@@ -33,8 +33,14 @@ bool b43_is_hw_radio_enabled(struct b43_wldev *dev) | |||
33 | & B43_MMIO_RADIO_HWENABLED_HI_MASK)) | 33 | & B43_MMIO_RADIO_HWENABLED_HI_MASK)) |
34 | return 1; | 34 | return 1; |
35 | } else { | 35 | } else { |
36 | if (b43_status(dev) >= B43_STAT_STARTED && | 36 | /* To prevent CPU fault on PPC, do not read a register |
37 | b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO) | 37 | * unless the interface is started; however, on resume |
38 | * for hibernation, this routine is entered early. When | ||
39 | * that happens, unconditionally return TRUE. | ||
40 | */ | ||
41 | if (b43_status(dev) < B43_STAT_STARTED) | ||
42 | return 1; | ||
43 | if (b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO) | ||
38 | & B43_MMIO_RADIO_HWENABLED_LO_MASK) | 44 | & B43_MMIO_RADIO_HWENABLED_LO_MASK) |
39 | return 1; | 45 | return 1; |
40 | } | 46 | } |