Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264657AbUFAPbQ (ORCPT ); Tue, 1 Jun 2004 11:31:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265082AbUFAPbQ (ORCPT ); Tue, 1 Jun 2004 11:31:16 -0400 Received: from cantor.suse.de ([195.135.220.2]:10988 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S265015AbUFAPbK (ORCPT ); Tue, 1 Jun 2004 11:31:10 -0400 Date: Tue, 01 Jun 2004 17:26:51 +0200 Message-ID: From: Takashi Iwai To: arjanv@redhat.com Cc: Pavel Machek , greg@kroah.com, linux-kernel@vger.kernel.org Subject: Re: Resume enhancement: restore pci config space In-Reply-To: <1086102397.7500.2.camel@laptop.fenrus.com> References: <20040526203524.GF2057@devserv.devel.redhat.com> <20040530184031.GF997@openzaurus.ucw.cz> <20040531133834.GA5834@devserv.devel.redhat.com> <1086102397.7500.2.camel@laptop.fenrus.com> 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 13) (Rational FORTRAN) (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: 1815 Lines: 50 At Tue, 01 Jun 2004 17:06:38 +0200, Arjan van de Ven wrote: > > [1 ] > > > int xxx_resume(struct pci_dev *dev) > > { > > int err; > > if ((err = pci_default_resume(dev)) < 0) > > return err; > > // ... do h/w specific > > } > > well define "h/w specific", just give me an example of a real (alsa?) > driver that would use it (or point me to one) so that I can see if this > is the best API, what the return value should be etc etc I'm afraid the ALSA drivers aren't be the best examples :) It doesn't handle the error in suspend/resume at all. Anyway, you can find suspend/resume callbacks in linux/sound/pci and subdirectories (e.g. atiixp.c, es1968.c, intel8x0.c...) Note that suspend/resume prototype is different from pci callbacks to be interated with the power handler on ALSA control API. Hmm, looking at them right now, and i found most of them don't have pci_suspend_state() because it worked without saving/restoring the pci state _casually_, and missing pci_set_power_state(), etc... Using "standard" functions would be easier to fix such things. > > > > but IMO, the jobs of pci_default_suspend/resume() should be applied > > always after/before calling driver's suspend/resume callbacks. > > I would be very wary of unconditionally doing the resume thing without > the driver having had a chance to do it's thing. Imo the driver HAS to > be able to override stuff or at least talk to the hw before the generic > resume happens. Ok, agreed. Providing functions to do the standard jobs would suffice. Takashi - 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/