Skip to contentSkip to conversation

broken pcmcia_bus_match for dynids

DISCUSSION Jiri Slaby 2 participants 3 messages Jan 13, 2010 – Jan 16, 2010

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

Hi,

stanse found that when PCMCIA_DEV_ID_MATCH_FAKE_CIS is set in match_flags for a dynid, the pcmcia layer may deadlock.

pcmcia_load_firmware in such case calls non-atomic operations (request_firmware, kzalloc(GFP_KERNEL)), while dynids.lock spinlock is held.

Any ideas how to solve this? Any idea, why p_drv->dynids.lock is not a mutex instead?

thanks,

Signature · 1 line
js
#1 lore raw

Hey,

Quoted 8 lines · Jiri Slaby

stanse found that when PCMCIA_DEV_ID_MATCH_FAKE_CIS is set in match_flags for a dynid, the pcmcia layer may deadlock.

pcmcia_load_firmware in such case calls non-atomic operations (request_firmware, kzalloc(GFP_KERNEL)), while dynids.lock spinlock is held.

Any ideas how to solve this? Any idea, why p_drv->dynids.lock is not a mutex instead?

Well, as dynid->id.cisfile is never set, it is still NULL, which means pcmcia_load_firmware is left immediately, without calling the (blocking) request_firmare(). So this actually isn't a problem, AFAICS.

Nonetheless, I'll prepare a patch to replace it with a mutex for 2.6.34.

Best,
Dominik

author
#2 lore raw
Quoted 1 line · Dominik Brodowski

Well, as dynid->id.cisfile is never set, it is still NULL

Ah, I overlooked that. Thanks for pointing out.

Signature · 1 line
js