linux-kernel-test/drivers/xen/xen-pciback
Konrad Rzeszutek Wilk b1766b6289 xen/pciback: Use mutexes when working with Xenbus state transitions.
The caller that orchestrates the state changes is xenwatch_thread
and it takes a mutex. In our processing of Xenbus states we can take
the luxery of going to sleep on a mutex, so lets do that and
also fix this bug:

BUG: sleeping function called from invalid context at /linux/kernel/mutex.c:271
in_atomic(): 1, irqs_disabled(): 0, pid: 32, name: xenwatch
2 locks held by xenwatch/32:
 #0:  (xenwatch_mutex){......}, at: [<ffffffff813856ab>] xenwatch_thread+0x4b/0x180
 #1:  (&(&pdev->dev_lock)->rlock){......}, at: [<ffffffff8138f05b>] xen_pcibk_disconnect+0x1b/0x80
Pid: 32, comm: xenwatch Not tainted 3.1.0-rc6-00015-g3ce340d #2
Call Trace:
 [<ffffffff810892b2>] __might_sleep+0x102/0x130
 [<ffffffff8163b90f>] mutex_lock_nested+0x2f/0x50
 [<ffffffff81382c1c>] unbind_from_irq+0x2c/0x1b0
 [<ffffffff8110da66>] ? free_irq+0x56/0xb0
 [<ffffffff81382dbc>] unbind_from_irqhandler+0x1c/0x30
 [<ffffffff8138f06b>] xen_pcibk_disconnect+0x2b/0x80
 [<ffffffff81390348>] xen_pcibk_frontend_changed+0xe8/0x140
 [<ffffffff81387ac2>] xenbus_otherend_changed+0xd2/0x150
 [<ffffffff810895c1>] ? get_parent_ip+0x11/0x50
 [<ffffffff81387de0>] frontend_changed+0x10/0x20
 [<ffffffff81385712>] xenwatch_thread+0xb2/0x180

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-09-21 18:18:16 -04:00
..
conf_space_capability.c xen/pciback: Drop two backends, squash and cleanup some code. 2011-07-19 20:58:35 -04:00
conf_space_header.c xen/pciback: miscellaneous adjustments 2011-09-21 18:17:59 -04:00
conf_space_quirks.c xen/pciback: miscellaneous adjustments 2011-09-21 18:17:59 -04:00
conf_space_quirks.h xen/pciback: Drop two backends, squash and cleanup some code. 2011-07-19 20:58:35 -04:00
conf_space.c xen/pciback: miscellaneous adjustments 2011-09-21 18:17:59 -04:00
conf_space.h xen/pciback: Drop two backends, squash and cleanup some code. 2011-07-19 20:58:35 -04:00
Makefile xen/pciback: Have 'passthrough' option instead of XEN_PCIDEV_BACKEND_PASS and XEN_PCIDEV_BACKEND_VPCI 2011-07-19 21:04:20 -04:00
passthrough.c xen/pciback: miscellaneous adjustments 2011-09-21 18:17:59 -04:00
pci_stub.c xen/pciback: miscellaneous adjustments 2011-09-21 18:17:59 -04:00
pciback_ops.c xen/pciback: miscellaneous adjustments 2011-09-21 18:17:59 -04:00
pciback.h xen/pciback: Use mutexes when working with Xenbus state transitions. 2011-09-21 18:18:16 -04:00
vpci.c xen/pciback: miscellaneous adjustments 2011-09-21 18:17:59 -04:00
xenbus.c xen/pciback: Use mutexes when working with Xenbus state transitions. 2011-09-21 18:18:16 -04:00