diff options
| author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2017-09-14 06:59:10 -0400 |
|---|---|---|
| committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2018-03-09 04:54:10 -0500 |
| commit | cb653eecde3dc37c67d3e7297ac5445d16f7be13 (patch) | |
| tree | d5fea156a7155e47b7d81466b4a1372da991349f /drivers/thunderbolt | |
| parent | e4be8c9b6a512e274cb6bbac4ac869d73880a8b3 (diff) | |
thunderbolt: Handle rejected Thunderbolt devices
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>
Diffstat (limited to 'drivers/thunderbolt')
| -rw-r--r-- | drivers/thunderbolt/icm.c | 6 | ||||
| -rw-r--r-- | drivers/thunderbolt/tb_msgs.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index 611d28e8e5f2..6d7f8262f864 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c | |||
| @@ -410,6 +410,12 @@ icm_fr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr) | |||
| 410 | ICM_LINK_INFO_DEPTH_SHIFT; | 410 | ICM_LINK_INFO_DEPTH_SHIFT; |
| 411 | authorized = pkg->link_info & ICM_LINK_INFO_APPROVED; | 411 | authorized = pkg->link_info & ICM_LINK_INFO_APPROVED; |
| 412 | 412 | ||
| 413 | if (pkg->link_info & ICM_LINK_INFO_REJECTED) { | ||
| 414 | tb_info(tb, "switch at %u.%u was rejected by ICM firmware because topology limit exceeded\n", | ||
| 415 | link, depth); | ||
| 416 | return; | ||
| 417 | } | ||
| 418 | |||
| 413 | ret = icm->get_route(tb, link, depth, &route); | 419 | ret = icm->get_route(tb, link, depth, &route); |
| 414 | if (ret) { | 420 | if (ret) { |
| 415 | tb_err(tb, "failed to find route string for switch at %u.%u\n", | 421 | tb_err(tb, "failed to find route string for switch at %u.%u\n", |
diff --git a/drivers/thunderbolt/tb_msgs.h b/drivers/thunderbolt/tb_msgs.h index b0a092baa605..476bc04cac6c 100644 --- a/drivers/thunderbolt/tb_msgs.h +++ b/drivers/thunderbolt/tb_msgs.h | |||
| @@ -176,6 +176,7 @@ struct icm_fr_event_device_connected { | |||
| 176 | #define ICM_LINK_INFO_DEPTH_SHIFT 4 | 176 | #define ICM_LINK_INFO_DEPTH_SHIFT 4 |
| 177 | #define ICM_LINK_INFO_DEPTH_MASK GENMASK(7, 4) | 177 | #define ICM_LINK_INFO_DEPTH_MASK GENMASK(7, 4) |
| 178 | #define ICM_LINK_INFO_APPROVED BIT(8) | 178 | #define ICM_LINK_INFO_APPROVED BIT(8) |
| 179 | #define ICM_LINK_INFO_REJECTED BIT(9) | ||
| 179 | 180 | ||
| 180 | struct icm_fr_pkg_approve_device { | 181 | struct icm_fr_pkg_approve_device { |
| 181 | struct icm_pkg_header hdr; | 182 | struct icm_pkg_header hdr; |
