aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-02-26 13:34:27 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-26 10:48:01 -0400
commit9a4caec9cf9c1d95e4a59974de6d9c2797bb117f (patch)
tree6bb0a55c81da26dd21f20a109136551c4cd683ec /drivers/net/wireless
parentca18b87fd44231563f72c598c169c147b9a899c3 (diff)
b43: fall back gracefully to PIO mode after fatal DMA errors
commit 9e3bd9190800e8209b4a3e1d724c35f0738dcad2 upstream. This makes the b43 driver just automatically fall back to PIO mode when DMA doesn't work. The driver already told the user to do it, so rather than have the user reload the module with a new flag, just make the driver do it automatically. We keep the message as an indication that something is wrong, but now just automatically fall back to the hopefully working PIO case. (Some post-2.6.33 merge fixups by Larry Finger <Larry.Finger@lwfinger.net> and yours truly... -- JWL) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com> Cc: maximilian attems <max@stro.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/Kconfig17
-rw-r--r--drivers/net/wireless/b43/b43.h7
-rw-r--r--drivers/net/wireless/b43/main.c14
3 files changed, 31 insertions, 7 deletions
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index 073be566d05e..0a00d42642cd 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -3,7 +3,6 @@ config B43
3 depends on SSB_POSSIBLE && MAC80211 && HAS_DMA 3 depends on SSB_POSSIBLE && MAC80211 && HAS_DMA
4 select SSB 4 select SSB
5 select FW_LOADER 5 select FW_LOADER
6 select SSB_BLOCKIO
7 ---help--- 6 ---help---
8 b43 is a driver for the Broadcom 43xx series wireless devices. 7 b43 is a driver for the Broadcom 43xx series wireless devices.
9 8
@@ -79,6 +78,14 @@ config B43_SDIO
79 78
80 If unsure, say N. 79 If unsure, say N.
81 80
81#Data transfers to the device via PIO. We want it as a fallback even
82# if we can do DMA.
83config B43_PIO
84 bool
85 depends on B43
86 select SSB_BLOCKIO
87 default y
88
82config B43_NPHY 89config B43_NPHY
83 bool "Pre IEEE 802.11n support (BROKEN)" 90 bool "Pre IEEE 802.11n support (BROKEN)"
84 depends on B43 && EXPERIMENTAL && BROKEN 91 depends on B43 && EXPERIMENTAL && BROKEN
@@ -130,4 +137,12 @@ config B43_DEBUG
130 for production use. 137 for production use.
131 Only say Y, if you are debugging a problem in the b43 driver sourcecode. 138 Only say Y, if you are debugging a problem in the b43 driver sourcecode.
132 139
140config B43_FORCE_PIO
141 bool "Force usage of PIO instead of DMA"
142 depends on B43 && B43_DEBUG
143 ---help---
144 This will disable DMA and always enable PIO instead.
133 145
146 Say N!
147 This is only for debugging the PIO engine code. You do
148 _NOT_ want to enable this.
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index f135df5d0661..7df822e84da0 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -694,6 +694,7 @@ struct b43_wldev {
694 bool radio_hw_enable; /* saved state of radio hardware enabled state */ 694 bool radio_hw_enable; /* saved state of radio hardware enabled state */
695 bool qos_enabled; /* TRUE, if QoS is used. */ 695 bool qos_enabled; /* TRUE, if QoS is used. */
696 bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */ 696 bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */
697 bool use_pio; /* TRUE if next init should use PIO */
697 698
698 /* PHY/Radio device. */ 699 /* PHY/Radio device. */
699 struct b43_phy phy; 700 struct b43_phy phy;
@@ -878,6 +879,12 @@ static inline bool b43_using_pio_transfers(struct b43_wldev *dev)
878 return dev->__using_pio_transfers; 879 return dev->__using_pio_transfers;
879} 880}
880 881
882#ifdef CONFIG_B43_FORCE_PIO
883# define B43_PIO_DEFAULT 1
884#else
885# define B43_PIO_DEFAULT 0
886#endif
887
881/* Message printing */ 888/* Message printing */
882void b43info(struct b43_wl *wl, const char *fmt, ...) 889void b43info(struct b43_wl *wl, const char *fmt, ...)
883 __attribute__ ((format(printf, 2, 3))); 890 __attribute__ ((format(printf, 2, 3)));
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index c9a6413a67a3..9eb4f5ead6ff 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -102,9 +102,9 @@ int b43_modparam_verbose = B43_VERBOSITY_DEFAULT;
102module_param_named(verbose, b43_modparam_verbose, int, 0644); 102module_param_named(verbose, b43_modparam_verbose, int, 0644);
103MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug"); 103MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug");
104 104
105static int modparam_pio; 105int b43_modparam_pio = B43_PIO_DEFAULT;
106module_param_named(pio, modparam_pio, int, 0444); 106module_param_named(pio, b43_modparam_pio, int, 0644);
107MODULE_PARM_DESC(pio, "enable(1) / disable(0) PIO mode"); 107MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
108 108
109static const struct ssb_device_id b43_ssb_tbl[] = { 109static const struct ssb_device_id b43_ssb_tbl[] = {
110 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), 110 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5),
@@ -1793,8 +1793,9 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
1793 dma_reason[4], dma_reason[5]); 1793 dma_reason[4], dma_reason[5]);
1794 b43err(dev->wl, "This device does not support DMA " 1794 b43err(dev->wl, "This device does not support DMA "
1795 "on your system. Please use PIO instead.\n"); 1795 "on your system. Please use PIO instead.\n");
1796 b43err(dev->wl, "Unload the b43 module and reload " 1796 /* Fall back to PIO transfers if we get fatal DMA errors! */
1797 "with 'pio=1'\n"); 1797 dev->use_pio = 1;
1798 b43_controller_restart(dev, "DMA error");
1798 return; 1799 return;
1799 } 1800 }
1800 if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) { 1801 if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) {
@@ -4361,7 +4362,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
4361 4362
4362 if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) || 4363 if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) ||
4363 (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) || 4364 (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) ||
4364 modparam_pio) { 4365 dev->use_pio) {
4365 dev->__using_pio_transfers = 1; 4366 dev->__using_pio_transfers = 1;
4366 err = b43_pio_init(dev); 4367 err = b43_pio_init(dev);
4367 } else { 4368 } else {
@@ -4829,6 +4830,7 @@ static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl)
4829 if (!wldev) 4830 if (!wldev)
4830 goto out; 4831 goto out;
4831 4832
4833 wldev->use_pio = b43_modparam_pio;
4832 wldev->dev = dev; 4834 wldev->dev = dev;
4833 wldev->wl = wl; 4835 wldev->wl = wl;
4834 b43_set_status(wldev, B43_STAT_UNINIT); 4836 b43_set_status(wldev, B43_STAT_UNINIT);