Linux Power Management development
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Linux PM list <linux-pm@vger.kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH] PCI / ACPI / PM: Use correct power state strings in messages
Date: Sat, 15 Jun 2013 00:28:12 +0200	[thread overview]
Message-ID: <1701924.fhYB0ilm4Z@vostro.rjw.lan> (raw)
In-Reply-To: <CAErSpo7Q8H5wmMUPKqquerp_zbFwnac95Gbezd2=STBjtUrnvw@mail.gmail.com>

On Friday, June 14, 2013 11:08:44 AM Bjorn Helgaas wrote:
> On Thu, Jun 13, 2013 at 4:29 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > Make acpi_pci_set_power_state() print the name of the ACPI device
> > power state the device has been actually put into instead of printing
> > the name of the requested PCI device power state, which need not be
> > the same.
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >
> > For 3.11.
> >
> > Thanks,
> > Rafael
> >
> > ---
> >  drivers/pci/pci-acpi.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Index: linux-pm/drivers/pci/pci-acpi.c
> > ===================================================================
> > --- linux-pm.orig/drivers/pci/pci-acpi.c
> > +++ linux-pm/drivers/pci/pci-acpi.c
> > @@ -211,7 +211,7 @@ static int acpi_pci_set_power_state(stru
> >
> >         if (!error)
> >                 dev_info(&dev->dev, "power state changed by ACPI to %s\n",
> > -                        pci_power_name(state));
> > +                        acpi_power_state_string(state_conv[state]));
> >
> >         return error;
> >  }
> >
> 
> Just to double-check this, it *looks* like the effective change is
> that for PCI_D3hot and PCI_D3cold, we'll print "(unknown)" instead of
> "D3hot" and "D3cold" because state_conv[] folds both PCI_D3hot and
> PCI_D3cold into ACPI_STATE_D3, and acpi_power_state_string() doesn't
> have a case for ACPI_STATE_D3.

No, it won't work like this, because ACPI_STATE_D3 == ACPI_STATE_D3_COLD. :-)

So, actually, "D3cold" will be printed for both PCI_D3hot and PCI_D3cold
(and I have tested this).

Well, I think it's better to actually replace ACPI_STATE_D3 everywhere in
pci-acpi.c with ACPI_STATE_D3_COLD to avoid that confusion.  Do you want me
to prepare a patch?

Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2013-06-14 22:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-13 22:29 [PATCH] PCI / ACPI / PM: Use correct power state strings in messages Rafael J. Wysocki
2013-06-14 17:08 ` Bjorn Helgaas
2013-06-14 22:28   ` Rafael J. Wysocki [this message]
2013-06-14 22:49     ` Bjorn Helgaas
2013-06-14 23:13       ` Rafael J. Wysocki

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=1701924.fhYB0ilm4Z@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=bhelgaas@google.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox