Re: Bcm43xx oops after suspend to disk

From: roucaries bastien
Date: Mon Jan 29 2007 - 07:56:02 EST


On 1/29/07, Pavel Machek <pavel@xxxxxx> wrote:
Hi!

> >> Do you have the log stuff that precedes this part? In particular, was
> >> there a assertion that failed?
> >>
> > It is oops on resume and no asseertion failled this boot. However I
> > have usually a lot of
> > bcm43xx: ASSERTION FAILED (radio_attenuation < 10) at:
> > drivers/net/wireless/bcm43xx/bcm43xx_phy.c:1496:bcm43xx_find_lopair()
>
> Those are well known and do not affect this problem.
>
> > Moreover after the first oops I have a second oops (Surelly a
> > consequence of the first).
>
> I think that is right.
>
> Unfortunately, I cannot test for this problem on my system as it doesn't suspend at all.

Can you try to debug that? swsusp is very easy to get going these
days. And with minimum drivers, it tends to work very reliably. Any
help I can provide?

I don't think so. Larry sends me a patch I will test it this week
(perhaps tomorow or thursday). Thank you

index: linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- linux-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -4244,30 +4244,12 @@ static int bcm43xx_suspend(struct pci_de
{
struct net_device *net_dev = pci_get_drvdata(pdev);
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
- int err;

dprintk(KERN_INFO PFX "Suspending...\n");
-
- netif_device_detach(net_dev);
- bcm->was_initialized = 0;
- if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) {
- bcm->was_initialized = 1;
- ieee80211softmac_stop(net_dev);
- err = bcm43xx_disable_interrupts_sync(bcm);
- if (unlikely(err)) {
- dprintk(KERN_ERR PFX "Suspend failed.\n");
- return -EAGAIN;
- }
- bcm->firmware_norelease = 1;
- bcm43xx_free_board(bcm);
- bcm->firmware_norelease = 0;
- }
- bcm43xx_chipset_detach(bcm);
-
- pci_save_state(pdev);
- pci_disable_device(pdev);
- pci_set_power_state(pdev, pci_choose_state(pdev, state));
-
+ bcm43xx_debugfs_remove_device(bcm);
+ unregister_netdev(net_dev);
+ bcm43xx_detach_board(bcm);
+ free_ieee80211softmac(net_dev);
dprintk(KERN_INFO PFX "Device suspended.\n");

return 0;
@@ -4275,32 +4257,9 @@ static int bcm43xx_suspend(struct pci_de

static int bcm43xx_resume(struct pci_dev *pdev)
{
- struct net_device *net_dev = pci_get_drvdata(pdev);
- struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
- int err = 0;
-
dprintk(KERN_INFO PFX "Resuming...\n");

- pci_set_power_state(pdev, 0);
- err = pci_enable_device(pdev);
- if (err) {
- printk(KERN_ERR PFX "Failure with pci_enable_device!\n");
- return err;
- }
- pci_restore_state(pdev);
-
- bcm43xx_chipset_attach(bcm);
- if (bcm->was_initialized)
- err = bcm43xx_init_board(bcm);
- if (err) {
- printk(KERN_ERR PFX "Resume failed!\n");
- return err;
- }
- netif_device_attach(net_dev);
-
- dprintk(KERN_INFO PFX "Device resumed.\n");
-
- return 0;
+ return bcm43xx_init_one(pdev, NULL);
}

#endif /* CONFIG_PM */







Index: linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- linux-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -4244,30 +4244,12 @@ static int bcm43xx_suspend(struct pci_de
{
struct net_device *net_dev = pci_get_drvdata(pdev);
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
- int err;

dprintk(KERN_INFO PFX "Suspending...\n");
-
- netif_device_detach(net_dev);
- bcm->was_initialized = 0;
- if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) {
- bcm->was_initialized = 1;
- ieee80211softmac_stop(net_dev);
- err = bcm43xx_disable_interrupts_sync(bcm);
- if (unlikely(err)) {
- dprintk(KERN_ERR PFX "Suspend failed.\n");
- return -EAGAIN;
- }
- bcm->firmware_norelease = 1;
- bcm43xx_free_board(bcm);
- bcm->firmware_norelease = 0;
- }
- bcm43xx_chipset_detach(bcm);
-
- pci_save_state(pdev);
- pci_disable_device(pdev);
- pci_set_power_state(pdev, pci_choose_state(pdev, state));
-
+ bcm43xx_debugfs_remove_device(bcm);
+ unregister_netdev(net_dev);
+ bcm43xx_detach_board(bcm);
+ free_ieee80211softmac(net_dev);
dprintk(KERN_INFO PFX "Device suspended.\n");

return 0;
@@ -4275,32 +4257,9 @@ static int bcm43xx_suspend(struct pci_de

static int bcm43xx_resume(struct pci_dev *pdev)
{
- struct net_device *net_dev = pci_get_drvdata(pdev);
- struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
- int err = 0;
-
dprintk(KERN_INFO PFX "Resuming...\n");

- pci_set_power_state(pdev, 0);
- err = pci_enable_device(pdev);
- if (err) {
- printk(KERN_ERR PFX "Failure with pci_enable_device!\n");
- return err;
- }
- pci_restore_state(pdev);
-
- bcm43xx_chipset_attach(bcm);
- if (bcm->was_initialized)
- err = bcm43xx_init_board(bcm);
- if (err) {
- printk(KERN_ERR PFX "Resume failed!\n");
- return err;
- }
- netif_device_attach(net_dev);
-
- dprintk(KERN_INFO PFX "Device resumed.\n");
-
- return 0;
+ return bcm43xx_init_one(pdev, NULL);
}

#endif /* CONFIG_PM */

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/