From: "Jordan Crouse" <jordan.crouse@amd.com>
To: "Andres Salomon" <dilinger@queued.net>
Cc: jayakumar.alsa@gmail.com, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, info-linux@geode.amd.com
Subject: Re: ALSA: cs5535audio: update PCI device handling in suspend/resume
Date: Thu, 30 Aug 2007 08:44:54 -0600 [thread overview]
Message-ID: <20070830144454.GJ5851@cosmic.amd.com> (raw)
In-Reply-To: <20070829233014.6c885eb0.dilinger@queued.net>
On 29/08/07 23:30 -0400, Andres Salomon wrote:
>
> Save the PCI state before disabling the device, and add some error checking.
>
> Signed-off-by: Andres Salomon <dilinger@debian.org>
Acked-by: Jordan Crouse <jordan.crouse@amd.com>
> ---
>
> sound/pci/cs5535audio/cs5535audio_pm.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
> index 9a4e84a..838708f 100644
> --- a/sound/pci/cs5535audio/cs5535audio_pm.c
> +++ b/sound/pci/cs5535audio/cs5535audio_pm.c
> @@ -74,8 +74,11 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
> /* save important regs, then disable aclink in hw */
> snd_cs5535audio_stop_hardware(cs5535au);
>
> + if (pci_save_state(pci)) {
> + printk(KERN_ERR "cs5535audio: pci_save_state failed!\n");
> + return -EIO;
> + }
> pci_disable_device(pci);
> - pci_save_state(pci);
> pci_set_power_state(pci, pci_choose_state(pci, state));
> return 0;
> }
> @@ -89,7 +92,12 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
> int i;
>
> pci_set_power_state(pci, PCI_D0);
> - pci_restore_state(pci);
> + if (pci_restore_state(pci) < 0) {
> + printk(KERN_ERR "cs5535audio: pci_restore_state failed, "
> + "disabling device\n");
> + snd_card_disconnect(card);
> + return -EIO;
> + }
> if (pci_enable_device(pci) < 0) {
> printk(KERN_ERR "cs5535audio: pci_enable_device failed, "
> "disabling device\n");
>
>
--
Jordan Crouse
Systems Software Development Engineer
Advanced Micro Devices, Inc.
prev parent reply other threads:[~2007-08-30 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-30 3:30 [PATCH 3/5] ALSA: cs5535audio: update PCI device handling in suspend/resume Andres Salomon
2007-08-30 14:44 ` Jordan Crouse [this message]
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=20070830144454.GJ5851@cosmic.amd.com \
--to=jordan.crouse@amd.com \
--cc=akpm@linux-foundation.org \
--cc=dilinger@queued.net \
--cc=info-linux@geode.amd.com \
--cc=jayakumar.alsa@gmail.com \
--cc=linux-kernel@vger.kernel.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