]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
thunderbolt: Handle rejected Thunderbolt devices
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 28 Mar 2018 12:31:14 +0000 (20:31 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 28 Mar 2018 17:44:47 +0000 (12:44 -0500)
BugLink: http://bugs.launchpad.net/bugs/1730775
The ICM firmware rejects devices if the maximum topology limit is
exceeded (more than 6 devices are connected). If that happens just log a
message to the kernel message buffer and bail out.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
(cherry picked from commit cb653eecde3dc37c67d3e7297ac5445d16f7be13 linux-next)
Signed-off-by: Anthony Wong <anthony.wong@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/thunderbolt/icm.c
drivers/thunderbolt/tb_msgs.h

index 611d28e8e5f27c94864da1db08e293e74a136baf..6d7f8262f86402ad6d44b27bfe60fddf4e480970 100644 (file)
@@ -410,6 +410,12 @@ icm_fr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr)
                ICM_LINK_INFO_DEPTH_SHIFT;
        authorized = pkg->link_info & ICM_LINK_INFO_APPROVED;
 
+       if (pkg->link_info & ICM_LINK_INFO_REJECTED) {
+               tb_info(tb, "switch at %u.%u was rejected by ICM firmware because topology limit exceeded\n",
+                       link, depth);
+               return;
+       }
+
        ret = icm->get_route(tb, link, depth, &route);
        if (ret) {
                tb_err(tb, "failed to find route string for switch at %u.%u\n",
index b0a092baa6054f154b614904407bccfff1df53c7..476bc04cac6cf8c8b036063254b6b47cd4b4fb94 100644 (file)
@@ -176,6 +176,7 @@ struct icm_fr_event_device_connected {
 #define ICM_LINK_INFO_DEPTH_SHIFT      4
 #define ICM_LINK_INFO_DEPTH_MASK       GENMASK(7, 4)
 #define ICM_LINK_INFO_APPROVED         BIT(8)
+#define ICM_LINK_INFO_REJECTED         BIT(9)
 
 struct icm_fr_pkg_approve_device {
        struct icm_pkg_header hdr;