From: Pavel Machek <pavel@suse.cz>
To: Jason Lunz <lunz@falooley.org>
Cc: Vojtech Pavlik <vojtech@suse.cz>,
linux-ide@vger.kernel.org, linux-pm@lists.osdl.org
Subject: Re: [patch, rft] amd74xx: implement suspend-to-ram
Date: Wed, 26 Jul 2006 01:09:55 +0200 [thread overview]
Message-ID: <20060725230955.GB7220@elf.ucw.cz> (raw)
In-Reply-To: <20060724005340.GA4073@opus.vpn-dev.reflex>
Hi!
I do not have the affected hardware, sorry.
> Index: linux-2.6.18-rc2-git1/drivers/ide/pci/amd74xx.c
> ===================================================================
> --- linux-2.6.18-rc2-git1.orig/drivers/ide/pci/amd74xx.c
> +++ linux-2.6.18-rc2-git1/drivers/ide/pci/amd74xx.c
> @@ -494,6 +498,53 @@
> /* 19 */ DECLARE_AMD_DEV("AMD5536"),
> };
>
> +static int amd74xx_suspend(struct pci_dev *dev, pm_message_t state)
> +{
> + pci_save_state(dev);
> +
> + // PM_EVENT_SUSPEND means s2ram. otherwise, the disk behind this device
> + // might hold the s2disk image, and we can't disable the disk
> + // controller until we've used it to write that out.
C-style comments, please.
> + if(state.event == PM_EVENT_SUSPEND) {
"if (". Ouch and please don't do this. Suspend-to-disk will call
amd74xx_resume when it needs to talk to the disk.
> + pci_disable_device(dev);
> + pci_set_power_state(dev, pci_choose_state(dev, state));
> + }
> + return 0;
> +}
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2006-07-25 23:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-15 21:05 amd74xx crashes when resuming from STR Jason Lunz
2006-07-18 4:34 ` [linux-pm] " Pavel Machek
2006-07-18 4:35 ` Pavel Machek
[not found] ` <19700101003716.GA3558@ucw.cz>
2006-07-18 13:39 ` [linux-pm] " Vojtech Pavlik
2006-07-24 0:53 ` [patch, rft] amd74xx: implement suspend-to-ram Jason Lunz
2006-07-25 23:09 ` Pavel Machek [this message]
2006-07-26 0:27 ` [linux-pm] " David Brownell
2006-07-26 2:45 ` [patch v2] amd74xx: fix hang on resume from ram Jason Lunz
2006-07-26 3:14 ` [patch v3] " Jason Lunz
2006-07-27 20:35 ` David Brownell
2006-07-26 9:02 ` [linux-pm] [patch, rft] amd74xx: implement suspend-to-ram Pavel Machek
2006-07-27 0:29 ` David Brownell
2006-07-27 20:49 ` Pavel Machek
2006-07-27 22:43 ` Jason Lunz
2006-07-27 22:51 ` Pavel Machek
2006-07-28 9:15 ` Rafael J. Wysocki
2006-07-28 13:23 ` Vojtech Pavlik
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=20060725230955.GB7220@elf.ucw.cz \
--to=pavel@suse.cz \
--cc=linux-ide@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=lunz@falooley.org \
--cc=vojtech@suse.cz \
/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