From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Hilman Subject: Re: PM branch rebased to 2.6.29 Date: Thu, 26 Mar 2009 10:01:10 -0700 Message-ID: <87prg4i5gp.fsf@deeprootsystems.com> References: <87bprz9zju.fsf@deeprootsystems.com> <200903261754.31577.jpihet@mvista.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-qy0-f118.google.com ([209.85.221.118]:61133 "EHLO mail-qy0-f118.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754977AbZCZRBR (ORCPT ); Thu, 26 Mar 2009 13:01:17 -0400 Received: by qyk16 with SMTP id 16so1171112qyk.33 for ; Thu, 26 Mar 2009 10:01:15 -0700 (PDT) In-Reply-To: <200903261754.31577.jpihet@mvista.com> (Jean Pihet's message of "Thu\, 26 Mar 2009 17\:54\:31 +0100") Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Jean Pihet Cc: linux-omap@vger.kernel.org Jean Pihet writes: > Hi, > > I am having a crash with the latest 2.6.29 pm branch with CPU_FREQ enabled. It > looks like clk_set_rate is called recursively, thus deadlocking on the mutex. > > Any idea why this worked fine on 2.6.29-rc8 pm? One of the differences is the new clock notifier patches, which may have changed the locking, but I haven't dug into this yet so I don't know if it's a bug in the clock locking or in CPUfreq locking. Kevin > Here is the dump excerpt: > ... > Disabling unused clock "sys_clkout1" > BUG: scheduling while atomic: swapper/1/0x00000002 > Modules linked in: > [] (dump_stack+0x0/0x14) from [] > (__schedule_bug+0x54/0x60) > [] (__schedule_bug+0x0/0x60) from [] (schedule+0x78/0x2bc) > r4:c781c000 > [] (schedule+0x0/0x2bc) from [] > (__mutex_lock_slowpath+0x174/0x290) > [] (__mutex_lock_slowpath+0x0/0x290) from [] > (mutex_lock+0x28/0x30) > [] (mutex_lock+0x0/0x30) from [] (clk_set_rate+0x2c/0xec) > r4:c03ced20 > [] (clk_set_rate+0x0/0xec) from [] > (omap3_select_table_rate+0xd0/0x168) > r6:00000004 r5:c03fd474 r4:c03d426c > [] (omap3_select_table_rate+0x0/0x168) from [] > (omap2_clk_set_rate+0x20/0x24) > r6:60000013 r5:20c85580 r4:c03ce41c > [] (omap2_clk_set_rate+0x0/0x24) from [] > (clk_set_rate+0x88/0xec) > [] (clk_set_rate+0x0/0xec) from [] > (omap_cpu_init+0xc8/0x108) > r6:c03f4b20 r5:c03fddac r4:c7be9be0 > [] (omap_cpu_init+0x0/0x108) from [] > (cpufreq_add_dev+0x120/0x300) > r5:c7be9be0 r4:00000000 > [] (cpufreq_add_dev+0x0/0x300) from [] > (sysdev_driver_register+0xb4/0x124) > r8:00000000 r7:00000000 r6:c03f4b20 r5:c03ef708 r4:c03fc95c > [] (sysdev_driver_register+0x0/0x124) from [] > (cpufreq_register_driver+0x98/0x104) > r6:00000000 r5:c041efac r4:c03d541c > [] (cpufreq_register_driver+0x0/0x104) from [] > (omap_cpufreq_init+0x14/0x1c) > r5:c00266fc r4:c03fc080 > [] (omap_cpufreq_init+0x0/0x1c) from [] > (__exception_text_end+0x54/0x188) > [] (__exception_text_end+0x0/0x188) from [] > (kernel_init+0x74/0xdc) > [] (kernel_init+0x0/0xdc) from [] (do_exit+0x0/0x6b8) > r5:00000000 r4:00000000 > > Regards, > Jean > > On Wednesday 18 March 2009 06:21:09 Kevin Hilman wrote: >> FYI... >> >> The PM branch has now been rebased to today's linux-omap HEAD which is >> based on v2.6.29-rc8. The previous PM branch has been renamed to >> pm-2.6.28. Depending on when you look, Tony's linux-omap tree may not >> (yet) have the latest PM branch. If not, you can use my PM tree[1] >> directly. Also, pm-2.6.28 will only be available on my tree. >> >> Tested on OMAP3 Beagle and RX51 and was able to hit RET and OFF in >> suspend and in PM idle with minimal kernel. No testing yet done for >> CPUidle or DVFS. Please test on your hardware and submit results to >> the list. Thanks. >> >> Kevin >> >> -- >> >> Misc. conflicts/issues resolved after rebase: >> >> - no longer safe to use getnstimeofday() in suspend path since timekeeping >> subsystem is also suspended in the suspend path. PM debug timing has >> been converted to use sched_clock() which is 32k sync-timer based. >> >> - Update board-rx51.c to use common OMAP3 OPPs >> >> Known issues: >> >> - Beagle: MMC: off-mode needs work in MMC driver, so if you hit off >> and have a rootfs on MMC, you're dead. >> >> - Beagle: MMC regulator: unbalanced disables. This happens on boot >> and during suspend/resume. I don't think this is related to the PM >> branch, but is probably in linux-omap HEAD also, but didn't test. >> >> Linux version 2.6.29-rc8-omap1-arm-omap3beagle-default-05653-gd803372-dirty >> (khilman@vence) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-66) ) #4 >> PREEMPT Tue Mar 17 21:38:09 PDT 2009 [...] >> i2c_omap i2c_omap.1: bus 1 rev3.12 at 2600 kHz >> twl4030: PIH (irq 7) chaining IRQs 368..375 >> twl4030: power (irq 373) chaining IRQs 376..383 >> twl4030: gpio (irq 368) chaining IRQs 384..401 >> beagle_twl_gpio_setup:145 >> twl4030_mmc_init:303 >> twl4030_mmc_init:318 >> regulator: VMMC1: 1850 <--> 3150 mV normal standby >> regulator: VDAC: 1800 mV normal standby >> regulator: VUSB1V5: 1500 <--> 0 mV normal standby >> regulator: VUSB1V8: 1800 <--> 0 mV normal standby >> regulator: VUSB3V1: 3100 <--> 0 mV normal standby >> regulator: VSIM: 1800 <--> 3000 mV normal standby >> [...] >> mmci-omap-hs mmci-omap-hs.0: Failed to get debounce clock >> ------------[ cut here ]------------ >> WARNING: at >> /net/home/khilman/work/kernel/omap/pm/drivers/regulator/core.c:1216 >> regulator_disable+0x64/0x90() unbalanced disables for supply >> mmci-omap-hs.0-vmmc >> Modules linked in: >> [] (dump_stack+0x0/0x14) from [] >> (warn_slowpath+0x6c/0x88) [] (warn_slowpath+0x0/0x88) from >> [] (regulator_disable+0x64/0x90) r3:c79dc2a0 r2:c03390cb >> r7:c78e8c20 r6:c78aac38 r5:c78e8c20 r4:fffffffb >> [] (regulator_disable+0x0/0x90) from [] >> (mmc_regulator_set_ocr+0xb0/0xcc) r7:c78e8c20 r6:00000001 r5:00000000 >> r4:00000000 >> [] (mmc_regulator_set_ocr+0x0/0xcc) from [] >> (twl_mmc1_set_power+0xc0/0xec) r7:c784f538 r6:00000000 r5:00000000 >> r4:c039185c >> [] (twl_mmc1_set_power+0x0/0xec) from [] >> (omap_mmc_set_ios+0x54/0x2b0) r7:c784f538 r6:c784f5c0 r5:c784f400 >> r4:c7844380 >> [] (omap_mmc_set_ios+0x0/0x2b0) from [] >> (mmc_power_off+0x54/0x58) r7:c784f400 r6:c7910400 r5:00000000 r4:c784f400 >> [] (mmc_power_off+0x0/0x58) from [] >> (mmc_start_host+0x14/0x24) [] (mmc_start_host+0x0/0x24) from >> [] (mmc_add_host+0x58/0x64) r5:00000000 r4:c784f400 >> [] (mmc_add_host+0x0/0x64) from [] >> (omap_mmc_probe+0x3d0/0x548) r5:c784f5c0 r4:00000000 >> [] (omap_mmc_probe+0x0/0x548) from [] >> (platform_drv_probe+0x20/0x24) [] (platform_drv_probe+0x0/0x24) >> from [] (driver_probe_device+0xd4/0x180) [] >> (driver_probe_device+0x0/0x180) from [] >> (__driver_attach+0x68/0x8c) r7:c789d140 r6:c038ada4 r5:c7910490 r4:c7910408 >> [] (__driver_attach+0x0/0x8c) from [] >> (bus_for_each_dev+0x4c/0x80) r7:c789d140 r6:c038ada4 r5:c01dc7ec >> r4:00000000 >> [] (bus_for_each_dev+0x0/0x80) from [] >> (driver_attach+0x20/0x28) r6:c038ada4 r5:00000000 r4:00000000 >> [] (driver_attach+0x0/0x28) from [] >> (bus_add_driver+0xa8/0x210) [] (bus_add_driver+0x0/0x210) from >> [] (driver_register+0x98/0x120) r8:00000001 r7:c001e814 >> r6:c038ada4 r5:00000000 r4:c0024a44 >> [] (driver_register+0x0/0x120) from [] >> (platform_driver_register+0x6c/0x88) r9:00000000 r8:00000001 r7:c001e814 >> r6:00000000 r5:00000000 >> r4:c0024a44 >> [] (platform_driver_register+0x0/0x88) from [] >> (omap_mmc_init+0x14/0x1c) [] (omap_mmc_init+0x0/0x1c) from >> [] (do_one_initcall+0x5c/0x19c) [] >> (do_one_initcall+0x0/0x19c) from [] (kernel_init+0x84/0xf8) >> r8:00000000 r7:00000000 r6:00000000 r5:00000000 r4:c0024a44 >> [] (kernel_init+0x0/0xf8) from [] (do_exit+0x0/0x764) >> r4:00000000 >> ---[ end trace e339700732a37a4d ]--- >> [.../ >> (none):~# echo 1 > /sys/power/clocks_off_while_idle >> (none):~# echo mem > /sys/power/state >> PM: Syncing filesystems ... done. >> Freezing user space processes ... (elapsed 0.00 seconds) done. >> Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done. >> Suspending console(s) (use no_console_suspend to debug) >> ------------[ cut here ]------------ >> WARNING: at >> /net/home/khilman/work/kernel/omap/pm/drivers/regulator/core.c:1216 >> regulator_disable+0x64/0x90() unbalanced disables for supply >> mmci-omap-hs.0-vmmc >> Modules linked in: >> [] (dump_stack+0x0/0x14) from [] >> (warn_slowpath+0x6c/0x88) [] (warn_slowpath+0x0/0x88) from >> [] (regulator_disable+0x64/0x90) r3:c79dc2a0 r2:c03390cb >> r7:c78e8c20 r6:c78aac38 r5:c78e8c20 r4:fffffffb >> [] (regulator_disable+0x0/0x90) from [] >> (mmc_regulator_set_ocr+0xb0/0xcc) r7:c78e8c20 r6:00000001 r5:00000000 >> r4:00000000 >> [] (mmc_regulator_set_ocr+0x0/0xcc) from [] >> (twl_mmc1_set_power+0xc0/0xec) r7:c784f538 r6:00000000 r5:00000000 >> r4:c039185c >> [] (twl_mmc1_set_power+0x0/0xec) from [] >> (omap_mmc_set_ios+0x54/0x2b0) r7:c784f538 r6:c784f5c0 r5:c784f400 >> r4:c7844380 >> [] (omap_mmc_set_ios+0x0/0x2b0) from [] >> (mmc_power_off+0x54/0x58) r7:c7910490 r6:c7910400 r5:a0000013 r4:c784f400 >> [] (mmc_power_off+0x0/0x58) from [] >> (mmc_suspend_host+0x14c/0x154) [] (mmc_suspend_host+0x0/0x154) >> from [] (omap_mmc_suspend+0x30/0xe0) r5:c0388a74 r4:c784f5c0 >> [] (omap_mmc_suspend+0x0/0xe0) from [] >> (platform_drv_suspend+0x20/0x24) r7:c7910490 r6:c79104b8 r5:c0388a74 >> r4:c0388ba4 >> [] (platform_drv_suspend+0x0/0x24) from [] >> (platform_pm_suspend+0x50/0x5c) [] (platform_pm_suspend+0x0/0x5c) >> from [] (pm_op+0x38/0x7c) [] (pm_op+0x0/0x7c) from >> [] (device_suspend+0x350/0x480) r5:c7910408 r4:c0388ba4 >> [] (device_suspend+0x0/0x480) from [] >> (suspend_devices_and_enter+0x44/0x1c4) [] >> (suspend_devices_and_enter+0x0/0x1c4) from [] >> (enter_state+0x134/0x1b8) r7:c02a5bf4 r6:00000003 r5:c031de6b r4:000072ab >> [] (enter_state+0x0/0x1b8) from [] >> (state_store+0x9c/0xc4) r7:c02a5bf4 r6:00000003 r5:00000003 r4:c031de6b >> [] (state_store+0x0/0xc4) from [] >> (kobj_attr_store+0x20/0x24) [] (kobj_attr_store+0x0/0x24) from >> [] (sysfs_write_file+0x110/0x144) [] >> (sysfs_write_file+0x0/0x144) from [] (vfs_write+0xb8/0x148) >> [] (vfs_write+0x0/0x148) from [] (sys_write+0x44/0x70) >> r7:00000004 r6:c78d3ae0 r5:00000000 r4:00000000 >> [] (sys_write+0x0/0x70) from [] >> (ret_fast_syscall+0x0/0x2c) r8:c0029fc8 r7:00000004 r6:401ab5e0 r5:000c3408 >> r4:00000004 >> ---[ end trace e339700732a37a4f ]--- >> Successfully put all powerdomains to target state >> Restarting tasks ... done. >> >> [1] >> http://git.kernel.org/?p=linux/kernel/git/khilman/linux-omap-pm.git;a=summa >>ry -- >> To unsubscribe from this list: send the line "unsubscribe linux-omap" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html