lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070830144454.GJ5851@cosmic.amd.com>
Date:	Thu, 30 Aug 2007 08:44:54 -0600
From:	"Jordan Crouse" <jordan.crouse@....com>
To:	"Andres Salomon" <dilinger@...ued.net>
cc:	jayakumar.alsa@...il.com, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, info-linux@...de.amd.com
Subject: Re: ALSA: cs5535audio: update PCI device handling in
 suspend/resume

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@...ian.org>
Acked-by: Jordan Crouse <jordan.crouse@....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.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ