From patchwork Fri Jun 14 22:49:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2725321 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40659C0AB1 for ; Fri, 14 Jun 2013 22:50:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07AF3202E5 for ; Fri, 14 Jun 2013 22:50:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12B9F202B9 for ; Fri, 14 Jun 2013 22:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753936Ab3FNWty (ORCPT ); Fri, 14 Jun 2013 18:49:54 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:38392 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753900Ab3FNWtw (ORCPT ); Fri, 14 Jun 2013 18:49:52 -0400 Received: by mail-ie0-f175.google.com with SMTP id a13so2668571iee.34 for ; Fri, 14 Jun 2013 15:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=imPbRV+GsKaL9KcoNNxT9n/8nz4ikOe4SHZDPtoc1cE=; b=c+8mL+zSRofn1Sb1psYMotn6ltab/CEdw+gKdXRC1xzBxm9KFgtjhr9DraUQnZ0cmI bIu02pdwI4PWMbPdchUV7GAecI0guX0ig8yLa619jB/41Yg4gz6ZS0ZP3+vvEKiG+i+V rTbBPwY9LlMM3lTxmQ+y/tDjNT2p/yVbAhcTfZAkmC03y1e0iMZsO7RpN7OWMkEppXDj Z3sLtwlUJ3qLiDb3fnwLsoL80uFy8favc+eD5KmYWsSEw1lVw04nPLjRENPLLiXMU6Bd 8VKp9f/vUMuQpwfiub+GZU+QbbbbYAEQUuXgvqpvdaSSqRFcokjLz9zRuAwuHUjtb8r0 jCnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=imPbRV+GsKaL9KcoNNxT9n/8nz4ikOe4SHZDPtoc1cE=; b=Hc3OXlPa9gcc/v5+7c4FEvkmYo6bdiMSoC4a4dKzxhIDKDg5W84fYR4i8x82dc0xrK 1paBgTr+bCioHJXRCtJhbU2OIbGvFJgiDEhpC3H25Lp/aGyu5HKRo0F3nOkFGok0Zf1r mQZqRwHY6uf8WaObsaodJYAmwB3n/t6i0iq0e70/QIWhytWB3WhdrW0ZUFvBd79l+z4c kTFeXiiH+ZMs/q3fpFtdbSlBGpOgCtpPPPLf4bgxEDZQ0TTZSqAkB5Xx+maLMDRUKO1C bpsxVBaodyd1VqJDTQ8yQc9DEprQJGne7OO0Bkd8l+CCTN+kslO96+Oj4czXTSjDusX9 JIgg== X-Received: by 10.50.127.211 with SMTP id ni19mr123504igb.93.1371250192238; Fri, 14 Jun 2013 15:49:52 -0700 (PDT) Received: from google.com ([172.29.123.84]) by mx.google.com with ESMTPSA id nm17sm4465940igb.5.2013.06.14.15.49.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Jun 2013 15:49:51 -0700 (PDT) Date: Fri, 14 Jun 2013 16:49:49 -0600 From: Bjorn Helgaas To: "Rafael J. Wysocki" Cc: LKML , Linux PCI , Linux PM list , ACPI Devel Maling List Subject: Re: [PATCH] PCI / ACPI / PM: Use correct power state strings in messages Message-ID: <20130614224949.GA29105@google.com> References: <2491625.TQ1FFQeR38@vostro.rjw.lan> <1701924.fhYB0ilm4Z@vostro.rjw.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1701924.fhYB0ilm4Z@vostro.rjw.lan> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQmAqifNkRFfjiJF3wogUVhIzf0KX7Pc8E71ijKHyC0o+8L++jsIM7DygqnPwNvm6tbt0BPk+GV+zp8fAdbVPa/z1C4gL42cP3bGyCtX80xvp01z8yzM5hRstmxEAszkiKK3IEP+dtX6CU+WVA2eUDi5V0JRkheULETLXt4tXtLtuVMs2hSgnl+W7jg9GODrASKAv7gP2INcTJXvkeUJ8z8JccVqbQ== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, Jun 15, 2013 at 12:28:12AM +0200, Rafael J. Wysocki wrote: > On Friday, June 14, 2013 11:08:44 AM Bjorn Helgaas wrote: > > On Thu, Jun 13, 2013 at 4:29 PM, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki > > > > > > 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 > > > --- > > > > > > 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). Ah, right, I should have noticed that. > 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? If the following is OK, I'll just put it in my pci/misc branch: commit fc6504b3a4dc9beae782a11e6f7c3c4a9f077fb8 Author: Rafael J. Wysocki Date: Fri Jun 14 00:29:50 2013 +0200 PCI / ACPI / PM: Use correct power state strings in messages 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. [bhelgaas: use ACPI_STATE_D3_COLD (ACPI_STATE_D3 == ACPI_STATE_D3_COLD)] Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 6c15d6a..dbdc5f7 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -186,8 +186,8 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) [PCI_D0] = ACPI_STATE_D0, [PCI_D1] = ACPI_STATE_D1, [PCI_D2] = ACPI_STATE_D2, - [PCI_D3hot] = ACPI_STATE_D3, - [PCI_D3cold] = ACPI_STATE_D3 + [PCI_D3hot] = ACPI_STATE_D3_COLD, + [PCI_D3cold] = ACPI_STATE_D3_COLD, }; int error = -EINVAL; @@ -211,7 +211,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) 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; }