thunderbolt: Add support for de-authorizing devices
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 10 Nov 2020 08:47:14 +0000 (11:47 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 15 Jan 2021 07:53:06 +0000 (10:53 +0300)
commit3da88be249973f7b74e7b24ed559e6abc2fc5af4
treeb6c607a9375ca1303f7502e329d4ea478ca017df
parentfdb0887c5a87c3a98958d3c5c90f871aa6d1a562
thunderbolt: Add support for de-authorizing devices

In some cases it is useful to be able de-authorize devices. For example
if user logs out the userspace can have a policy that disconnects PCIe
devices until logged in again. This is only possible for software based
connection manager as it directly controls the tunnels.

For this reason make the authorized attribute accept writing 0 which
makes the software connection manager to tear down the corresponding
PCIe tunnel. Userspace can check if this is supported by reading a new
domain attribute deauthorization, that holds 1 in that case.

While there correct tb_domain_approve_switch() kernel-doc and
description of authorized attribute to mention that it is only about
PCIe tunnels.

Cc: Christian Kellner <christian@kellner.me>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com>
Documentation/ABI/testing/sysfs-bus-thunderbolt
Documentation/admin-guide/thunderbolt.rst
drivers/thunderbolt/domain.c
drivers/thunderbolt/switch.c
drivers/thunderbolt/tb.c
drivers/thunderbolt/tb.h