From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915/bxt: Force reprogramming a PHY with invalid HW state
Date: Thu, 21 Apr 2016 15:11:27 +0300 [thread overview]
Message-ID: <20160421121127.GL4329@intel.com> (raw)
In-Reply-To: <1461174366-16758-4-git-send-email-imre.deak@intel.com>
On Wed, Apr 20, 2016 at 08:46:06PM +0300, Imre Deak wrote:
> It's possible that BIOS enables PHY0, but it programmes only the first
> channel on it. Since we program the PHYs only during driver loading this
> is an incorrect configuration from the driver's point of view, since we
> may use both channels eventually. Detect this scenario and force
> reprogramming the PHY in this case.
>
> The actual scenario for me was that the lane optimization for the second
> channel in PHY0 was not setup by BIOS and so a state verification
> warning was triggered. Everything else was setup properly.
One thing that bothers me with this reprogramming scheme is that we
don't fully power down the PHY before reprogramming. If CHV is any
indication that could leave the PHY in some wonky intermediate state
where it doesn't fully power down when unused. That problem was caught
on CHV by assert_chv_phy_status() and/or assert_chv_phy_powergate().
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index e68914a..32ac456 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1767,6 +1767,9 @@ static void broxton_phy_wait_grc_done(struct drm_i915_private *dev_priv,
> DRM_ERROR("timeout waiting for PHY1 GRC\n");
> }
>
> +static bool broxton_phy_verify_state(struct drm_i915_private *dev_priv,
> + enum dpio_phy phy);
> +
> static void broxton_phy_init(struct drm_i915_private *dev_priv,
> enum dpio_phy phy)
> {
> @@ -1774,17 +1777,24 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv,
> u32 ports, val;
>
> if (broxton_phy_is_enabled(dev_priv, phy)) {
> - DRM_DEBUG_DRIVER("DDI PHY %d already enabled, "
> - "won't reprogram it\n", phy);
> /* Still read out the GRC value for state verification */
> if (phy == DPIO_PHY0)
> dev_priv->bxt_phy_grc = broxton_get_grc(dev_priv, phy);
>
> - return;
> +
> + if (broxton_phy_verify_state(dev_priv, phy)) {
> + DRM_DEBUG_DRIVER("DDI PHY %d already enabled, "
> + "won't reprogram it\n", phy);
> +
> + return;
> + }
> +
> + DRM_DEBUG_DRIVER("DDI PHY %d enabled with invalid state, "
> + "force reprogramming it\n", phy);
> + } else {
> + DRM_DEBUG_DRIVER("DDI PHY %d not enabled, enabling it\n", phy);
> }
>
> - DRM_DEBUG_DRIVER("DDI PHY %d not enabled, enabling it\n", phy);
> -
> val = I915_READ(BXT_P_CR_GT_DISP_PWRON);
> val |= GT_DISPLAY_POWER_ON(phy);
> I915_WRITE(BXT_P_CR_GT_DISP_PWRON, val);
> --
> 2.5.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-04-21 12:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 17:46 [PATCH 0/3] drm/i915/bxt: Fix PHY init with partial BIOS config Imre Deak
2016-04-20 17:46 ` [PATCH 1/3] drm/i915/bxt: Use PHY0 GRC value for HW state verification Imre Deak
2016-04-20 17:46 ` [PATCH 2/3] drm/i915/bxt: Wait for PHY1 GRC done if PHY0 was already enabled Imre Deak
2016-04-21 12:08 ` Ville Syrjälä
2016-04-21 16:19 ` [PATCH v2 " Imre Deak
2016-04-21 16:43 ` Ville Syrjälä
2016-04-21 16:51 ` Imre Deak
2016-04-20 17:46 ` [PATCH 3/3] drm/i915/bxt: Force reprogramming a PHY with invalid HW state Imre Deak
2016-04-21 12:11 ` Ville Syrjälä [this message]
2016-04-21 10:57 ` ✓ Fi.CI.BAT: success for drm/i915/bxt: Fix PHY init with partial BIOS config Patchwork
2016-04-21 12:05 ` ✗ Fi.CI.BAT: failure " Patchwork
2016-04-22 13:15 ` Imre Deak
2016-04-22 7:27 ` ✗ Fi.CI.BAT: failure for drm/i915/bxt: Fix PHY init with partial BIOS config (rev2) Patchwork
2016-04-22 13:37 ` Imre Deak
2016-04-22 14:07 ` Ville Syrjälä
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=20160421121127.GL4329@intel.com \
--to=ville.syrjala@linux.intel.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 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.