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: 2725301 Return-Path: X-Original-To: patchwork-linux-acpi@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 D049E9F967 for ; Fri, 14 Jun 2013 22:49:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6217202B9 for ; Fri, 14 Jun 2013 22:49:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45D2A202DD for ; Fri, 14 Jun 2013 22:49:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753907Ab3FNWty (ORCPT ); Fri, 14 Jun 2013 18:49:54 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:52448 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753859Ab3FNWtw (ORCPT ); Fri, 14 Jun 2013 18:49:52 -0400 Received: by mail-ie0-f179.google.com with SMTP id c10so2536758ieb.24 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=CfJWIX9VJ71Z+fegE5wGACzj2AFkfoaoljFqi2t7Zfe8CT/qr3Yg3/bFeOry1Zlz+p Y2JXomTHZEUR5EF5s1blWuYlJsl8mpg7W4B9F0HnAf9u691LoGlaFPZCjOInvcewhUAO 8yKczFDbURV976QVwDrvglwCGpjmjS26J9lAE4drze3mexu/oy2BynM8u1b8Qf6e4SgM QFThaOVTFKncuv3FHnmIjjkGEyRSJaLPYgr9iUx9lqyPqzEkKcXCsZbCVzmU0j/IrKdE yCMk4BA1rKxwump8vwvuOHxhArPtACvYGJfeDQHu0cBd5biC3wlLiKRN5rOGftOCC0wj F9Ig== 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: ALoCoQnk34T2ZVci16qxe51MVwdliHPnbcdnTeAvFw1hFY/vWOmcPJPbEXJBfPWcIgXOZlRTo/aHA3gLfVcn5X4QakJLKxjhLrhj6uGdwh4AWGSOASbq4mgvBgEwZiv9fAbMo9dTnDhCNMCL1qrZC3G5xS401Z2ac9Zg+xPd0egtyrBoqiMZSjw0YUperFdZv9NpUdpqg55uyE2gbvZnMjF7RlZqSBr7lQ== Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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-acpi" 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; }