From patchwork Wed Jun 29 08:24:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 927592 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 p5T8NtFc010922 for ; Wed, 29 Jun 2011 08:26:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753822Ab1F2IX5 (ORCPT ); Wed, 29 Jun 2011 04:23:57 -0400 Received: from mga11.intel.com ([192.55.52.93]:15570 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753581Ab1F2IXy (ORCPT ); Wed, 29 Jun 2011 04:23:54 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 29 Jun 2011 01:23:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,442,1304319600"; d="scan'208";a="21810343" Received: from lantianyu-ws.sh.intel.com (HELO localhost) ([10.239.35.77]) by fmsmga002.fm.intel.com with ESMTP; 29 Jun 2011 01:23:53 -0700 From: Lan Tianyu To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, tianyu.lan@intel.com, rui.zhang@intel.com, stable@kernel.org Subject: [PATCH 4/6] ACPI / Battery: Add the hibernation process in the battery_notify() Date: Wed, 29 Jun 2011 16:24:12 +0800 Message-Id: <1309335852-26552-1-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.7.6.rc2.8.g28eb 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]); Wed, 29 Jun 2011 08:26:57 +0000 (UTC) The Commit 25be58215 has added a PM notifier to refresh the sys 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. Signed-off-by: Lan Tianyu --- 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 6057f35..cc35bdc 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -947,6 +947,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);