From 674000732d0ec39f6416b8d5e0c7c1756be8b03c Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Mon, 16 Mar 2026 20:53:33 +0100 Subject: [PATCH] drivers/intel/dtbt: Skip mailbox commands on downstream bridges Downstream bridges share the same PCI device ID as the upstream bridge but have no firmware mailbox. Sending commands to them causes timeouts. Add a forward declaration of dtbt_device_ops to detect and skip bridges whose parent is also a dTBT device. Tested on thinkpad t480: The 5s timeout is now gone. Change-Id: I96febb0e52e0ffbe52a237212b8f708a7b05c6d7 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/91689 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Angel Pons --- src/drivers/intel/dtbt/dtbt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/drivers/intel/dtbt/dtbt.c b/src/drivers/intel/dtbt/dtbt.c index 695f44105e..59d7847bd2 100644 --- a/src/drivers/intel/dtbt/dtbt.c +++ b/src/drivers/intel/dtbt/dtbt.c @@ -11,6 +11,7 @@ #include "chip.h" #include "dtbt.h" +static struct device_operations dtbt_device_ops; /* Returns true on success, false on timeout or TBT2PCIE Error field non-zero */ static bool dtbt_cmd(struct device *dev, u8 command, u32 data, u32 timeout) @@ -183,6 +184,16 @@ static void dtbt_enable(struct device *dev) if (!is_dev_enabled(dev) || dev->path.pci.devfn != 0) return; + /* + * Only the upstream bridge has the firmware mailbox (PCIE2TBT/TBT2PCIE + * registers). Downstream bridges behind it share the same PCI device ID + * but have no mailbox, so sending commands to them will timeout. Skip any + * bridge whose parent is also a dTBT bridge (i.e. a downstream bridge). + */ + if (dev->upstream && dev->upstream->dev && + dev->upstream->dev->ops == &dtbt_device_ops) + return; + printk(BIOS_INFO, "dTBT controller found at %s\n", dev_path(dev)); /* Set security level (Table 37/428); failure aborts enable */