I've seen this once on Alpine Ridge LP (which you have here) where theYou were right. Patch works fine, and I indeed see the expected warnings in
DROM contents of the older NVM image listed too many ports. Can you try
if the below patch helps?
diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 996c6e2..bdf7f80 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -333,6 +333,12 @@ static int tb_drom_parse_entry_port(struct tb_switch *sw,
int res;
enum tb_port_type type;
+ if (header->index > sw->config.max_port_number) {
+ tb_sw_warn(sw, "DROM has too many entries %u (expected %u)\n",
+ header->index, sw->config.max_port_number);
+ return 0;
+ }
+
port = &sw->ports[header->index];
port->disabled = header->port_disabled;
if (port->disabled)