* Re: [PATCH 1/1] b43: do not call ieee80211_unregister_hw if we are not registred
[not found] ` <1338536240-4392-2-git-send-email-bug-track@fisher-privat.net>
@ 2012-06-05 16:49 ` Seth Forshee
2012-06-05 18:24 ` John W. Linville
0 siblings, 1 reply; 4+ messages in thread
From: Seth Forshee @ 2012-06-05 16:49 UTC (permalink / raw)
To: Oleksij Rempel
Cc: b43-dev, Stefano Brivio, Larry Finger, John W. Linville,
linux-wireless
(I don't have access to the original message, so I appologize if any
Cc's were dropped. I added some additional Cc's.)
On Fri, Jun 01, 2012 at 09:37:20AM +0200, Oleksij Rempel wrote:
> this patch fixes kernel Oops on "rmmod b43" if firmware was not loaded:
>
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
> IP: [<ffffffff8104e988>] drain_workqueue+0x25/0x142
> PGD 153ac6067 PUD 153b82067 PMD 0
> Oops: 0000 [#1] SMP
>
> Signed-off-by: Oleksij Rempel <bug-track-M18mAb7Tlt0yCq4wW13eYl6hYfS7NtTn@public.gmane.org>
This issue is affecting the Ubuntu installer, and I've verified the
patch fixes the problem on a Mac Mini 5,2.
Tested-by: Seth Forshee <seth.forshee@canonical.com>
This issue affects 3.4, probably introduced in 6b6fa58 (b43: Load
firmware from a work queue and not from the probe routine), so I'd
suggest a Cc for stable also be added.
> ---
> drivers/net/wireless/b43/b43.h | 4 ++++
> drivers/net/wireless/b43/main.c | 19 ++++++++++++-------
> 2 files changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
> index 67c13af..c06b6cb 100644
> --- a/drivers/net/wireless/b43/b43.h
> +++ b/drivers/net/wireless/b43/b43.h
> @@ -877,6 +877,10 @@ struct b43_wl {
> * from the mac80211 subsystem. */
> u16 mac80211_initially_registered_queues;
>
> + /* Set this if we call ieee80211_register_hw() and check if we call
> + * ieee80211_unregister_hw(). */
> + bool hw_registred;
> +
> /* We can only have one operating interface (802.11 core)
> * at a time. General information about this interface follows.
> */
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index e4d6dc2..747079b 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -2437,6 +2437,7 @@ start_ieee80211:
> err = ieee80211_register_hw(wl->hw);
> if (err)
> goto err_one_core_detach;
> + wl->hw_registred = true;
> b43_leds_register(wl->current_dev);
> goto out;
>
> @@ -5283,6 +5284,7 @@ static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev)
>
> hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1;
> wl->mac80211_initially_registered_queues = hw->queues;
> + wl->hw_registred = false;
> hw->max_rates = 2;
> SET_IEEE80211_DEV(hw, dev->dev);
> if (is_valid_ether_addr(sprom->et1mac))
> @@ -5354,12 +5356,15 @@ static void b43_bcma_remove(struct bcma_device *core)
> * as the ieee80211 unreg will destroy the workqueue. */
> cancel_work_sync(&wldev->restart_work);
>
> - /* Restore the queues count before unregistering, because firmware detect
> - * might have modified it. Restoring is important, so the networking
> - * stack can properly free resources. */
> - wl->hw->queues = wl->mac80211_initially_registered_queues;
> - b43_leds_stop(wldev);
> - ieee80211_unregister_hw(wl->hw);
> + B43_WARN_ON(!wl);
> + if (wl->current_dev == wldev && wl->hw_registred) {
> + /* Restore the queues count before unregistering, because firmware detect
> + * might have modified it. Restoring is important, so the networking
> + * stack can properly free resources. */
> + wl->hw->queues = wl->mac80211_initially_registered_queues;
> + b43_leds_stop(wldev);
> + ieee80211_unregister_hw(wl->hw);
> + }
>
> b43_one_core_detach(wldev->dev);
>
> @@ -5430,7 +5435,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
> cancel_work_sync(&wldev->restart_work);
>
> B43_WARN_ON(!wl);
> - if (wl->current_dev == wldev) {
> + if (wl->current_dev == wldev && wl->hw_registred) {
> /* Restore the queues count before unregistering, because firmware detect
> * might have modified it. Restoring is important, so the networking
> * stack can properly free resources. */
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] b43: do not call ieee80211_unregister_hw if we are not registred
2012-06-05 16:49 ` [PATCH 1/1] b43: do not call ieee80211_unregister_hw if we are not registred Seth Forshee
@ 2012-06-05 18:24 ` John W. Linville
2012-06-05 18:53 ` [PATCH] " Seth Forshee
0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2012-06-05 18:24 UTC (permalink / raw)
To: Seth Forshee
Cc: Oleksij Rempel, b43-dev, Stefano Brivio, Larry Finger,
linux-wireless
Could someone repost a clean version to linux-wireless@vger.kernel.org?
On Tue, Jun 05, 2012 at 11:49:45AM -0500, Seth Forshee wrote:
> (I don't have access to the original message, so I appologize if any
> Cc's were dropped. I added some additional Cc's.)
>
> On Fri, Jun 01, 2012 at 09:37:20AM +0200, Oleksij Rempel wrote:
> > this patch fixes kernel Oops on "rmmod b43" if firmware was not loaded:
> >
> > BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
> > IP: [<ffffffff8104e988>] drain_workqueue+0x25/0x142
> > PGD 153ac6067 PUD 153b82067 PMD 0
> > Oops: 0000 [#1] SMP
> >
> > Signed-off-by: Oleksij Rempel <bug-track-M18mAb7Tlt0yCq4wW13eYl6hYfS7NtTn@public.gmane.org>
>
> This issue is affecting the Ubuntu installer, and I've verified the
> patch fixes the problem on a Mac Mini 5,2.
>
> Tested-by: Seth Forshee <seth.forshee@canonical.com>
>
> This issue affects 3.4, probably introduced in 6b6fa58 (b43: Load
> firmware from a work queue and not from the probe routine), so I'd
> suggest a Cc for stable also be added.
>
> > ---
> > drivers/net/wireless/b43/b43.h | 4 ++++
> > drivers/net/wireless/b43/main.c | 19 ++++++++++++-------
> > 2 files changed, 16 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
> > index 67c13af..c06b6cb 100644
> > --- a/drivers/net/wireless/b43/b43.h
> > +++ b/drivers/net/wireless/b43/b43.h
> > @@ -877,6 +877,10 @@ struct b43_wl {
> > * from the mac80211 subsystem. */
> > u16 mac80211_initially_registered_queues;
> >
> > + /* Set this if we call ieee80211_register_hw() and check if we call
> > + * ieee80211_unregister_hw(). */
> > + bool hw_registred;
> > +
> > /* We can only have one operating interface (802.11 core)
> > * at a time. General information about this interface follows.
> > */
> > diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> > index e4d6dc2..747079b 100644
> > --- a/drivers/net/wireless/b43/main.c
> > +++ b/drivers/net/wireless/b43/main.c
> > @@ -2437,6 +2437,7 @@ start_ieee80211:
> > err = ieee80211_register_hw(wl->hw);
> > if (err)
> > goto err_one_core_detach;
> > + wl->hw_registred = true;
> > b43_leds_register(wl->current_dev);
> > goto out;
> >
> > @@ -5283,6 +5284,7 @@ static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev)
> >
> > hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1;
> > wl->mac80211_initially_registered_queues = hw->queues;
> > + wl->hw_registred = false;
> > hw->max_rates = 2;
> > SET_IEEE80211_DEV(hw, dev->dev);
> > if (is_valid_ether_addr(sprom->et1mac))
> > @@ -5354,12 +5356,15 @@ static void b43_bcma_remove(struct bcma_device *core)
> > * as the ieee80211 unreg will destroy the workqueue. */
> > cancel_work_sync(&wldev->restart_work);
> >
> > - /* Restore the queues count before unregistering, because firmware detect
> > - * might have modified it. Restoring is important, so the networking
> > - * stack can properly free resources. */
> > - wl->hw->queues = wl->mac80211_initially_registered_queues;
> > - b43_leds_stop(wldev);
> > - ieee80211_unregister_hw(wl->hw);
> > + B43_WARN_ON(!wl);
> > + if (wl->current_dev == wldev && wl->hw_registred) {
> > + /* Restore the queues count before unregistering, because firmware detect
> > + * might have modified it. Restoring is important, so the networking
> > + * stack can properly free resources. */
> > + wl->hw->queues = wl->mac80211_initially_registered_queues;
> > + b43_leds_stop(wldev);
> > + ieee80211_unregister_hw(wl->hw);
> > + }
> >
> > b43_one_core_detach(wldev->dev);
> >
> > @@ -5430,7 +5435,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
> > cancel_work_sync(&wldev->restart_work);
> >
> > B43_WARN_ON(!wl);
> > - if (wl->current_dev == wldev) {
> > + if (wl->current_dev == wldev && wl->hw_registred) {
> > /* Restore the queues count before unregistering, because firmware detect
> > * might have modified it. Restoring is important, so the networking
> > * stack can properly free resources. */
> > --
> > 1.7.9.5
> >
>
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] b43: do not call ieee80211_unregister_hw if we are not registred
2012-06-05 18:39 [PATCH 0/1 ] " Oleksij Rempel
@ 2012-06-05 18:39 ` Oleksij Rempel
0 siblings, 0 replies; 4+ messages in thread
From: Oleksij Rempel @ 2012-06-05 18:39 UTC (permalink / raw)
To: linux-wireless, linville; +Cc: Oleksij Rempel
this patch fixes kernel Oops on "rmmod b43" if firmware was not loaded:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
IP: [<ffffffff8104e988>] drain_workqueue+0x25/0x142
PGD 153ac6067 PUD 153b82067 PMD 0
Oops: 0000 [#1] SMP
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
---
drivers/net/wireless/b43/b43.h | 4 ++++
drivers/net/wireless/b43/main.c | 19 ++++++++++++-------
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 67c13af..c06b6cb 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -877,6 +877,10 @@ struct b43_wl {
* from the mac80211 subsystem. */
u16 mac80211_initially_registered_queues;
+ /* Set this if we call ieee80211_register_hw() and check if we call
+ * ieee80211_unregister_hw(). */
+ bool hw_registred;
+
/* We can only have one operating interface (802.11 core)
* at a time. General information about this interface follows.
*/
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index e4d6dc2..747079b 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2437,6 +2437,7 @@ start_ieee80211:
err = ieee80211_register_hw(wl->hw);
if (err)
goto err_one_core_detach;
+ wl->hw_registred = true;
b43_leds_register(wl->current_dev);
goto out;
@@ -5283,6 +5284,7 @@ static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev)
hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1;
wl->mac80211_initially_registered_queues = hw->queues;
+ wl->hw_registred = false;
hw->max_rates = 2;
SET_IEEE80211_DEV(hw, dev->dev);
if (is_valid_ether_addr(sprom->et1mac))
@@ -5354,12 +5356,15 @@ static void b43_bcma_remove(struct bcma_device *core)
* as the ieee80211 unreg will destroy the workqueue. */
cancel_work_sync(&wldev->restart_work);
- /* Restore the queues count before unregistering, because firmware detect
- * might have modified it. Restoring is important, so the networking
- * stack can properly free resources. */
- wl->hw->queues = wl->mac80211_initially_registered_queues;
- b43_leds_stop(wldev);
- ieee80211_unregister_hw(wl->hw);
+ B43_WARN_ON(!wl);
+ if (wl->current_dev == wldev && wl->hw_registred) {
+ /* Restore the queues count before unregistering, because firmware detect
+ * might have modified it. Restoring is important, so the networking
+ * stack can properly free resources. */
+ wl->hw->queues = wl->mac80211_initially_registered_queues;
+ b43_leds_stop(wldev);
+ ieee80211_unregister_hw(wl->hw);
+ }
b43_one_core_detach(wldev->dev);
@@ -5430,7 +5435,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
cancel_work_sync(&wldev->restart_work);
B43_WARN_ON(!wl);
- if (wl->current_dev == wldev) {
+ if (wl->current_dev == wldev && wl->hw_registred) {
/* Restore the queues count before unregistering, because firmware detect
* might have modified it. Restoring is important, so the networking
* stack can properly free resources. */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] b43: do not call ieee80211_unregister_hw if we are not registred
2012-06-05 18:24 ` John W. Linville
@ 2012-06-05 18:53 ` Seth Forshee
0 siblings, 0 replies; 4+ messages in thread
From: Seth Forshee @ 2012-06-05 18:53 UTC (permalink / raw)
To: John W. Linville, linux-wireless
Cc: Oleksij Rempel, b43-dev, Stefano Brivio, Larry Finger
From: Oleksij Rempel <bug-track@fisher-privat.net>
this patch fixes kernel Oops on "rmmod b43" if firmware was not loaded:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
IP: [<ffffffff8104e988>] drain_workqueue+0x25/0x142
PGD 153ac6067 PUD 153b82067 PMD 0
Oops: 0000 [#1] SMP
Cc: stable@vger.kernel.org
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Tested-by: Seth Forshee <seth.forshee@canonical.com>
---
drivers/net/wireless/b43/b43.h | 4 ++++
drivers/net/wireless/b43/main.c | 19 ++++++++++++-------
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 67c13af..c06b6cb 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -877,6 +877,10 @@ struct b43_wl {
* from the mac80211 subsystem. */
u16 mac80211_initially_registered_queues;
+ /* Set this if we call ieee80211_register_hw() and check if we call
+ * ieee80211_unregister_hw(). */
+ bool hw_registred;
+
/* We can only have one operating interface (802.11 core)
* at a time. General information about this interface follows.
*/
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index e4d6dc2..747079b 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2437,6 +2437,7 @@ start_ieee80211:
err = ieee80211_register_hw(wl->hw);
if (err)
goto err_one_core_detach;
+ wl->hw_registred = true;
b43_leds_register(wl->current_dev);
goto out;
@@ -5283,6 +5284,7 @@ static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev)
hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1;
wl->mac80211_initially_registered_queues = hw->queues;
+ wl->hw_registred = false;
hw->max_rates = 2;
SET_IEEE80211_DEV(hw, dev->dev);
if (is_valid_ether_addr(sprom->et1mac))
@@ -5354,12 +5356,15 @@ static void b43_bcma_remove(struct bcma_device *core)
* as the ieee80211 unreg will destroy the workqueue. */
cancel_work_sync(&wldev->restart_work);
- /* Restore the queues count before unregistering, because firmware detect
- * might have modified it. Restoring is important, so the networking
- * stack can properly free resources. */
- wl->hw->queues = wl->mac80211_initially_registered_queues;
- b43_leds_stop(wldev);
- ieee80211_unregister_hw(wl->hw);
+ B43_WARN_ON(!wl);
+ if (wl->current_dev == wldev && wl->hw_registred) {
+ /* Restore the queues count before unregistering, because firmware detect
+ * might have modified it. Restoring is important, so the networking
+ * stack can properly free resources. */
+ wl->hw->queues = wl->mac80211_initially_registered_queues;
+ b43_leds_stop(wldev);
+ ieee80211_unregister_hw(wl->hw);
+ }
b43_one_core_detach(wldev->dev);
@@ -5430,7 +5435,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
cancel_work_sync(&wldev->restart_work);
B43_WARN_ON(!wl);
- if (wl->current_dev == wldev) {
+ if (wl->current_dev == wldev && wl->hw_registred) {
/* Restore the queues count before unregistering, because firmware detect
* might have modified it. Restoring is important, so the networking
* stack can properly free resources. */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-05 18:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1338536240-4392-1-git-send-email-bug-track@fisher-privat.net>
[not found] ` <1338536240-4392-2-git-send-email-bug-track@fisher-privat.net>
2012-06-05 16:49 ` [PATCH 1/1] b43: do not call ieee80211_unregister_hw if we are not registred Seth Forshee
2012-06-05 18:24 ` John W. Linville
2012-06-05 18:53 ` [PATCH] " Seth Forshee
2012-06-05 18:39 [PATCH 0/1 ] " Oleksij Rempel
2012-06-05 18:39 ` [PATCH 1/1] " Oleksij Rempel
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).