public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ander Conselvan De Oliveira <conselvan2@gmail.com>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/i915/gen9: Fix clearing of the BIOS power well request register
Date: Thu, 16 Feb 2017 11:43:06 +0200	[thread overview]
Message-ID: <1487238186.3185.6.camel@gmail.com> (raw)
In-Reply-To: <1487159944-12862-4-git-send-email-imre.deak@intel.com>

On Wed, 2017-02-15 at 13:59 +0200, Imre Deak wrote:
> Atm, in the power well sync_hw hook we are clearing all BIOS request
> bits, not just the one corresponding to the given power well. This could
> turn off an unrelated power well inadvertently if it didn't have a
> request bit set in the driver request register.
> 
> This didn't cause a problem so far, since we enabled all power wells
> explicitly before clearing the BIOS request register. A follow-up
> patchset will add power wells that won't get enabled this way, so fix up
> the inconsistency.
> 
> Cc: Ander Conselvan de Oliveira <conselvan2@gmail.com>
> Cc: David Weinehall <david.weinehall@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index f9aff26..b7b0e0f 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -887,8 +887,13 @@ static bool skl_power_well_enabled(struct drm_i915_private *dev_priv,
>  static void skl_power_well_sync_hw(struct drm_i915_private *dev_priv,
>  				struct i915_power_well *power_well)
>  {
> +	uint32_t mask = SKL_POWER_WELL_REQ(power_well->id);
> +	uint32_t bios_req = I915_READ(HSW_PWR_WELL_BIOS);
> +
>  	/* Clear any request made by BIOS as driver is taking over */
> -	I915_WRITE(HSW_PWR_WELL_BIOS, 0);
> +	if (bios_req & mask) {
> +		I915_WRITE(HSW_PWR_WELL_BIOS, bios_req & ~mask);
> +	}
>  }
>  
>  static void skl_power_well_enable(struct drm_i915_private *dev_priv,

With this change we still end up disabling every power well from the BIOS
register because of intel_power_domains_sync_hw() iterating over all the power
wells. Maybe that's worth mentioning in the commit message? Dunno.

Anyway,

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-16  9:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 11:59 [PATCH 0/4] drm/i915: Fix clearing of BIOS power well requests Imre Deak
2017-02-15 11:59 ` [PATCH 1/4] drm/i915: Remove redundant toggling from the power well sync_hw hooks Imre Deak
2017-02-16  9:13   ` Ander Conselvan De Oliveira
2017-02-15 11:59 ` [PATCH 2/4] drm/i915: Call the sync_hw hook for power wells without a domain Imre Deak
2017-02-16  9:31   ` Ander Conselvan De Oliveira
2017-02-16 14:55     ` Imre Deak
2017-02-15 11:59 ` [PATCH 3/4] drm/i915/gen9: Fix clearing of the BIOS power well request register Imre Deak
2017-02-16  9:43   ` Ander Conselvan De Oliveira [this message]
2017-02-16 15:13     ` Imre Deak
2017-02-15 11:59 ` [PATCH 4/4] drm/i915: Preserve the state of power wells not explicitly enabled Imre Deak
2017-02-16 12:18   ` Ander Conselvan De Oliveira
2017-02-16 12:41     ` Imre Deak
2017-02-15 14:52 ` ✓ Fi.CI.BAT: success for drm/i915: Fix clearing of BIOS power well requests Patchwork

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=1487238186.3185.6.camel@gmail.com \
    --to=conselvan2@gmail.com \
    --cc=imre.deak@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox