All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: arjanv@redhat.com
Cc: Pavel Machek <pavel@ucw.cz>,
	greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: Resume enhancement: restore pci config space
Date: Tue, 01 Jun 2004 17:26:51 +0200	[thread overview]
Message-ID: <s5hbrk3qoxw.wl@alsa2.suse.de> (raw)
In-Reply-To: <1086102397.7500.2.camel@laptop.fenrus.com>

At Tue, 01 Jun 2004 17:06:38 +0200,
Arjan van de Ven wrote:
> 
> [1  <text/plain (quoted-printable)>]
> 
> > 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

  reply	other threads:[~2004-06-01 15:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26 20:35 Resume enhancement: restore pci config space Arjan van de Ven
2004-05-26 22:39 ` Greg KH
2004-05-27  9:44 ` Takashi Iwai
2004-05-30 18:40 ` Pavel Machek
2004-05-31 13:38   ` Arjan van de Ven
2004-06-01 13:54     ` Takashi Iwai
2004-06-01 15:06       ` Arjan van de Ven
2004-06-01 15:26         ` Takashi Iwai [this message]
2004-06-01 15:38           ` Arjan van de Ven
2004-06-01 15:58             ` Takashi Iwai
2004-06-01 16:02             ` Pavel Machek
2004-06-01 16:18               ` Takashi Iwai
2004-05-31 16:38   ` Jan-Benedict Glaw
  -- strict thread matches above, loose matches on Subject: below --
2004-05-26 21:44 Nakajima, Jun

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=s5hbrk3qoxw.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=arjanv@redhat.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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.