This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 253988 - Suspend/Resume tg3 does not work correctly
Suspend/Resume tg3 does not work correctly
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.1
All Linux
high Severity high
: ---
: ---
Assigned To: Andy Gospodarek
Martin Jenner
:
Depends On:
Blocks: 235665
  Show dependency treegraph
 
Reported: 2007-08-23 09:30 EDT by Traxtopel
Modified: 2014-06-29 18:59 EDT (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2007-0959
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-07 15:01:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Solves issue, patches cleanly against 2.6.18-43.el5 (1.39 KB, patch)
2007-08-24 07:35 EDT, Traxtopel
no flags Details | Diff
requested patch (1.37 KB, patch)
2007-08-24 14:08 EDT, Andy Gospodarek
no flags Details | Diff

  None (edit)
Description Traxtopel 2007-08-23 09:30:20 EDT
Description of problem:
On a IBM Thinkpad t43 tg3 device does not suspend correctly.

ref :-
Joachim Deguara <[EMAIL PROTECTED]> reported that tg3 devices
    would not resume properly if the device was shutdown before the system
    was suspended.  In such scenario where the netif_running state is 0,
    tg3_suspend() would not save the PCI state and so the memory enable bit
    and bus master enable bit would be lost.
    
    We fix this by always saving and restoring the PCI state in
    tg3_suspend() and tg3_resume() regardless of netif_running() state.

There is a small patch available via
http://www.mail-archive.com/git-commits-head@vger.kernel.org/msg20264.html
has been submitted to git.

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index dc41c05..5874042 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.79"
-#define DRV_MODULE_RELDATE     "July 18, 2007"
+#define DRV_MODULE_VERSION     "3.80"
+#define DRV_MODULE_RELDATE     "August 2, 2007"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -12111,6 +12111,12 @@ static int tg3_suspend(struct pci_dev *pdev, 
pm_message_t state)
        struct tg3 *tp = netdev_priv(dev);
        int err;
 
+       /* PCI register 4 needs to be saved whether netif_running() or not.
+        * MSI address and data need to be saved if using MSI and
+        * netif_running().
+        */
+       pci_save_state(pdev);
+
        if (!netif_running(dev))
                return 0;
 
@@ -12130,9 +12136,6 @@ static int tg3_suspend(struct pci_dev *pdev, 
pm_message_t state)
        tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
        tg3_full_unlock(tp);
 
-       /* Save MSI address and data for resume.  */
-       pci_save_state(pdev);
-
        err = tg3_set_power_state(tp, pci_choose_state(pdev, state));
        if (err) {
                tg3_full_lock(tp, 0);
@@ -12160,11 +12163,11 @@ static int tg3_resume(struct pci_dev *pdev)
        struct tg3 *tp = netdev_priv(dev);
        int err;
 
+       pci_restore_state(tp->pdev);
+
        if (!netif_running(dev))
                return 0;
 
-       pci_restore_state(tp->pdev);
-
        err = tg3_set_power_state(tp, PCI_D0);
        if (err)
                return err;

Is this too late for U1?

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 3 Traxtopel 2007-08-24 07:35:40 EDT
Created attachment 172403 [details]
Solves issue, patches cleanly against 2.6.18-43.el5
Comment 5 Andy Gospodarek 2007-08-24 14:08:54 EDT
Created attachment 172443 [details]
requested patch

Here is the patch I will attempt to include in 5.1
Comment 6 Peter Martuccelli 2007-08-24 15:31:10 EDT
Susopend resume is one of the targeted features for R5.1.
Comment 9 Don Zickus 2007-08-28 18:36:43 EDT
in 2.6.18-44.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5
Comment 10 Traxtopel 2007-08-30 07:26:32 EDT
Confirmed, works like a charm.
Comment 11 Andy Gospodarek 2007-08-30 08:57:55 EDT
Excellent!  :-)
Comment 14 errata-xmlrpc 2007-11-07 15:01:08 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0959.html

Note You need to log in before you can comment on or make changes to this bug.