Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262455AbUKLN66 (ORCPT ); Fri, 12 Nov 2004 08:58:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262492AbUKLN66 (ORCPT ); Fri, 12 Nov 2004 08:58:58 -0500 Received: from cantor.suse.de ([195.135.220.2]:54970 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S262455AbUKLN6z (ORCPT ); Fri, 12 Nov 2004 08:58:55 -0500 Date: Fri, 12 Nov 2004 14:58:32 +0100 Message-ID: From: Takashi Iwai To: Arjan van de Ven Cc: "Zhu, Yi" , Martin Josefsson , perex@suse.cz, akpm@osdl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Add pci_save_state() to ALSA In-Reply-To: <1100267140.4096.7.camel@laptop.fenrus.org> References: <3ACA40606221794F80A5670F0AF15F8403BD5836@pdsmsx403> <1100267140.4096.7.camel@laptop.fenrus.org> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1368 Lines: 42 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) - 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/