public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add pci_save_state() to ALSA
@ 2004-11-11 20:39 Martin Josefsson
  2004-11-12  9:22 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Josefsson @ 2004-11-11 20:39 UTC (permalink / raw)
  To: perex; +Cc: akpm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

Hi

Some time ago, a patch was merged that removed pci_save_state() and
pci_restore_state() from various drivers. That patch also added
pci_restore_state() to sound/core/init.c but didn't add pci_save_state()
anywhere.

My laptop doesn't resume (gets what I assume is an ACPI timeout and
hangs solid) without this small obvious patch.

Signed-off-by: Martin Josefsson <gandalf@wlug.westbo.se>

--- linux-2.6.10-rc1-bk21.orig/sound/core/init.c	2004-11-11 18:51:17.000000000 +0100
+++ linux-2.6.10-rc1-bk21/sound/core/init.c	2004-11-11 20:57:52.000000000 +0100
@@ -789,6 +789,8 @@ int snd_card_pci_suspend(struct pci_dev 
 		return 0;
 	if (card->power_state == SNDRV_CTL_POWER_D3hot)
 		return 0;
+	/* save the PCI config space */
+	pci_save_state(dev);
 	/* FIXME: correct state value? */
 	return card->pm_suspend(card, 0);
 }

-- 
/Martin

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: [PATCH] Add pci_save_state() to ALSA
@ 2004-11-12 13:00 Zhu, Yi
  2004-11-12 13:26 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Zhu, Yi @ 2004-11-12 13:00 UTC (permalink / raw)
  To: Takashi Iwai, Martin Josefsson; +Cc: perex, akpm, linux-kernel

Takashi Iwai wrote:
> pci_save_state() is called internally in
> drivers/pci/pci-driver.c:pci_device_suspend(), so it's redundant.
> 
>> My laptop doesn't resume (gets what I assume is an ACPI timeout and
>> hangs solid) without this small obvious patch.
> 
> I'm wondering how this can fix your problem...

For example, some devices call pci_save_state before pci_disable_device
in
->suspend, but don't pci_enable_device in ->resume. This works before,
but 
is broken after the pci_save_state() change. We need to find those
drivers out
and change the individual drivers instead of this simple fix.

Martin, which sound driver do you use?

Thanks,
-yi

>> Signed-off-by: Martin Josefsson <gandalf@wlug.westbo.se>
>> 
>> --- linux-2.6.10-rc1-bk21.orig/sound/core/init.c
> 2004-11-11 18:51:17.000000000 +0100
>> +++ linux-2.6.10-rc1-bk21/sound/core/init.c	2004-11-11
>> 20:57:52.000000000 +0100 @@ -789,6 +789,8 @@ int
>>  	snd_card_pci_suspend(struct pci_dev  		return 0; if
>>  		(card->power_state == SNDRV_CTL_POWER_D3hot) return 0;
>> +	/* save the PCI config space */
>> +	pci_save_state(dev);
>>  	/* FIXME: correct state value? */
>>  	return card->pm_suspend(card, 0);
>>  }
>> 
>> --
>> /Martin
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in the body of a message to
> majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-11-12 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-11 20:39 [PATCH] Add pci_save_state() to ALSA Martin Josefsson
2004-11-12  9:22 ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2004-11-12 13:00 Zhu, Yi
2004-11-12 13:26 ` Takashi Iwai
2004-11-12 13:45   ` Arjan van de Ven
2004-11-12 13:58     ` Takashi Iwai
2004-11-12 16:12       ` Martin Josefsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox