[RFC] PCMCIA locking updates for 2.6.34

Wolfram Sang w.sang at pengutronix.de
Sun Jan 17 06:08:20 EST 2010


> If it doesn't help, could you enable lockdep, please, and check with

I enabled locking debug and got this while inserting the card:

[  187.347741] =======================================================
[  187.347745] [ INFO: possible circular locking dependency detected ]
[  187.347750] 2.6.33-rc4-ninja-00035-g117c14a-dirty #66
[  187.347753] -------------------------------------------------------
[  187.347758] pccardd/1248 is trying to acquire lock:
[  187.347761]  (rsrc_mutex){+.+.+.}, at: [<c1850db3>] nonstatic_find_mem_region+0x83/0x210 [rsrc_nonstatic]
[  187.347776] 
[  187.347777] but task is already holding lock:
[  187.347780]  (&socket->ops_mutex){+.+.+.}, at: [<c1cbf56a>] set_cis_map+0x2a/0x140 [pcmcia]
[  187.347797] 
[  187.347798] which lock already depends on the new lock.
[  187.347800] 
[  187.347803] 
[  187.347804] the existing dependency chain (in reverse order) is:
[  187.347808] 
[  187.347810] -> #1 (&socket->ops_mutex){+.+.+.}:
[  187.347817]        [<8015fe21>] __lock_acquire+0x11b1/0x1940
[  187.347827]        [<80160669>] lock_acquire+0xb9/0xd0
[  187.347834]        [<8053c6b6>] mutex_lock_nested+0x46/0x2a0
[  187.347842]        [<c185121a>] readable+0x2a/0xe0 [rsrc_nonstatic]
[  187.347849]        [<c1850669>] do_validate_mem+0xe9/0x1a0 [rsrc_nonstatic]
[  187.347856]        [<c1850892>] do_mem_probe+0x172/0x210 [rsrc_nonstatic]
[  187.347864]        [<c1850cf1>] pcmcia_nonstatic_validate_mem+0xb1/0xf0 [rsrc_nonstatic]
[  187.347872]        [<c1cbbedc>] pcmcia_validate_mem+0x1c/0x20 [pcmcia]
[  187.347881]        [<c1cbb452>] pcmcia_card_add+0x22/0x1e0 [pcmcia]
[  187.347890]        [<c1cbb7be>] ds_event+0x7e/0x230 [pcmcia]
[  187.347899]        [<c187357a>] send_event+0xba/0x160 [pcmcia_core]
[  187.347909]        [<c1873d01>] socket_insert+0x111/0x1e0 [pcmcia_core]
[  187.347918]        [<c1874955>] pccardd+0x205/0x2b0 [pcmcia_core]
[  187.347927]        [<8014b374>] kthread+0x74/0x80
[  187.347934]        [<801031ba>] kernel_thread_helper+0x6/0x10
[  187.347942] 
[  187.347944] -> #0 (rsrc_mutex){+.+.+.}:
[  187.347950]        [<801605ac>] __lock_acquire+0x193c/0x1940
[  187.347957]        [<80160669>] lock_acquire+0xb9/0xd0
[  187.347963]        [<8053c6b6>] mutex_lock_nested+0x46/0x2a0
[  187.347969]        [<c1850db3>] nonstatic_find_mem_region+0x83/0x210 [rsrc_nonstatic]
[  187.347977]        [<c1cbbf1a>] pcmcia_find_mem_region+0x3a/0x50 [pcmcia]
[  187.347987]        [<c1cbf600>] set_cis_map+0xc0/0x140 [pcmcia]
[  187.347996]        [<c1cbf97e>] pcmcia_read_cis_mem+0x10e/0x2c0 [pcmcia]
[  187.348006]        [<c1cbfc61>] read_cis_cache+0x131/0x210 [pcmcia]
[  187.348016]        [<c1cbff83>] pccard_get_next_tuple+0x1b3/0x480 [pcmcia]
[  187.348026]        [<c1cc02dc>] pccard_get_first_tuple+0x8c/0xe0 [pcmcia]
[  187.348036]        [<c1cc06db>] pccard_validate_cis+0x13b/0x340 [pcmcia]
[  187.348046]        [<c1cbb464>] pcmcia_card_add+0x34/0x1e0 [pcmcia]
[  187.348055]        [<c1cbb7be>] ds_event+0x7e/0x230 [pcmcia]
[  187.348064]        [<c187357a>] send_event+0xba/0x160 [pcmcia_core]
[  187.348072]        [<c1873d01>] socket_insert+0x111/0x1e0 [pcmcia_core]
[  187.348080]        [<c1874955>] pccardd+0x205/0x2b0 [pcmcia_core]
[  187.348089]        [<8014b374>] kthread+0x74/0x80
[  187.348095]        [<801031ba>] kernel_thread_helper+0x6/0x10
[  187.348102] 
[  187.348103] other info that might help us debug this:
[  187.348105] 
[  187.348109] 2 locks held by pccardd/1248:
[  187.348112]  #0:  (&socket->skt_mutex){+.+.+.}, at: [<c1874852>] pccardd+0x102/0x2b0 [pcmcia_core]
[  187.348125]  #1:  (&socket->ops_mutex){+.+.+.}, at: [<c1cbf56a>] set_cis_map+0x2a/0x140 [pcmcia]
[  187.348139] 
[  187.348140] stack backtrace:
[  187.348145] Pid: 1248, comm: pccardd Not tainted 2.6.33-rc4-ninja-00035-g117c14a-dirty #66
[  187.348150] Call Trace:
[  187.348159]  [<8053b021>] ? printk+0x1d/0x24
[  187.348166]  [<8015e709>] print_circular_bug+0xd9/0xe0
[  187.348172]  [<801605ac>] __lock_acquire+0x193c/0x1940
[  187.348180]  [<801669ed>] ? is_module_text_address+0xd/0x20
[  187.348186]  [<80149237>] ? __kernel_text_address+0x57/0x80
[  187.348192]  [<80105fc1>] ? print_context_stack+0x61/0x120
[  187.348200]  [<8015dcec>] ? trace_hardirqs_on_caller+0x11c/0x160
[  187.348208]  [<801c6cc2>] ? create_object+0x192/0x250
[  187.348215]  [<80160669>] lock_acquire+0xb9/0xd0
[  187.348222]  [<c1850db3>] ? nonstatic_find_mem_region+0x83/0x210 [rsrc_nonstatic]
[  187.348229]  [<8053c6b6>] mutex_lock_nested+0x46/0x2a0
[  187.348236]  [<c1850db3>] ? nonstatic_find_mem_region+0x83/0x210 [rsrc_nonstatic]
[  187.348244]  [<c1850db3>] nonstatic_find_mem_region+0x83/0x210 [rsrc_nonstatic]
[  187.348251]  [<8015dcec>] ? trace_hardirqs_on_caller+0x11c/0x160
[  187.348259]  [<c1850d30>] ? nonstatic_find_mem_region+0x0/0x210 [rsrc_nonstatic]
[  187.348269]  [<c1cbbf1a>] pcmcia_find_mem_region+0x3a/0x50 [pcmcia]
[  187.348279]  [<c1cbf600>] set_cis_map+0xc0/0x140 [pcmcia]
[  187.348289]  [<c1cbf97e>] pcmcia_read_cis_mem+0x10e/0x2c0 [pcmcia]
[  187.348296]  [<8015dd3b>] ? trace_hardirqs_on+0xb/0x10
[  187.348306]  [<c1cbfc61>] read_cis_cache+0x131/0x210 [pcmcia]
[  187.348312]  [<8015da50>] ? mark_held_locks+0x60/0x80
[  187.348322]  [<c1cbff83>] pccard_get_next_tuple+0x1b3/0x480 [pcmcia]
[  187.348328]  [<8015dcec>] ? trace_hardirqs_on_caller+0x11c/0x160
[  187.348338]  [<c1cc02dc>] pccard_get_first_tuple+0x8c/0xe0 [pcmcia]
[  187.348348]  [<c1cc06db>] pccard_validate_cis+0x13b/0x340 [pcmcia]
[  187.348354]  [<8053bead>] ? mutex_unlock+0xd/0x10
[  187.348364]  [<c1cbb464>] pcmcia_card_add+0x34/0x1e0 [pcmcia]
[  187.348370]  [<8053c869>] ? mutex_lock_nested+0x1f9/0x2a0
[  187.348376]  [<8015da50>] ? mark_held_locks+0x60/0x80
[  187.348382]  [<8053be2c>] ? __mutex_unlock_slowpath+0xac/0x120
[  187.348388]  [<8015dcec>] ? trace_hardirqs_on_caller+0x11c/0x160
[  187.348394]  [<8015dd3b>] ? trace_hardirqs_on+0xb/0x10
[  187.348403]  [<c1cbb7be>] ds_event+0x7e/0x230 [pcmcia]
[  187.348412]  [<c187357a>] send_event+0xba/0x160 [pcmcia_core]
[  187.348419]  [<8015dcec>] ? trace_hardirqs_on_caller+0x11c/0x160
[  187.348425]  [<8015dd3b>] ? trace_hardirqs_on+0xb/0x10
[  187.348433]  [<c1873d01>] socket_insert+0x111/0x1e0 [pcmcia_core]
[  187.348443]  [<c1874955>] pccardd+0x205/0x2b0 [pcmcia_core]
[  187.348452]  [<c1874750>] ? pccardd+0x0/0x2b0 [pcmcia_core]
[  187.348458]  [<8014b374>] kthread+0x74/0x80
[  187.348464]  [<8014b300>] ? kthread+0x0/0x80
[  187.348470]  [<801031ba>] kernel_thread_helper+0x6/0x10

Does the new locking work for you? I'd wonder why...

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100117/b31d770d/attachment-0001.sig>


More information about the linux-pcmcia mailing list