Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754003AbZJ0MBy (ORCPT ); Tue, 27 Oct 2009 08:01:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753918AbZJ0MBy (ORCPT ); Tue, 27 Oct 2009 08:01:54 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:55786 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753774AbZJ0MBw convert rfc822-to-8bit (ORCPT ); Tue, 27 Oct 2009 08:01:52 -0400 From: "Dasgupta, Romit" To: "Hilman, Kevin" , "rjw@sisk.pl" CC: "linux-pm@lists.linux-foundation.org" , "linux-omap@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Tue, 27 Oct 2009 17:31:30 +0530 Subject: [PATCH] PM: Fixes warning on suspend errors Thread-Topic: [PATCH] PM: Fixes warning on suspend errors Thread-Index: AcpW/TguHlLgiK/OSwWE73VOdePpNg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3901 Lines: 68 Hi, I get the following errors when I choose devices in /sys/power/pm_test. It also shows that if 'dpm_suspend_start' fails somewhere down the line then the kernel does not reset the 'transition_started' variable and we can get warning similar to below. IMHO 'dpm_resume_noirq' is not the right place for setting this variable. Please see the patch below which fixes the issue. Thanks, -Romit # [ 113.713958] mmcblk0: mmc1:0001 STM16G 14.8 GiB [ 113.718902] mmcblk0: unknown partition table [ 113.745574] ------------[ cut here ]------------ [ 113.751525] WARNING: at drivers/base/power/main.c:98 device_pm_add+0x94/0xdc() [ 113.758819] Device: bdi [ 113.758819] Parentless device registered during a PM transaction [ 113.773071] Modules linked in: [ 113.776214] [] (unwind_backtrace+0x0/0xdc) from [] (warn_slowpath_common+0x48/0x60) [ 113.785705] [] (warn_slowpath_common+0x48/0x60) from [] (warn_slowpath_fmt+0x24/0x30) [ 113.799896] [] (warn_slowpath_fmt+0x24/0x30) from [] (device_pm_add+0x94/0xdc) [ 113.808990] [] (device_pm_add+0x94/0xdc) from [] (device_add+0x3a8/0x534) [ 113.817565] [] (device_add+0x3a8/0x534) from [] (device_create_vargs+0x78/0xa8) [ 113.829650] [] (device_create_vargs+0x78/0xa8) from [] (bdi_register+0x3c/0x154) [ 113.839263] [] (bdi_register+0x3c/0x154) from [] (bdi_register_dev+0x20/0x28) [ 113.851348] [] (bdi_register_dev+0x20/0x28) from [] (add_disk+0xe4/0x124) [ 113.859954] [] (add_disk+0xe4/0x124) from [] (mmc_blk_probe+0x250/0x288) [ 113.870513] [] (mmc_blk_probe+0x250/0x288) from [] (mmc_bus_probe+0x18/0x1c) [ 113.879394] [] (mmc_bus_probe+0x18/0x1c) from [] (driver_probe_device+0xa0/0x14c) [ 113.893890] [] (driver_probe_device+0xa0/0x14c) from [] (bus_for_each_drv+0x44/0x80) [ 113.905609] [] (bus_for_each_drv+0x44/0x80) from [] (device_attach+0x50/0x68) [ 113.914550] [] (device_attach+0x50/0x68) from [] (bus_probe_device+0x24/0x40) [ 113.925170] [] (bus_probe_device+0x24/0x40) from [] (device_add+0x3dc/0x534) [ 113.934082] [] (device_add+0x3dc/0x534) from [] (mmc_add_card+0xcc/0x118) [ 113.945251] [] (mmc_add_card+0xcc/0x118) from [] (mmc_attach_mmc+0xdc/0x13c) [ 113.954132] [] (mmc_attach_mmc+0xdc/0x13c) from [] (mmc_rescan+0x2b0/0x2e8) [ 113.964874] [] (mmc_rescan+0x2b0/0x2e8) from [] (worker_thread+0x16c/0x218) [ 113.973693] [] (worker_thread+0x16c/0x218) from [] (kthread+0x7c/0x84) [ 113.986694] [] (kthread+0x7c/0x84) from [] (kernel_thread_exit+0x0/0x8) [ 113.995147] ---[ end trace aaa7bf5becc572f5 ]--- Fixes the location where we decide that our power transition is complete. Signed-off-by: Romit Dasgupta --- diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index e0dc407..6b9e991 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -365,7 +365,6 @@ void dpm_resume_noirq(pm_message_t state) struct device *dev; mutex_lock(&dpm_list_mtx); - transition_started = false; list_for_each_entry(dev, &dpm_list, power.entry) if (dev->power.status > DPM_OFF) { int error; @@ -529,6 +528,7 @@ static void dpm_complete(pm_message_t state) put_device(dev); } list_splice(&list, &dpm_list); + transition_started = false; mutex_unlock(&dpm_list_mtx); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/