linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: i801: Prefer async probe
@ 2022-08-26  7:44 Mani Milani
  2022-09-29 15:43 ` Jean Delvare
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mani Milani @ 2022-08-26  7:44 UTC (permalink / raw)
  To: LKML; +Cc: Mani Milani, Jean Delvare, linux-i2c

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.

Signed-off-by: Mani Milani <mani@chromium.org>
---

 drivers/i2c/busses/i2c-i801.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index a176296f4fff..e06509edc5f3 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1838,6 +1838,7 @@ static struct pci_driver i801_driver = {
 	.shutdown	= i801_shutdown,
 	.driver		= {
 		.pm	= &i801_pm_ops,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
 
-- 
2.37.2.672.g94769d06f0-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] i2c: i801: Prefer async probe
  2022-08-26  7:44 [PATCH] i2c: i801: Prefer async probe Mani Milani
@ 2022-09-29 15:43 ` Jean Delvare
  2022-09-29 20:59   ` Wolfram Sang
  2022-09-30 10:26   ` Jarkko Nikula
  2022-09-30 13:24 ` Jean Delvare
  2022-10-01 22:56 ` Wolfram Sang
  2 siblings, 2 replies; 7+ messages in thread
From: Jean Delvare @ 2022-09-29 15:43 UTC (permalink / raw)
  To: Mani Milani; +Cc: LKML, linux-i2c, Jarkko Nikula, Heiner Kallweit, Wolfram Sang

Hi Mani,

On Fri, 26 Aug 2022 17:44:30 +1000, Mani Milani wrote:
> 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?

> 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.
> 
> Signed-off-by: Mani Milani <mani@chromium.org>
> ---
> 
>  drivers/i2c/busses/i2c-i801.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index a176296f4fff..e06509edc5f3 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -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,
-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i2c: i801: Prefer async probe
  2022-09-29 15:43 ` Jean Delvare
@ 2022-09-29 20:59   ` Wolfram Sang
  2022-09-30  8:45     ` Mani Milani
  2022-09-30 10:26   ` Jarkko Nikula
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2022-09-29 20:59 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Mani Milani, LKML, linux-i2c, Jarkko Nikula, Heiner Kallweit

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]


> 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.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i2c: i801: Prefer async probe
  2022-09-29 20:59   ` Wolfram Sang
@ 2022-09-30  8:45     ` Mani Milani
  0 siblings, 0 replies; 7+ messages in thread
From: Mani Milani @ 2022-09-30  8:45 UTC (permalink / raw)
  To: Wolfram Sang, Jean Delvare, LKML, linux-i2c, Jarkko Nikula,
	Heiner Kallweit

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)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i2c: i801: Prefer async probe
  2022-09-29 15:43 ` Jean Delvare
  2022-09-29 20:59   ` Wolfram Sang
@ 2022-09-30 10:26   ` Jarkko Nikula
  1 sibling, 0 replies; 7+ messages in thread
From: Jarkko Nikula @ 2022-09-30 10:26 UTC (permalink / raw)
  To: Jean Delvare, Mani Milani; +Cc: LKML, linux-i2c, Heiner Kallweit, Wolfram Sang

On 9/29/22 18:43, Jean Delvare wrote:
>> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
>> index a176296f4fff..e06509edc5f3 100644
>> --- a/drivers/i2c/busses/i2c-i801.c
>> +++ b/drivers/i2c/busses/i2c-i801.c
>> @@ -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?
> 
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.

Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i2c: i801: Prefer async probe
  2022-08-26  7:44 [PATCH] i2c: i801: Prefer async probe Mani Milani
  2022-09-29 15:43 ` Jean Delvare
@ 2022-09-30 13:24 ` Jean Delvare
  2022-10-01 22:56 ` Wolfram Sang
  2 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2022-09-30 13:24 UTC (permalink / raw)
  To: Mani Milani; +Cc: LKML, linux-i2c

On Fri, 26 Aug 2022 17:44:30 +1000, Mani Milani wrote:
> 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.
> 
> Signed-off-by: Mani Milani <mani@chromium.org>
> ---
> 
>  drivers/i2c/busses/i2c-i801.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index a176296f4fff..e06509edc5f3 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -1838,6 +1838,7 @@ static struct pci_driver i801_driver = {
>  	.shutdown	= i801_shutdown,
>  	.driver		= {
>  		.pm	= &i801_pm_ops,
> +		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
>  	},
>  };
>  

Reviewed-by: Jean Delvare <jdelvare@suse.de>

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i2c: i801: Prefer async probe
  2022-08-26  7:44 [PATCH] i2c: i801: Prefer async probe Mani Milani
  2022-09-29 15:43 ` Jean Delvare
  2022-09-30 13:24 ` Jean Delvare
@ 2022-10-01 22:56 ` Wolfram Sang
  2 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2022-10-01 22:56 UTC (permalink / raw)
  To: Mani Milani; +Cc: LKML, Jean Delvare, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

On Fri, Aug 26, 2022 at 05:44:30PM +1000, Mani Milani wrote:
> 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.
> 
> Signed-off-by: Mani Milani <mani@chromium.org>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-01 22:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26  7:44 [PATCH] i2c: i801: Prefer async probe Mani Milani
2022-09-29 15:43 ` Jean Delvare
2022-09-29 20:59   ` Wolfram Sang
2022-09-30  8:45     ` Mani Milani
2022-09-30 10:26   ` Jarkko Nikula
2022-09-30 13:24 ` Jean Delvare
2022-10-01 22:56 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).