• Konrad Rzeszutek Wilk's avatar
    xen/irq: Alter the locking to use a mutex instead of a spinlock. · 77365948
    Konrad Rzeszutek Wilk authored
    When we allocate/change the IRQ informations, we do not
    need to use spinlocks. We can use a mutex (which is
    what the generic IRQ code does for allocations/changes).
    Fixes a slew of:
    
    BUG: sleeping function called from invalid context at /linux/kernel/mutex.c:271
    in_atomic(): 1, irqs_disabled(): 0, pid: 3216, name: xenstored
    2 locks held by xenstored/3216:
     #0:  (&u->bind_mutex){......}, at: [<ffffffffa02e0920>] evtchn_ioctl+0x30/0x3a0 [xen_evtchn]
     #1:  (irq_mapping_update_lock){......}, at: [<ffffffff8138b274>] bind_evtchn_to_irq+0x24/0x90
    Pid: 3216, comm: xenstored Not tainted 3.1.0-rc6-00021-g437a3d1 #2
    Call Trace:
     [<ffffffff81088d10>] __might_sleep+0x100/0x130
     [<ffffffff81645c2f>] mutex_lock_nested+0x2f/0x50
     [<ffffffff81627529>] __irq_alloc_descs+0x49/0x200
     [<ffffffffa02e0920>] ? evtchn_ioctl+0x30/0x3a0 [xen_evtchn]
     [<ffffffff8138b214>] xen_allocate_irq_dynamic+0x34/0x70
     [<ffffffff8138b2ad>] bind_evtchn_to_irq+0x5d/0x90
     [<ffffffffa02e03c0>] ? evtchn_bind_to_user+0x60/0x60 [xen_evtchn]
     [<ffffffff8138c282>] bind_evtchn_to_irqhandler+0x32/0x80
     [<ffffffffa02e03a9>] evtchn_bind_to_user+0x49/0x60 [xen_evtchn]
     [<ffffffffa02e0a34>] evtchn_ioctl+0x144/0x3a0 [xen_evtchn]
     [<ffffffff811b4070>] ? vfsmount_lock_local_unlock+0x50/0x80
     [<ffffffff811a6a1a>] do_vfs_ioctl+0x9a/0x5e0
     [<ffffffff811b476f>] ? mntput+0x1f/0x30
     [<ffffffff81196259>] ? fput+0x199/0x240
     [<ffffffff811a7001>] sys_ioctl+0xa1/0xb0
     [<ffffffff8164ea82>] system_call_fastpath+0x16/0x1b
    Reported-by: default avatarJim Burns <jim_burn@bellsouth.net>
    Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
    Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    77365948
events.c 39.1 KB