From mboxrd@z Thu Jan 1 00:00:00 1970 From: neilb@suse.de (NeilBrown) Date: Mon, 20 Feb 2012 20:08:56 +1100 Subject: Possible circular locking dependency (3.3-rc2) In-Reply-To: <4F41FF4E.7040000@gmail.com> References: <20120208124147.GF16334@legolas.emea.dhcp.ti.com> <20120215200910.GE25779@ponder.secretlab.ca> <4F41FF4E.7040000@gmail.com> Message-ID: <20120220200856.47db7e24@notabene.brown> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, 20 Feb 2012 09:07:42 +0100 Thomas Weber wrote: > Hello, > > I applied the patch from Ming, but got also an error. > I am ccing Neil, because I also applied some patches from him. That looks like it is the third of the three patches I sent. I needed some locking and there was a mutex available that seemed to be available so I used it. Apparently it causes problems. I don't think I ever saw that myself ... I wonder why. There is already a dependency between the mutex I used and s_active in sysfs. I guess that means I'll have to create a new lock just for the purpose of keeping two threads from using the w1 bus at the same time... Apart from this - which is just a warning, though maybe it could become a real deadlock - is the bq27000 now working for you? NeilBrown > > Regards, > Thomas > > > [ 6.229370] ====================================================== > > [ 6.235870] [ INFO: possible circular locking dependency detected ] > > [ 6.242431] 3.3.0-rc4-00020-ga02b31a #10 Not tainted > > [ 6.247650] ------------------------------------------------------- > > [ 6.254241] udevadm/596 is trying to acquire lock: > > [ 6.259277] (&dev->mutex#2){+.+.+.}, at: [] w1_bq27000_read+0x1c/0x48 > > [ 6.267120] > > [ 6.267120] but task is already holding lock: > > [ 6.273254] (s_active#11){++++.+}, at: [] sysfs_write_file+0xdc/0x180 > > [ 6.281097] > > [ 6.281127] which lock already depends on the new lock. > > [ 6.281127] > > [ 6.289703] > > [ 6.289703] the existing dependency chain (in reverse order) is: > > [ 6.297576] > > [ 6.297576] -> #1 (s_active#11){++++.+}: > > [ 6.303283] [] lock_acquire+0xa0/0x128 > > [ 6.308807] [] sysfs_addrm_finish+0xf4/0x148 > > [ 6.314880] [] sysfs_hash_and_remove+0x4c/0x88 > > [ 6.321136] [] sysfs_remove_file+0x30/0x38 > > [ 6.326995] [] device_del+0xf0/0x17c > > [ 6.332336] [] device_unregister+0xc/0x18 > > [ 6.338104] [] w1_slave_detach+0xac/0xcc > > [ 6.343811] [] w1_reconnect_slaves+0xc0/0x10c > > [ 6.349945] [] w1_register_family+0x90/0xa0 > > [ 6.355926] [] do_one_initcall+0x34/0x174 > > [ 6.361694] [] kernel_init+0x94/0x11c > > [ 6.367126] [] kernel_thread_exit+0x0/0x8 > > [ 6.372924] > > [ 6.372924] -> #0 (&dev->mutex#2){+.+.+.}: > > [ 6.378845] [] __lock_acquire+0x1678/0x1ad4 > > [ 6.384826] [] lock_acquire+0xa0/0x128 > > [ 6.390319] [] mutex_lock_nested+0x48/0x2bc > > [ 6.396301] [] w1_bq27000_read+0x1c/0x48 > > [ 6.401977] [] bq27000_read_platform+0x2c/0x124 > > [ 6.408325] [] bq27x00_battery_get_property+0x1cc/0x3cc > > [ 6.415374] [] power_supply_show_property+0x4c/0x224 > > [ 6.422180] [] power_supply_uevent+0xe4/0x224 > > [ 6.428314] [] dev_uevent+0xb4/0x170 > > [ 6.433654] [] kobject_uevent_env+0x1d8/0x478 > > [ 6.439819] [] store_uevent+0x50/0x54 > > [ 6.445220] [] dev_attr_store+0x18/0x24 > > [ 6.450805] [] sysfs_write_file+0x100/0x180 > > [ 6.456787] [] vfs_write+0xa8/0x138 > > [ 6.462036] [] sys_write+0x40/0x6c > > [ 6.467163] [] ret_fast_syscall+0x0/0x3c > > [ 6.472869] > > [ 6.472869] other info that might help us debug this: > > [ 6.472900] > > [ 6.481292] Possible unsafe locking scenario: > > [ 6.481292] > > [ 6.487518] CPU0 CPU1 > > [ 6.492248] ---- ---- > > [ 6.497009] lock(s_active#11); > > [ 6.500427] lock(&dev->mutex#2); > > [ 6.506683] lock(s_active#11); > > [ 6.512756] lock(&dev->mutex#2); > > [ 6.516357] > > [ 6.516357] *** DEADLOCK *** > > [ 6.516357] > > [ 6.522583] 2 locks held by udevadm/596: > > [ 6.526702] #0: (&buffer->mutex){+.+.+.}, at: [] sysfs_write_file+0x28/0x180 > > [ 6.535278] #1: (s_active#11){++++.+}, at: [] sysfs_write_file+0xdc/0x180 > > [ 6.543579] > > [ 6.543579] > > [ 6.543579] stack backtrace: > > [ 6.548217] [] (unwind_backtrace+0x0/0xf8) from [] (print_circular_bug+0x2c8/0x2d4) > > [ 6.558105] [] (print_circular_bug+0x2c8/0x2d4) from [] (__lock_acquire+0x1678/0x1ad4) > > [ 6.568267] [] (__lock_acquire+0x1678/0x1ad4) from [] (lock_acquire+0xa0/0x128) > > [ 6.577789] [] (lock_acquire+0xa0/0x128) from [] (mutex_lock_nested+0x48/0x2bc) > > [ 6.587310] [] (mutex_lock_nested+0x48/0x2bc) from [] (w1_bq27000_read+0x1c/0x48) > > [ 6.597015] [] (w1_bq27000_read+0x1c/0x48) from [] (bq27000_read_platform+0x2c/0x124) > > [ 6.607086] [] (bq27000_read_platform+0x2c/0x124) from [] (bq27x00_battery_get_property+0x1cc/0x3cc) > > [ 6.618499] [] (bq27x00_battery_get_property+0x1cc/0x3cc) from [] (power_supply_show_property+0x4c/0x224) > > [ 6.630401] [] (power_supply_show_property+0x4c/0x224) from [] (power_supply_uevent+0xe4/0x224) > > [ 6.641357] [] (power_supply_uevent+0xe4/0x224) from [] (dev_uevent+0xb4/0x170) > > [ 6.650909] [] (dev_uevent+0xb4/0x170) from [] (kobject_uevent_env+0x1d8/0x478) > > [ 6.660430] [] (kobject_uevent_env+0x1d8/0x478) from [] (store_uevent+0x50/0x54) > > [ 6.670013] [] (store_uevent+0x50/0x54) from [] (dev_attr_store+0x18/0x24) > > [ 6.679107] [] (dev_attr_store+0x18/0x24) from [] (sysfs_write_file+0x100/0x180) > > [ 6.688720] [] (sysfs_write_file+0x100/0x180) from [] (vfs_write+0xa8/0x138) > > [ 6.697967] [] (vfs_write+0xa8/0x138) from [] (sys_write+0x40/0x6c) > > [ 6.706390] [] (sys_write+0x40/0x6c) from [] (ret_fast_syscall+0x0/0x3c) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 828 bytes Desc: not available URL: