LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "roucaries bastien" <roucaries.bastien@gmail.com>
To: "Pavel Machek" <pavel@ucw.cz>
Cc: "Larry Finger" <larry.finger@lwfinger.net>,
	LKML <linux-kernel@vger.kernel.org>,
	"bcm43xx devel" <Bcm43xx-dev@lists.berlios.de>
Subject: Re: Bcm43xx oops after suspend to disk
Date: Mon, 29 Jan 2007 13:55:41 +0100	[thread overview]
Message-ID: <195c7a900701290455o3ff9fc15k305637f8ced24caf@mail.gmail.com> (raw)
In-Reply-To: <20070129115842.GA4928@ucw.cz>

On 1/29/07, Pavel Machek <pavel@ucw.cz> 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
>

  reply	other threads:[~2007-01-29 12:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <45B92488.6090908@lwfinger.net>
2007-01-25 21:46 ` Larry Finger
2007-01-25 23:30   ` roucaries bastien
2007-01-26 15:55     ` Larry Finger
2007-01-29 11:58       ` Pavel Machek
2007-01-29 12:55         ` roucaries bastien [this message]
2007-01-29 14:04           ` Matthew Garrett
2007-01-29 15:43             ` Larry Finger
2007-02-04 17:07               ` roucaries bastien
2007-02-04 17:42                 ` Larry Finger
2007-02-05  1:10                   ` Rafael J. Wysocki
2007-02-05  3:19                     ` Larry Finger
2007-01-25 19:18 roucaries bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=195c7a900701290455o3ff9fc15k305637f8ced24caf@mail.gmail.com \
    --to=roucaries.bastien@gmail.com \
    --cc=Bcm43xx-dev@lists.berlios.de \
    --cc=larry.finger@lwfinger.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --subject='Re: Bcm43xx oops after suspend to disk' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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