From patchwork Mon Jun 20 06:56:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 896172 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5K6s0wv018105 for ; Mon, 20 Jun 2011 07:02:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753161Ab1FTG6L (ORCPT ); Mon, 20 Jun 2011 02:58:11 -0400 Received: from mga11.intel.com ([192.55.52.93]:51633 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151Ab1FTG6L (ORCPT ); Mon, 20 Jun 2011 02:58:11 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 19 Jun 2011 23:58:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,392,1304319600"; d="scan'208";a="20269182" Received: from lantianyu-ws.sh.intel.com (HELO [10.239.35.77]) ([10.239.35.77]) by fmsmga001.fm.intel.com with ESMTP; 19 Jun 2011 23:58:09 -0700 Subject: [PATCH 3/3] ACPI / Battery: Add the hibernation process in the battery_notify() From: "lan,Tianyu" To: linux acpi , Len Brown Date: Mon, 20 Jun 2011 14:56:50 +0800 Message-ID: <1308553010.18731.30.camel@lantianyu-ws> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 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.6 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Jun 2011 07:02:43 +0000 (UTC) The Commit 25be58215 has added a PM notifier to refresh the sysfs files in order to deal with the unit change of the Battery Present Rate. But it just consided the suspend situation. The problem also will happen during the hibernation according the bug 28192. https://bugzilla.kernel.org/show_bug.cgi?id=28192 This patch adds the hibernation process and fix the bug. --- drivers/acpi/battery.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 0ae5b08..fbcdd55 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -942,6 +942,7 @@ static int battery_notify(struct notifier_block *nb, struct acpi_battery *battery = container_of(nb, struct acpi_battery, pm_nb); switch (mode) { + case PM_POST_HIBERNATION: case PM_POST_SUSPEND: sysfs_remove_battery(battery); sysfs_add_battery(battery);