Ross Lagerwall
72978b2fe2
xen/manage: Fix USB interaction issues when resuming
Commit 61a734d305 ("xen/manage: Always freeze/thaw processes when
suspend/resuming") ensured that userspace processes were always frozen
before suspending to reduce interaction issues when resuming devices.
However, freeze_processes() does not freeze kernel threads. Freeze
kernel threads as well to prevent deadlocks with the khubd thread when
resuming devices.
This is what native suspend and resume does.
Example deadlock:
[ 7279.648010] [<ffffffff81446bde>] ? xen_poll_irq_timeout+0x3e/0x50
[ 7279.648010] [<ffffffff81448d60>] xen_poll_irq+0x10/0x20
[ 7279.648010] [<ffffffff81011723>] xen_lock_spinning+0xb3/0x120
[ 7279.648010] [<ffffffff810115d1>] __raw_callee_save_xen_lock_spinning+0x11/0x20
[ 7279.648010] [<ffffffff815620b6>] ? usb_control_msg+0xe6/0x120
[ 7279.648010] [<ffffffff81747e50>] ? _raw_spin_lock_irq+0x50/0x60
[ 7279.648010] [<ffffffff8174522c>] wait_for_completion+0xac/0x160
[ 7279.648010] [<ffffffff8109c520>] ? try_to_wake_up+0x2c0/0x2c0
[ 7279.648010] [<ffffffff814b60f2>] dpm_wait+0x32/0x40
[ 7279.648010] [<ffffffff814b6eb0>] device_resume+0x90/0x210
[ 7279.648010] [<ffffffff814b7d71>] dpm_resume+0x121/0x250
[ 7279.648010] [<ffffffff8144c570>] ? xenbus_dev_request_and_reply+0xc0/0xc0
[ 7279.648010] [<ffffffff814b80d5>] dpm_resume_end+0x15/0x30
[ 7279.648010] [<ffffffff81449fba>] do_suspend+0x10a/0x200
[ 7279.648010] [<ffffffff8144a2f0>] ? xen_pre_suspend+0x20/0x20
[ 7279.648010] [<ffffffff8144a1d0>] shutdown_handler+0x120/0x150
[ 7279.648010] [<ffffffff8144c60f>] xenwatch_thread+0x9f/0x160
[ 7279.648010] [<ffffffff810ac510>] ? finish_wait+0x80/0x80
[ 7279.648010] [<ffffffff8108d189>] kthread+0xc9/0xe0
[ 7279.648010] [<ffffffff8108d0c0>] ? flush_kthread_worker+0x80/0x80
[ 7279.648010] [<ffffffff8175087c>] ret_from_fork+0x7c/0xb0
[ 7279.648010] [<ffffffff8108d0c0>] ? flush_kthread_worker+0x80/0x80
[ 7441.216287] INFO: task khubd:89 blocked for more than 120 seconds.
[ 7441.219457] Tainted: G X 3.13.11-ckt12.kz #1
[ 7441.222176] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 7441.225827] khubd D ffff88003f433440 0 89 2 0x00000000
[ 7441.229258] ffff88003ceb9b98 0000000000000046 ffff88003ce83000 0000000000013440
[ 7441.232959] ffff88003ceb9fd8 0000000000013440 ffff88003cd13000 ffff88003ce83000
[ 7441.236658] 0000000000000286 ffff88003d3e0000 ffff88003ceb9bd0 00000001001aa01e
[ 7441.240415] Call Trace:
[ 7441.241614] [<ffffffff817442f9>] schedule+0x29/0x70
[ 7441.243930] [<ffffffff81743406>] schedule_timeout+0x166/0x2c0
[ 7441.246681] [<ffffffff81075b80>] ? call_timer_fn+0x110/0x110
[ 7441.249339] [<ffffffff8174357e>] schedule_timeout_uninterruptible+0x1e/0x20
[ 7441.252644] [<ffffffff81077710>] msleep+0x20/0x30
[ 7441.254812] [<ffffffff81555f00>] hub_port_reset+0xf0/0x580
[ 7441.257400] [<ffffffff81558465>] hub_port_init+0x75/0xb40
[ 7441.259981] [<ffffffff814bb3c9>] ? update_autosuspend+0x39/0x60
[ 7441.262817] [<ffffffff814bb4f0>] ? pm_runtime_set_autosuspend_delay+0x50/0xa0
[ 7441.266212] [<ffffffff8155a64a>] hub_thread+0x71a/0x1750
[ 7441.268728] [<ffffffff810ac510>] ? finish_wait+0x80/0x80
[ 7441.271272] [<ffffffff81559f30>] ? usb_port_resume+0x670/0x670
[ 7441.274067] [<ffffffff8108d189>] kthread+0xc9/0xe0
[ 7441.276305] [<ffffffff8108d0c0>] ? flush_kthread_worker+0x80/0x80
[ 7441.279131] [<ffffffff8175087c>] ret_from_fork+0x7c/0xb0
[ 7441.281659] [<ffffffff8108d0c0>] ? flush_kthread_worker+0x80/0x80
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: stable@vger.kernel.org
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
2015-02-06 15:49:09 +00:00
..
2015-01-14 07:53:51 +13:00
2014-12-14 16:43:47 -08:00
2014-12-18 20:28:33 -08:00
2014-12-14 16:10:09 -08:00
2014-12-29 21:24:00 +01:00
2014-12-11 17:56:37 -08:00
2015-01-28 14:03:16 +00:00
2014-12-15 13:23:09 -05:00
2015-01-16 19:10:41 -08:00
2014-12-30 13:34:36 -06:00
2015-01-17 11:33:57 -08:00
2014-12-30 15:27:20 +01:00
2014-12-29 21:23:41 +01:00
2014-12-29 21:23:41 +01:00
2014-12-14 16:10:09 -08:00
2015-01-13 23:07:58 +05:30
2014-12-14 16:10:09 -08:00
2014-12-14 16:43:47 -08:00
2014-12-10 20:53:21 +01:00
2014-12-14 16:10:09 -08:00
2015-01-09 07:57:35 +01:00
2015-01-08 10:36:37 +10:00
2015-01-09 14:41:01 +01:00
2014-12-15 17:33:47 -08:00
2014-12-14 16:43:47 -08:00
2014-12-17 10:16:27 -08:00
2014-12-20 13:52:52 -08:00
2014-12-14 16:10:09 -08:00
2015-01-08 17:59:04 -08:00
2014-12-20 13:42:57 -08:00
2014-12-31 12:59:34 -08:00
2015-01-05 12:40:06 +01:00
2014-12-15 17:30:09 -08:00
2015-01-12 15:31:35 -05:00
2015-01-13 13:49:01 -08:00
2014-12-09 16:32:32 +02:00
2014-12-19 19:32:47 +01:00
2014-12-14 16:10:09 -08:00
2015-01-09 15:46:37 -08:00
2014-12-17 12:31:13 -05:00
2014-12-18 20:28:33 -08:00
2014-12-17 09:59:26 -08:00
2014-12-30 16:59:59 -08:00
2015-01-17 08:18:08 +13:00
2015-01-14 09:47:19 +01:00
2014-12-17 09:59:26 -08:00
2015-01-28 14:03:13 +00:00
2014-12-18 20:28:33 -08:00
2014-12-16 14:53:01 -08:00
2014-12-14 16:43:47 -08:00
2014-12-19 14:02:02 -08:00
2014-12-14 16:43:47 -08:00
2014-12-23 15:44:32 +05:30
2015-01-07 10:44:39 +01:00
2014-12-18 20:24:55 -08:00
2014-12-18 20:28:33 -08:00
2014-12-17 02:35:42 +01:00
2014-12-17 10:10:51 -08:00
2014-12-29 13:24:38 -08:00
2014-12-14 16:10:09 -08:00
2015-01-16 19:11:31 -08:00
2014-12-14 16:10:09 -08:00
2014-12-18 09:55:55 +01:00
2015-01-09 15:43:01 +01:00
2014-12-05 03:08:24 +01:00
2014-12-15 15:52:01 -08:00
2014-12-24 12:57:54 +00:00
2014-12-11 17:56:37 -08:00
2015-01-12 19:49:47 -08:00
2015-01-09 15:25:58 -08:00
2015-01-15 19:20:26 +13:00
2015-01-09 13:46:02 -08:00
2014-12-14 16:43:47 -08:00
2015-01-14 16:27:23 -08:00
2015-01-07 10:29:11 -07:00
2015-01-13 15:23:26 +13:00
2015-01-13 15:13:45 +02:00
2015-01-06 16:35:36 +02:00
2014-12-14 16:43:47 -08:00
2014-12-18 16:01:20 +01:00
2015-02-06 15:49:09 +00:00
2014-12-15 18:06:13 -08:00
2014-12-22 11:47:37 +02:00