diff mbox series

[i-g-t] lib/pm: Increase snd module probe timeout to 10s

Message ID 20180904101938.5545-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [i-g-t] lib/pm: Increase snd module probe timeout to 10s | expand

Commit Message

Chris Wilson Sept. 4, 2018, 10:19 a.m. UTC
5s is often not enough for the sound module to finish loading, so bump
the timeout to 10s. For fun, poll quicker over the 1s!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.linux.com>
---
 lib/igt_pm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Imre Deak Sept. 4, 2018, 1:52 p.m. UTC | #1
On Tue, Sep 04, 2018 at 11:19:38AM +0100, Chris Wilson wrote:
> 5s is often not enough for the sound module to finish loading, so bump
> the timeout to 10s. For fun, poll quicker over the 1s!
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Imre Deak <imre.deak@intel.linux.com>

Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  lib/igt_pm.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_pm.c b/lib/igt_pm.c
> index e86fa4a40..615463a08 100644
> --- a/lib/igt_pm.c
> +++ b/lib/igt_pm.c
> @@ -258,12 +258,15 @@ void igt_pm_enable_audio_runtime_pm(void)
>  	if (__igt_pm_audio_runtime_power_save[0])
>  		return;
>  
> -	for (int count = 0; count < 5; count++) {
> +	for (int count = 0; count < 110; count++) {
>  		if (!__igt_pm_enable_audio_runtime_pm())
>  			return;
>  
>  		/* modprobe(sna-hda-intel) acts async so poll for sysfs */
> -		sleep(1);
> +		if (count < 100)
> +			usleep(10 * 1000); /* poll at 10ms for the first 1s */
> +		else
> +			sleep(1);
>  	}
>  
>  	err = __igt_pm_enable_audio_runtime_pm();
> -- 
> 2.19.0.rc1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
diff mbox series

Patch

diff --git a/lib/igt_pm.c b/lib/igt_pm.c
index e86fa4a40..615463a08 100644
--- a/lib/igt_pm.c
+++ b/lib/igt_pm.c
@@ -258,12 +258,15 @@  void igt_pm_enable_audio_runtime_pm(void)
 	if (__igt_pm_audio_runtime_power_save[0])
 		return;
 
-	for (int count = 0; count < 5; count++) {
+	for (int count = 0; count < 110; count++) {
 		if (!__igt_pm_enable_audio_runtime_pm())
 			return;
 
 		/* modprobe(sna-hda-intel) acts async so poll for sysfs */
-		sleep(1);
+		if (count < 100)
+			usleep(10 * 1000); /* poll at 10ms for the first 1s */
+		else
+			sleep(1);
 	}
 
 	err = __igt_pm_enable_audio_runtime_pm();