Skip to contentSkip to conversation

i2c: i801: Prefer async probe

PATCH Applied Mani Milani 4 participants 7 messages Aug 26, 2022 – Oct 1, 2022

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

PATCH 1/1 i2c: i801: Prefer async probe

This i801 driver probe can take more than ~190ms in some devices, since the "i2c_register_spd()" call was added inside "i801_probe_optional_slaves()".

Prefer async probe so that other drivers can be probed and boot can continue in parallel while this driver loads, to reduce boot time. There is no reason to block other drivers from probing while this driver is loading.

---

 drivers/i2c/busses/i2c-i801.c | 1 +
 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-i801.c +1 -0
index a176296f4fff..e06509edc5f3 100644
@@ -1838,6 +1838,7 @@ static struct pci_driver i801_driver = {
 	.shutdown	= i801_shutdown,
 	.driver		= {
 		.pm	= &i801_pm_ops,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
 
Signature · 1 line
2.37.2.672.g94769d06f0-goog
#1 lore raw

Hi Mani,

Quoted 3 lines · Mani Milani

This i801 driver probe can take more than ~190ms in some devices, since the "i2c_register_spd()" call was added inside "i801_probe_optional_slaves()".

Is there anything special about this 190 ms value?

Quoted 16 lines

Prefer async probe so that other drivers can be probed and boot can continue in parallel while this driver loads, to reduce boot time. There is no reason to block other drivers from probing while this driver is loading.

---

 drivers/i2c/busses/i2c-i801.c | 1 +
 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-i801.c +0 -0
index a176296f4fff..e06509edc5f3 100644

drivers/i2c/busses/i2c-i801.c static struct pci_driver i801_driver = { · line 1844

Quoted 7 lines
drivers/i2c/busses/i2c-i801.c +1 -0
@@ -1838,6 +1838,7 @@ static struct pci_driver i801_driver = {
 	.shutdown	= i801_shutdown,
 	.driver		= {
 		.pm	= &i801_pm_ops,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
 

Seems reasonable. I can't foresee any problem that would occur from this change, and preliminary testing on my own workstation is OK.

Jarkko, Heiner, Wolfram, can you think of any reason why we should NOT apply this change?

Thanks,

Signature · 2 lines
Jean Delvare
SUSE L3 Support
#2 lore raw
Quoted 3 lines

Jarkko, Heiner, Wolfram, can you think of any reason why we should NOT apply this change?

Nope. Even if we overlooked something, we can still revert and figure out what went wrong.

#3 lore raw

Hi Jean,

No, there is nothing special about the 190ms. It is just what I measured on my device under test. I decided to include it in the commit message to give a rough idea on how much delay this driver probe can be adding to boot time.

Thank you Jean and Wolfram for reviewing.

P.S: Apologies for sending this twice! My previous message was
rejected by the mailing list due to containing HTML subparts. (fingers crossed this time)

Tested-by
#4 lore raw
In reply to Jean Delvare
Quoted 16 lines · Jean Delvare

drivers/i2c/busses/i2c-i801.c static struct pci_driver i801_driver = { · line 1844

Quoted 12 lines
drivers/i2c/busses/i2c-i801.c +1 -0
index a176296f4fff..e06509edc5f3 100644
@@ -1838,6 +1838,7 @@ static struct pci_driver i801_driver = {
  	.shutdown	= i801_shutdown,
  	.driver		= {
  		.pm	= &i801_pm_ops,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
  	},
  };
 

Seems reasonable. I can't foresee any problem that would occur from this change, and preliminary testing on my own workstation is OK.

Quoted 3 lines

Jarkko, Heiner, Wolfram, can you think of any reason why we should NOT apply this change?

I tested this on two systems. One with EE1004-compliant SPD EEPROM and another with touchpad connected to RMI4 SMB bus.

Average boot time improved ~20 ms over 5 boots on the first system and did not see any issue with the touchpad on second.

Reviewed-by on v1 1/1
#5 lore raw
In reply to Mani Milani
Quoted 20 lines · Mani Milani

This i801 driver probe can take more than ~190ms in some devices, since the "i2c_register_spd()" call was added inside "i801_probe_optional_slaves()".

Prefer async probe so that other drivers can be probed and boot can continue in parallel while this driver loads, to reduce boot time. There is no reason to block other drivers from probing while this driver is loading.

---

 drivers/i2c/busses/i2c-i801.c | 1 +
 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-i801.c +0 -0
index a176296f4fff..e06509edc5f3 100644

drivers/i2c/busses/i2c-i801.c static struct pci_driver i801_driver = { · line 1844

Quoted 7 lines
drivers/i2c/busses/i2c-i801.c +1 -0
@@ -1838,6 +1838,7 @@ static struct pci_driver i801_driver = {
 	.shutdown	= i801_shutdown,
 	.driver		= {
 		.pm	= &i801_pm_ops,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
 
Signature · 2 lines
Jean Delvare
SUSE L3 Support
Applied
#6 lore raw
In reply to Mani Milani
Quoted 10 lines · Mani Milani

This i801 driver probe can take more than ~190ms in some devices, since the "i2c_register_spd()" call was added inside "i801_probe_optional_slaves()".

Prefer async probe so that other drivers can be probed and boot can continue in parallel while this driver loads, to reduce boot time. There is no reason to block other drivers from probing while this driver is loading.

Applied to for-next, thanks!