summaryrefslogtreecommitdiffstats
path: root/include/linux/mm-arch-hooks.h
diff options
context:
space:
mode:
authorMika Westerberg2019-05-28 17:56:20 +0200
committerMika Westerberg2019-06-12 12:30:46 +0200
commit4f7c2e0d8765a0266b920c66ffc495fde44c1ec8 (patch)
treebba2b7c2b916400273b6e1f9584207b9785c831a /include/linux/mm-arch-hooks.h
parentLinux 5.2-rc4 (diff)
downloadkernel-qcow2-linux-4f7c2e0d8765a0266b920c66ffc495fde44c1ec8.tar.gz
kernel-qcow2-linux-4f7c2e0d8765a0266b920c66ffc495fde44c1ec8.tar.xz
kernel-qcow2-linux-4f7c2e0d8765a0266b920c66ffc495fde44c1ec8.zip
thunderbolt: Make sure device runtime resume completes before taking domain lock
When a device is authorized from userspace by writing to authorized attribute we first take the domain lock and then runtime resume the device in question. There are two issues with this. First is that the device connected notifications are blocked during this time which means we get them only after the authorization operation is complete. Because of this the authorization needed flag from the firmware notification is not reflecting the real authorization status anymore. So what happens is that the "authorized" keeps returning 0 even if the device was already authorized properly. Second issue is that each time the controller is runtime resumed the connection_id field of device connected notification may be different than in the previous resume. We need to use the latest connection_id otherwise the firmware rejects the authorization command. Fix these by moving runtime resume operations to happen before the domain lock is taken, and waiting for the updated device connected notification from the firmware before we allow runtime resume of a device to complete. While there add missing locking to tb_switch_nvm_read(). Fixes: 09f11b6c99fe ("thunderbolt: Take domain lock in switch sysfs attribute callbacks") Reported-by: Pengfei Xu <pengfei.xu@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'include/linux/mm-arch-hooks.h')
0 files changed, 0 insertions, 0 deletions