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: 2725291 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 34D269F967 for ; Fri, 14 Jun 2013 22:49:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46FDD202E5 for ; Fri, 14 Jun 2013 22:49:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 600E9202C6 for ; Fri, 14 Jun 2013 22:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753926Ab3FNWty (ORCPT ); Fri, 14 Jun 2013 18:49:54 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:47372 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830Ab3FNWtw (ORCPT ); Fri, 14 Jun 2013 18:49:52 -0400 Received: by mail-ie0-f179.google.com with SMTP id c10so2632858ieb.38 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=BTrssplryY3x2Q14nSP+92jR9tQ/XFxgHQbNtNIEk0oDp1rt4M20jyz4yEC3ZC14T7 3fn8rMtcIMRY9cNH5A7AqmxPkb1A/j6lnaxBuBxXJX3PFRENYDmK0fYfkRpXpV9go3Ze ZtpJ7ZWQgGj5jNNlKWRLSZAGuExKRJrMMRR9QD48nSo78G903/Uz/RW/3qY6N98bLmP7 /rmLEbNTUiRECmlyk+uV9Rz5R0+S6ie2hx6WQ6XxGfvMk3X9Ujy9xH1Za4IzuWDSDcrN jH2Oj7ZscQrj0FbeVgMAXw2ro0vW420nu/XDFK85369xK23BSjc9Hogk41Z6TSSiW85R M9wQ== 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: ALoCoQl5nVcD2gAvwoZzaRttqlZnBhuxhc4IIYV6TvUx8bB6Ay3b51NDICWXJUYkPXGi97Ggo6tm7CApvoqofNr9VgKoIRS3uzLrjZe6qsQ51WdMdh93EX6UpjGjBN6S8shQcKBY0PKuJmFM38LWjsK/GJugMnEgCWayF9iJbXv3tuXWQtYpbQGVOZU6664EXnSXd8odT+CuTTrVlYpaZQx9Q73DO2JK5g== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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-pci" 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; }