[Thunderbolt-Software] Thunderbolt causes NULL pointer deref after cold boot. ThinkPad Yoga 370

Mika Westerberg mika.westerberg at linux.intel.com
Wed Mar 7 23:31:20 PST 2018

On Wed, Mar 07, 2018 at 12:16:06PM -0500, Jordan Glover wrote:
> Thanks for the reply. I'm aware of this Wake-on-Lan bug but the workaround 
> doesn't help in my case. I reported it to Lenovo and they confirm that this 
> model doesn't have fix for that bug yet but nobody knows if it's the same issue 
> as tweaking BIOS has no effect. Unfortunately there is no ETA for update from 
> them.

It definitely sounds like an issue in BIOS/FW because the firmware
should be up and running when the host controller appears and for some
reason it is not.

> I'll happily test any patch.

Can you try the below patch? It should fix the crash but not the
underlying issue, though.

diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c
index ab02d13f40b7..75af7852b7ef 100644
--- a/drivers/thunderbolt/icm.c
+++ b/drivers/thunderbolt/icm.c
@@ -915,6 +915,9 @@ static int icm_firmware_reset(struct tb *tb, struct tb_nhi *nhi)
 	struct icm *icm = tb_priv(tb);
 	u32 val;
+	if (!icm->upstream_port)
+		return -ENODEV;
 	/* Put ARC to wait for CIO reset event to happen */
 	val = ioread32(nhi->iobase + REG_FW_STS);

More information about the Thunderbolt-Software mailing list