All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Andi Shyti <andi.shyti@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Chris Wilson <chris.p.wilson@linux.intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pcode: Wait 10 seconds for pcode to settle
Date: Wed, 11 Jan 2023 10:25:56 -0500	[thread overview]
Message-ID: <Y77VBNAgY161+QNM@intel.com> (raw)
In-Reply-To: <20230111104447.338136-1-andi.shyti@linux.intel.com>

On Wed, Jan 11, 2023 at 11:44:47AM +0100, Andi Shyti wrote:
> From: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
> 
> During module load not all the punit transaction have completed
> and we might end up timing out, as shown by the following
> warning:
> 
>    i915 0000:4d:00.0: drm_WARN_ON_ONCE(timeout_base_ms > 3)
> 
> Wait 10 seconds for the punit to settle and complete any
> outstanding transactions upon module load.

10 *SECONDS* ?!

> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7814
> 
> Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
> Co-developed-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pcode.c | 35 ++++++++++++++++++++++++++----
>  1 file changed, 31 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pcode.c b/drivers/gpu/drm/i915/intel_pcode.c
> index a234d9b4ed14..3db2ba439bb5 100644
> --- a/drivers/gpu/drm/i915/intel_pcode.c
> +++ b/drivers/gpu/drm/i915/intel_pcode.c
> @@ -204,15 +204,42 @@ int skl_pcode_request(struct intel_uncore *uncore, u32 mbox, u32 request,
>  #undef COND
>  }
>  
> +static int pcode_init_wait(struct intel_uncore *uncore, int timeout_ms)
> +{
> +	if (__intel_wait_for_register_fw(uncore,
> +					 GEN6_PCODE_MAILBOX,
> +					 GEN6_PCODE_READY, 0,
> +					 500, timeout_ms,
> +					 NULL))
> +		return -EPROBE_DEFER;
> +
> +	return skl_pcode_request(uncore,
> +				 DG1_PCODE_STATUS,
> +				 DG1_UNCORE_GET_INIT_STATUS,
> +				 DG1_UNCORE_INIT_STATUS_COMPLETE,
> +				 DG1_UNCORE_INIT_STATUS_COMPLETE, timeout_ms);
> +}
> +
>  int intel_pcode_init(struct intel_uncore *uncore)
>  {
> +	int err;
> +
>  	if (!IS_DGFX(uncore->i915))
>  		return 0;
>  
> -	return skl_pcode_request(uncore, DG1_PCODE_STATUS,
> -				 DG1_UNCORE_GET_INIT_STATUS,
> -				 DG1_UNCORE_INIT_STATUS_COMPLETE,
> -				 DG1_UNCORE_INIT_STATUS_COMPLETE, 180000);
> +	/*
> +	 * Wait 10 seconds so that the punit to settle and complete
> +	 * any outstanding transactions upon module load
> +	 */
> +	err = pcode_init_wait(uncore, 10000);
> +
> +	if (err) {
> +		drm_notice(&uncore->i915->drm,
> +			   "Waiting for HW initialisation...\n");
> +		err = pcode_init_wait(uncore, 180000);
> +	}
> +
> +	return err;
>  }
>  
>  int snb_pcode_read_p(struct intel_uncore *uncore, u32 mbcmd, u32 p1, u32 p2, u32 *val)
> -- 
> 2.34.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Andi Shyti <andi@etezian.org>,
	Chris Wilson <chris.p.wilson@linux.intel.com>
Subject: Re: [PATCH] drm/i915/pcode: Wait 10 seconds for pcode to settle
Date: Wed, 11 Jan 2023 10:25:56 -0500	[thread overview]
Message-ID: <Y77VBNAgY161+QNM@intel.com> (raw)
In-Reply-To: <20230111104447.338136-1-andi.shyti@linux.intel.com>

On Wed, Jan 11, 2023 at 11:44:47AM +0100, Andi Shyti wrote:
> From: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
> 
> During module load not all the punit transaction have completed
> and we might end up timing out, as shown by the following
> warning:
> 
>    i915 0000:4d:00.0: drm_WARN_ON_ONCE(timeout_base_ms > 3)
> 
> Wait 10 seconds for the punit to settle and complete any
> outstanding transactions upon module load.

10 *SECONDS* ?!

> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7814
> 
> Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
> Co-developed-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pcode.c | 35 ++++++++++++++++++++++++++----
>  1 file changed, 31 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pcode.c b/drivers/gpu/drm/i915/intel_pcode.c
> index a234d9b4ed14..3db2ba439bb5 100644
> --- a/drivers/gpu/drm/i915/intel_pcode.c
> +++ b/drivers/gpu/drm/i915/intel_pcode.c
> @@ -204,15 +204,42 @@ int skl_pcode_request(struct intel_uncore *uncore, u32 mbox, u32 request,
>  #undef COND
>  }
>  
> +static int pcode_init_wait(struct intel_uncore *uncore, int timeout_ms)
> +{
> +	if (__intel_wait_for_register_fw(uncore,
> +					 GEN6_PCODE_MAILBOX,
> +					 GEN6_PCODE_READY, 0,
> +					 500, timeout_ms,
> +					 NULL))
> +		return -EPROBE_DEFER;
> +
> +	return skl_pcode_request(uncore,
> +				 DG1_PCODE_STATUS,
> +				 DG1_UNCORE_GET_INIT_STATUS,
> +				 DG1_UNCORE_INIT_STATUS_COMPLETE,
> +				 DG1_UNCORE_INIT_STATUS_COMPLETE, timeout_ms);
> +}
> +
>  int intel_pcode_init(struct intel_uncore *uncore)
>  {
> +	int err;
> +
>  	if (!IS_DGFX(uncore->i915))
>  		return 0;
>  
> -	return skl_pcode_request(uncore, DG1_PCODE_STATUS,
> -				 DG1_UNCORE_GET_INIT_STATUS,
> -				 DG1_UNCORE_INIT_STATUS_COMPLETE,
> -				 DG1_UNCORE_INIT_STATUS_COMPLETE, 180000);
> +	/*
> +	 * Wait 10 seconds so that the punit to settle and complete
> +	 * any outstanding transactions upon module load
> +	 */
> +	err = pcode_init_wait(uncore, 10000);
> +
> +	if (err) {
> +		drm_notice(&uncore->i915->drm,
> +			   "Waiting for HW initialisation...\n");
> +		err = pcode_init_wait(uncore, 180000);
> +	}
> +
> +	return err;
>  }
>  
>  int snb_pcode_read_p(struct intel_uncore *uncore, u32 mbcmd, u32 p1, u32 p2, u32 *val)
> -- 
> 2.34.1
> 

  parent reply	other threads:[~2023-01-11 15:26 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 10:44 [Intel-gfx] [PATCH] drm/i915/pcode: Wait 10 seconds for pcode to settle Andi Shyti
2023-01-11 10:44 ` Andi Shyti
2023-01-11 11:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2023-01-11 12:41 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-01-11 13:18 ` [Intel-gfx] [PATCH] " Jani Nikula
2023-01-11 13:18   ` Jani Nikula
2023-01-11 15:36   ` [Intel-gfx] " Andi Shyti
2023-01-11 15:36     ` Andi Shyti
2023-01-11 16:40     ` [Intel-gfx] " Jani Nikula
2023-01-11 16:40       ` Jani Nikula
2023-01-27  6:50     ` [Intel-gfx] " Gwan-gyeong Mun
2023-01-27  6:50       ` Gwan-gyeong Mun
2023-01-27  9:00       ` [Intel-gfx] " Andi Shyti
2023-01-27  9:00         ` Andi Shyti
2023-01-28  5:41         ` [Intel-gfx] " Gwan-gyeong Mun
2023-01-28  5:41           ` Gwan-gyeong Mun
2023-01-30  8:48           ` [Intel-gfx] " Andi Shyti
2023-01-30  8:48             ` Andi Shyti
2023-01-30 14:41             ` [Intel-gfx] " Rodrigo Vivi
2023-01-30 14:41               ` Rodrigo Vivi
2023-01-30 16:12               ` [Intel-gfx] " Andi Shyti
2023-01-30 16:12                 ` Andi Shyti
2023-01-30 16:37                 ` [Intel-gfx] " Rodrigo Vivi
2023-01-30 17:30                   ` Rodrigo Vivi
2023-01-30 20:41                     ` Andi Shyti
2023-01-30 20:41                       ` Andi Shyti
2023-02-02  8:22                       ` Gwan-gyeong Mun
2023-02-02  9:28                         ` Andi Shyti
2023-02-02  9:28                           ` Andi Shyti
2023-02-02 11:01                           ` Gwan-gyeong Mun
2023-01-11 15:25 ` Rodrigo Vivi [this message]
2023-01-11 15:25   ` Rodrigo Vivi
2023-01-11 15:39   ` [Intel-gfx] " Andi Shyti
2023-01-11 15:39     ` Andi Shyti
2023-01-11 17:06     ` [Intel-gfx] " Rodrigo Vivi
2023-01-16 19:27       ` Andi Shyti
2023-01-16 19:27         ` Andi Shyti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y77VBNAgY161+QNM@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=chris.p.wilson@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.