All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Arjan van de Ven <arjan@infradead.org>
Cc: "Zhu, Yi" <yi.zhu@intel.com>,
	Martin Josefsson <gandalf@wlug.westbo.se>,
	perex@suse.cz, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add pci_save_state() to ALSA
Date: Fri, 12 Nov 2004 14:58:32 +0100	[thread overview]
Message-ID: <s5hvfcbdv93.wl@alsa2.suse.de> (raw)
In-Reply-To: <1100267140.4096.7.camel@laptop.fenrus.org>

At Fri, 12 Nov 2004 14:45:40 +0100,
Arjan van de Ven wrote:
> 
> On Fri, 2004-11-12 at 14:26 +0100, Takashi Iwai wrote:
> > But pci_save_state() is called again after the driver's suspend
> > callback is called.  So, the final saved state must be anyway same.
> 
> no that changed recently in the upstream kernel.
> pci_save_state() is now only called if there is no suspend callback in the driver!

Ah, thanks, that explains why (I referred 2.6.10-rc1).

If so, the patch is almost correct, but pci_save_state() should be put
after the call of callback.


Takashi

--- linux/sound/core/init.c	8 Nov 2004 11:37:08 -0000	1.48
+++ linux/sound/core/init.c	12 Nov 2004 13:56:32 -0000
@@ -782,12 +782,15 @@
 int snd_card_pci_suspend(struct pci_dev *dev, u32 state)
 {
 	snd_card_t *card = pci_get_drvdata(dev);
+	int err;
 	if (! card || ! card->pm_suspend)
 		return 0;
 	if (card->power_state == SNDRV_CTL_POWER_D3hot)
 		return 0;
 	/* FIXME: correct state value? */
-	return card->pm_suspend(card, 0);
+	err = card->pm_suspend(card, 0);
+	pci_save_state(dev);
+	return err;
 }
 
 int snd_card_pci_resume(struct pci_dev *dev)

  reply	other threads:[~2004-11-12 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-12 13:00 [PATCH] Add pci_save_state() to ALSA 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 [this message]
2004-11-12 16:12       ` Martin Josefsson
  -- strict thread matches above, loose matches on Subject: below --
2004-11-11 20:39 Martin Josefsson
2004-11-12  9:22 ` Takashi Iwai

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=s5hvfcbdv93.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=gandalf@wlug.westbo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --cc=yi.zhu@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.