public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Karsten Keil <kkeil@suse.de>
Cc: akpm@osdl.org, torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix tulip suspend/resume
Date: Tue, 07 Jun 2005 12:15:44 +1000	[thread overview]
Message-ID: <1118110545.6850.31.camel@gaston> (raw)
In-Reply-To: <20050606224645.GA23989@pingi3.kke.suse.de>

On Tue, 2005-06-07 at 00:46 +0200, Karsten Keil wrote:
> Hi,
> 
> following patch fix the suspend/resume for tulip based
> cards, so suspend on disk work now for me and tulip based
> cardbus cards.
> 
> 
> Signed-off-by: Karsten Keil <kkeil@suse.de>
> 
> --- linux/drivers/net/tulip/tulip_core.c.orig	2005-03-23 23:54:43.000000000 +0100
> +++ linux/drivers/net/tulip/tulip_core.c	2005-05-26 17:29:14.000000000 +0200
> @@ -1755,12 +1755,16 @@
>  static int tulip_suspend (struct pci_dev *pdev, pm_message_t state)
>  {
>  	struct net_device *dev = pci_get_drvdata(pdev);
> +	int err;
>  
> +	pci_save_state(pdev);
>  	if (dev && netif_running (dev) && netif_device_present (dev)) {
>  		netif_device_detach (dev);
>  		tulip_down (dev);
>  		/* pci_power_off(pdev, -1); */
>  	}
> +	if ((err = pci_set_power_state(pdev, PCI_D3hot)))
> +		printk(KERN_ERR "%s: pci_set_power_state D3hot return %d\n", dev->name, err);
>  	return 0;
>  }

It should probably test for message state, it's not worth doing
pci_set_power_state(D3) if PMSG_FREEZE is passed... (just slows down
suspend to disk)

> @@ -1768,7 +1772,11 @@
>  static int tulip_resume(struct pci_dev *pdev)
>  {
>  	struct net_device *dev = pci_get_drvdata(pdev);
> +	int err;
>  
> +	if ((err = pci_set_power_state(pdev, PCI_D0)))
> +		printk(KERN_ERR "%s: pci_set_power_state D0 return %d\n", dev->name, err);
> +	pci_restore_state(pdev);
>  	if (dev && netif_running (dev) && !netif_device_present (dev)) {
>  #if 1
>  		pci_enable_device (pdev);
> 


  parent reply	other threads:[~2005-06-07  2:20 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-06 22:46 [PATCH] fix tulip suspend/resume Karsten Keil
2005-06-07  0:04 ` Linus Torvalds
2005-06-07  2:50   ` Adam Belay
2005-06-07  3:34     ` Benjamin Herrenschmidt
2005-06-07  3:58       ` Adam Belay
2005-06-07  4:26         ` Benjamin Herrenschmidt
2005-06-07  5:34           ` Adam Belay
2005-06-07  5:50             ` Benjamin Herrenschmidt
2005-06-07 10:55     ` Karsten Keil
2005-06-07 20:58       ` Adam Belay
2005-06-08  0:26         ` Benjamin Herrenschmidt
2005-06-08  2:16           ` Adam Belay
2005-06-08 12:23             ` Pavel Machek
2005-06-08 23:00               ` Benjamin Herrenschmidt
2005-06-09  0:04                 ` Pavel Machek
2005-06-09  0:38                   ` Adam Belay
2005-06-09 10:51                     ` Pavel Machek
2005-06-09  2:49                   ` Nigel Cunningham
2005-06-09  8:27                   ` Karsten Keil
2005-06-08 12:19           ` Pavel Machek
2005-06-08  6:39         ` Karsten Keil
2005-06-08 18:11           ` Davide Rossetti
2005-06-09  1:48             ` Adam Belay
2005-06-07 11:52   ` Stefan Seyfried
2005-06-07  2:15 ` Benjamin Herrenschmidt [this message]
2005-06-07  2:57   ` Adam Belay
2005-06-07  3:32     ` Benjamin Herrenschmidt
2005-06-07  3:42       ` Adam Belay
2005-06-07  4:29         ` Benjamin Herrenschmidt
2005-06-07  5:03           ` Adam Belay
2005-06-07  5:51             ` Nigel Cunningham
2005-06-07  5:55               ` Benjamin Herrenschmidt
2005-06-07 15:10   ` Pavel Machek

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=1118110545.6850.31.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox