From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH] drm/i915/vlv: assert and de-assert sideband reset on resume Date: Tue, 15 Apr 2014 16:04:23 +0300 Message-ID: <1397567063.2712.4.camel@intelbox> References: <1397235616-25925-1-git-send-email-jbarnes@virtuousgeek.org> <20140411172624.GG18465@intel.com> <20140411103540.55c01292@jbarnes-desktop> <20140411181021.GI18465@intel.com> <20140411111559.08436702@jbarnes-desktop> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0170733425==" Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FF4D6E8D7 for ; Tue, 15 Apr 2014 06:04:59 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: "Purushothaman, Vijay A" Cc: "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org --===============0170733425== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-SQhPWE+J/3JWzHvPAHU4" --=-SQhPWE+J/3JWzHvPAHU4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2014-04-15 at 11:39 +0000, Purushothaman, Vijay A wrote: >=20 > > -----Original Message----- > > From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Beh= alf Of > > Jesse Barnes > > Sent: Friday, April 11, 2014 11:46 PM > > To: Ville Syrj=C3=A4l=C3=A4 > > Cc: intel-gfx@lists.freedesktop.org > > Subject: Re: [Intel-gfx] [PATCH] drm/i915/vlv: assert and de-assert sid= eband > > reset on resume > >=20 > > On Fri, 11 Apr 2014 21:10:21 +0300 > > Ville Syrj=C3=A4l=C3=A4 wrote: > >=20 > > > On Fri, Apr 11, 2014 at 10:35:40AM -0700, Jesse Barnes wrote: > > > > On Fri, 11 Apr 2014 20:26:24 +0300 > > > > Ville Syrj=C3=A4l=C3=A4 wrote: > > > > > > > > > On Fri, Apr 11, 2014 at 10:00:16AM -0700, Jesse Barnes wrote: > > > > > > This is a bit like the CMN reset de-assert we do in DPIO_CTL, e= xcept > > > > > > that it resets the whole common lane section of the PHY. This = is > > > > > > required on machines where the BIOS doesn't do this for us on r= esume to > > > > > > properly re-calibrate and get the PHY ready to transmit data. > > > > > > > > > > > > Without this patch, such machines won't resume correctly much o= f the > > time, > > > > > > with the symptom being a 'port ready' timeout and/or a link tra= ining > > > > > > failure. > > > > > > > > > > > > I'm open to better suggestions on how to do the power well togg= le, with > > > > > > the existing code it looks like I'd have to walk through a bunc= h of > > > > > > power domains looking for a match, then call a generic function= which > > > > > > will warn. I'd prefer to just expose the specific domains dire= ctly for > > > > > > low level platform code like this. > > > > > > > > > > > > Signed-off-by: Jesse Barnes > > > > > > --- > > > > > > drivers/gpu/drm/i915/intel_pm.c | 4 ++-- > > > > > > drivers/gpu/drm/i915/intel_uncore.c | 19 +++++++++++++++++++ > > > > > > 2 files changed, 21 insertions(+), 2 deletions(-) > > > > > > > > > > > > diff --git a/drivers/gpu/drm/i915/intel_pm.c > > b/drivers/gpu/drm/i915/intel_pm.c > > > > > > index fa00185..3afd0bc 100644 > > > > > > --- a/drivers/gpu/drm/i915/intel_pm.c > > > > > > +++ b/drivers/gpu/drm/i915/intel_pm.c > > > > > > @@ -5454,8 +5454,8 @@ static bool > > i9xx_always_on_power_well_enabled(struct drm_i915_private *dev_priv, > > > > > > return true; > > > > > > } > > > > > > > > > > > > -static void vlv_set_power_well(struct drm_i915_private *dev_pr= iv, > > > > > > - struct i915_power_well *power_well, bool > > enable) > > > > > > +void vlv_set_power_well(struct drm_i915_private *dev_priv, > > > > > > + struct i915_power_well *power_well, bool > > enable) > > > > > > { > > > > > > enum punit_power_well power_well_id =3D power_well->data; > > > > > > u32 mask; > > > > > > diff --git a/drivers/gpu/drm/i915/intel_uncore.c > > b/drivers/gpu/drm/i915/intel_uncore.c > > > > > > index 2a72bab..f1abd2d 100644 > > > > > > --- a/drivers/gpu/drm/i915/intel_uncore.c > > > > > > +++ b/drivers/gpu/drm/i915/intel_uncore.c > > > > > > @@ -363,6 +363,9 @@ static void intel_uncore_forcewake_reset(st= ruct > > drm_device *dev, bool restore) > > > > > > spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); > > > > > > } > > > > > > > > > > > > +void vlv_set_power_well(struct drm_i915_private *dev_priv, > > > > > > + struct i915_power_well *power_well, bool > > enable); > > > > > > + > > > > > > void intel_uncore_early_sanitize(struct drm_device *dev) > > > > > > { > > > > > > struct drm_i915_private *dev_priv =3D dev->dev_private; > > > > > > @@ -381,6 +384,22 @@ void intel_uncore_early_sanitize(struct > > drm_device *dev) > > > > > > DRM_INFO("Found %zuMB of eLLC\n", dev_priv- > > >ellc_size); > > > > > > } > > > > > > > > > > > > + /* > > > > > > + * From > > VLV2A0_DP_eDP_HDMI_DPIO_driver_vbios_notes_11.docx: > > > > > > + * Need to assert and de-assert PHY SB reset by gating the > > common > > > > > > + * lane power, then un-gating it. > > > > > > + * Simply ungating isn't enough to reset the PHY enough to ge= t > > > > > > + * ports and lanes running. > > > > > > + */ > > > > > > + if (IS_VALLEYVIEW(dev)) { > > > > > > + struct i915_power_well cmn_well =3D { > > > > > > + .data =3D PUNIT_POWER_WELL_DPIO_CMN_BC > > > > > > + }; > > > > > > + > > > > > > + vlv_set_power_well(dev_priv, &cmn_well, false); > > > > > > + vlv_set_power_well(dev_priv, &cmn_well, true); > > > > > > + } > > > > > > > > > > Stick this into intel_reset_dpio() instead? > > > > > > > > > > And what about fastboot and whatnot? Should we check if the displ= ay is > > > > > already up and running somehow before we go and kill it with this= ? > > > > > > > > reset_dpio is too late. > > > > > > How come? We shouldn't touch the PHY before it. So either reset_dpio = is > > > in the wrong place for some reason, or something else gets called too > > > soon. > >=20 > > Oh actually I haven't tested with just the common reset, it may be ok > > to put that into the DPIO init function. My earlier patch was toggling > > all the wells, including display, which would obviously clobber things. > >=20 >=20 > Following is my understanding after talking to PHY & windows teams.. >=20 > The exact sequence to follow during power gating (as part of the suspend = sequence): > - Power gate display controller & poll for the operation to complete > - Power gate DPIO RX / TX lanes & poll for the operation to complete > - Power gate DPIO common lanes & poll for the operation to complete >=20 > The power ungating sequence=20 > - Power ungate DPIO TX lanes & poll for the operation to complete > - Power ungate DPIO common lanes & poll for the operation to complete > - Power ungate display controller & poll for the operation to complete Does this mean that we need the DPIO common and TX lanes up for all display configurations? It doesn't seem logical. At the moment VGA works without the TX lanes being down and I think MIPI should work with both common and TX lanes down, (but I haven't tested MIPI). --Imre --=-SQhPWE+J/3JWzHvPAHU4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAABAgAGBQJTTS5XAAoJEORIIAnNuWDFNbgH/An1ff21ptfLJcIvZ5Uqh6kA D6FLCuCpQy2uZadlwgOqobeLFp5FWz504CBoORrXH/54OhcZR4sfwfclHQinX8ee FZbcQ1wFYXMF1qCFUnvyZIAMicUgvS+Hw8+5sRulr9i0bggNTXInKFoSAjHSmRxH n1Tmh3bCP5BsmsPH8hv0YO8w5Np1ffcxn90y1lTabECSnKZnweKle1ouLxwZEHiD MlxRYWhlyf1RzV9iy0z27ugFgYeeyUbKk9OokZ+zp10V2Vw7R0E4lOvws55QkWok Kh1KEDOrFlfNNRoSas+s03x7v5d+Med2rDoMPR4/jwqbuTAVJMkiPXCfKKrR7OM= =xsZd -----END PGP SIGNATURE----- --=-SQhPWE+J/3JWzHvPAHU4-- --===============0170733425== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0170733425==--