lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 15 Jun 2013 00:28:12 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Linux PCI <linux-pci@...r.kernel.org>,
	Linux PM list <linux-pm@...r.kernel.org>,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH] PCI / ACPI / PM: Use correct power state strings in messages

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@...k.pl> wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@...el.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@...el.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ