thunderbolt: Run tb_xdp_handle_request() in system workqueue
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 22 Oct 2018 11:47:01 +0000 (14:47 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 18 Apr 2019 08:18:53 +0000 (11:18 +0300)
commit559c1e1e013437bf190469efbcbd8bc803285853
tree670acc0667337e573aa5291e63a1b8ba031a7ff7
parentab9f31cfa89ad700f83bfaf30dc8703c4f609d0f
thunderbolt: Run tb_xdp_handle_request() in system workqueue

We run all XDomain requests during discovery in tb->wq and since it only
runs one work at the time it means that sending back reply to the other
domain may be delayed too much depending whether there is an active
XDomain discovery request running.

To make sure we can send reply to the other domain as soon as possible
run tb_xdp_handle_request() in system workqueue instead. Since the
device can be hot-removed in the middle we need to make sure the domain
structure is still around when the function is run so increase reference
count before we schedule the reply work.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/tb.h
drivers/thunderbolt/xdomain.c