From patchwork Thu Oct 28 13:11:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 287552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9SDD8La026517 for ; Thu, 28 Oct 2010 13:13:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755398Ab0J1NNI (ORCPT ); Thu, 28 Oct 2010 09:13:08 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:33284 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758574Ab0J1NNG (ORCPT ); Thu, 28 Oct 2010 09:13:06 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id A0E0C19B4D2; Thu, 28 Oct 2010 15:05:50 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15584-05; Thu, 28 Oct 2010 15:05:23 +0200 (CEST) Received: from ferrari.rjw.lan (220-bem-13.acn.waw.pl [82.210.184.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id A500519B5B1; Thu, 28 Oct 2010 15:05:23 +0200 (CEST) From: "Rafael J. Wysocki" To: Matthew Garrett Subject: [RFC/RFT][PATCH 3/3] ACPI / PM: Fix initial reference counting of power resources Date: Thu, 28 Oct 2010 15:11:07 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.36-rjw+; KDE/4.4.4; x86_64; ; ) Cc: Len Brown , "Linux-pm mailing list" , ACPI Devel Maling List References: <201010281507.34994.rjw@sisk.pl> In-Reply-To: <201010281507.34994.rjw@sisk.pl> MIME-Version: 1.0 Message-Id: <201010281511.07358.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Oct 2010 13:13:09 +0000 (UTC) Index: linux-2.6/drivers/acpi/scan.c =================================================================== --- linux-2.6.orig/drivers/acpi/scan.c +++ linux-2.6/drivers/acpi/scan.c @@ -880,8 +880,10 @@ static int acpi_bus_get_power_flags(stru /* TBD: System wake support and resource requirements. */ - device->power.state = ACPI_STATE_UNKNOWN; - acpi_bus_get_power(device->handle, &(device->power.state)); + acpi_bus_get_power(device->handle, &device->power.state); + /* Update power resources reference counting. */ + if (device->power.flags.power_resources) + acpi_power_transition(device, device->power.state); return 0; }