Skip to contentSkip to conversation

thunderbolt: Reduce retry timeout to speed up boot for some devices

PATCH Applied Werner Sembach 3 participants 9 messages Dec 20, 2023 – Dec 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thunderbolt: Reduce retry timeout to speed up boot for some devices

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

---
 drivers/thunderbolt/icm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/icm.c +1 -1
index d8b9c734abd36..56790d50f9e32 100644
@@ -1020,7 +1020,7 @@ icm_tr_driver_ready(struct tb *tb, enum tb_security_level *security_level,
 
 	memset(&reply, 0, sizeof(reply));
 	ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
-			  1, 10, 2000);
+			  1, 10, 250);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.34.1
#1 lore raw

Am 20.12.23 um 16:09 schrieb Werner Sembach:

Quoted 8 lines

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

Quoted 4 lines

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

I wonder if this could also land in stable? Or would it be to risky?

Quoted 17 lines
---
  drivers/thunderbolt/icm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/icm.c +1 -1
index d8b9c734abd36..56790d50f9e32 100644
@@ -1020,7 +1020,7 @@ icm_tr_driver_ready(struct tb *tb, enum tb_security_level *security_level,
 
  	memset(&reply, 0, sizeof(reply));
  	ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
-			  1, 10, 2000);
+			  1, 10, 250);
  	if (ret)
  		return ret;
 
#2 lore raw
Quoted 9 lines · Werner Sembach

Am 20.12.23 um 16:09 schrieb Werner Sembach:

Quoted 8 lines

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

Quoted 5 lines
Quoted 4 lines

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

I wonder if this could also land in stable? Or would it be to risky?

If it's really a bugfix now, why would it _not_ be relevant for stable?

thanks,

greg k-h

#3 lore raw

Am 20.12.23 um 17:04 schrieb Greg KH:

Quoted 10 lines · Werner Sembach
Quoted 9 lines

Am 20.12.23 um 16:09 schrieb Werner Sembach:

Quoted 8 lines

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

I wonder if this could also land in stable? Or would it be to risky?

If it's really a bugfix now, why would it _not_ be relevant for stable?

Because it changes a timeout that could cause issues if set to low: This Patch sets to to 250ms. Set to 50ms it causes issues, currently it's 2000ms, 2 people tested that 250ms is enough, but i don't know if this is a big enough sample size for stable.

The advantage is significantly faster boot time on affected devices (~12s down to ~3s), however they do already work fine without it.

Kind regards,

Werner

Quoted 4 lines

thanks,

greg k-h

#4 lore raw
In reply to Greg KH

Am 20.12.23 um 17:04 schrieb Greg KH:

Quoted 10 lines · Werner Sembach
Quoted 9 lines

Am 20.12.23 um 16:09 schrieb Werner Sembach:

Quoted 8 lines

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

I wonder if this could also land in stable? Or would it be to risky?

If it's really a bugfix now, why would it _not_ be relevant for stable?

Because it changes a timeout that could cause issues if set to low: This Patch sets to to 250ms. Set to 50ms it causes issues, currently it's 2000ms, 2 people tested that 250ms is enough, but i don't know if this is a big enough sample size for stable.

The advantage is significantly faster boot time on affected devices (~12s down to ~3s), however they do already work fine without it.

Kind regards,

Werner

Quoted 4 lines

thanks,

greg k-h

#5 lore raw
Quoted 15 lines · Werner Sembach

Am 20.12.23 um 17:04 schrieb Greg KH:

Quoted 13 lines · Werner Sembach
Quoted 12 lines

Am 20.12.23 um 16:09 schrieb Werner Sembach:

Quoted 11 lines

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

I wonder if this could also land in stable? Or would it be to risky?

If it's really a bugfix now, why would it _not_ be relevant for stable?

Because it changes a timeout that could cause issues if set to low: This Patch sets to to 250ms. Set to 50ms it causes issues, currently it's 2000ms, 2 people tested that 250ms is enough, but i don't know if this is a big enough sample size for stable.

Remember, the next kernel will be a stable kernel tree, just like the one after that. If it's good enough for Linus's tree, why wouldn't it be good enough for all stable trees? Either it works or it doesn't, none of this "we will break things when you move to a new kernel" stuff please.

thanks,

greg k-h

#6 lore raw

Hi,

Quoted 25 lines · Greg KH
Quoted 15 lines · Werner Sembach

Am 20.12.23 um 17:04 schrieb Greg KH:

Quoted 13 lines · Werner Sembach
Quoted 12 lines

Am 20.12.23 um 16:09 schrieb Werner Sembach:

Quoted 11 lines

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

I wonder if this could also land in stable? Or would it be to risky?

If it's really a bugfix now, why would it _not_ be relevant for stable?

Because it changes a timeout that could cause issues if set to low: This Patch sets to to 250ms. Set to 50ms it causes issues, currently it's 2000ms, 2 people tested that 250ms is enough, but i don't know if this is a big enough sample size for stable.

Quoted 5 lines

Remember, the next kernel will be a stable kernel tree, just like the one after that. If it's good enough for Linus's tree, why wouldn't it be good enough for all stable trees? Either it works or it doesn't, none of this "we will break things when you move to a new kernel" stuff please.

Since this is kind of "improvement" over already functioning code, I would put it to v6.8 and not to stable trees. This way it gets more some more exposure before landing to distro kernels.

It would be nice to get Tested-by from the folks involved on that bugzilla as well, if that's possible. I can try this on my side on a Maple Ridge based system (that does not have the original issue) so that we know that it does not cause any issues on them.

#7 lore raw
In reply to Greg KH

Am 20.12.23 um 17:04 schrieb Greg KH:

Quoted 10 lines · Werner Sembach
Quoted 9 lines

Am 20.12.23 um 16:09 schrieb Werner Sembach:

Quoted 8 lines

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

I wonder if this could also land in stable? Or would it be to risky?

If it's really a bugfix now, why would it _not_ be relevant for stable?

edit: Sorry if this is the 3rd time I send this, I got mail server errors (hopefully fixed now) and am not sure if it reached out

Because it changes a timeout that could cause issues if set to low: This Patch sets to to 250ms. Set to 50ms it causes issues, currently it's 2000ms, 2 people tested that 250ms is enough, but i don't know if this is a big enough sample size for stable.

The advantage is significantly faster boot time on affected devices (~12s down to ~3s), however they do already work fine without it.

Kind regards,

Werner

Quoted 4 lines

thanks,

greg k-h

#8 lore raw
In reply to Werner Sembach
Quoted 8 lines · Werner Sembach

This is a followup to "thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge".

It seems like the timeout can be reduced to 250ms. This reduces the overall delay caused by the retires to ~1s. This is about the time other things being initialized in parallel need anyway*, so like this the effective boot time is no longer compromised.

Quoted 4 lines

*I only had a single device available for my measurements: A Clevo X170KM-G desktop replacement notebook.

Applied to thunderbolt.git/next, thanks!