From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Kandpal, Suraj" <suraj.kandpal@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915/display: Increase AUX timeout for Type-C
Date: Mon, 17 Apr 2023 14:15:02 +0300 [thread overview]
Message-ID: <878reqep55.fsf@intel.com> (raw)
In-Reply-To: <SN7PR11MB6750CD1B0E64D77BE7E76A0BE39C9@SN7PR11MB6750.namprd11.prod.outlook.com>
On Mon, 17 Apr 2023, "Kandpal, Suraj" <suraj.kandpal@intel.com> wrote:
> drm/i915/display: Increase AUX timeout
>> for Type-C
>>
>> On Mon, 17 Apr 2023, "Kandpal, Suraj" <suraj.kandpal@intel.com> wrote:
>> >> -----Original Message-----
>> >> From: Jani Nikula <jani.nikula@linux.intel.com>
>> >> Sent: Monday, April 17, 2023 4:04 PM
>> >> To: Kandpal, Suraj <suraj.kandpal@intel.com>; intel-
>> >> gfx@lists.freedesktop.org
>> >> Subject: RE: [Intel-gfx] [PATCH v2] drm/i915/display: Increase AUX
>> >> timeout for Type-C
>> >>
>> >> On Mon, 17 Apr 2023, "Kandpal, Suraj" <suraj.kandpal@intel.com> wrote:
>> >> >> On Wed, 05 Apr 2023, Suraj Kandpal <suraj.kandpal@intel.com>
>> wrote:
>> >> >> > Type-C PHYs are taking longer than expected for Aux IO Power
>> Enabling.
>> >> >> > Workaround: Increase the timeout.
>> >> >> >
>> >> >> > WA_14017248603: adlp
>> >> >> > Bspec: 55480
>> >> >> >
>> >> >> > ---v2
>> >> >> > -change style on how we mention WA [Ankit] -fix bat error
>> >> >> >
>> >> >> > Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
>> >> >> > ---
>> >> >> > .../i915/display/intel_display_power_well.c | 30
>> ++++++++++++++++++-
>> >> >> > 1 file changed, 29 insertions(+), 1 deletion(-)
>> >> >> >
>> >> >> > diff --git
>> >> >> > a/drivers/gpu/drm/i915/display/intel_display_power_well.c
>> >> >> > b/drivers/gpu/drm/i915/display/intel_display_power_well.c
>> >> >> > index 62bafcbc7937..52f595929a18 100644
>> >> >> > --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
>> >> >> > +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
>> >> >> > @@ -489,6 +489,34 @@ static void icl_tc_cold_exit(struct
>> >> >> drm_i915_private *i915)
>> >> >> > "succeeded");
>> >> >> > }
>> >> >> >
>> >> >> > +static void
>> >> >> > +adl_aux_wait_for_power_well_enable(struct drm_i915_private
>> *i915,
>> >> >> > + struct i915_power_well
>> *power_well,
>> >> >> > + bool timeout_expected)
>> >> >> > +{
>> >> >> > + const struct i915_power_well_regs *regs =
>> >> >> > +power_well->desc->ops-
>> >> >> >regs;
>> >> >> > + enum phy phy = icl_aux_pw_to_phy(i915, power_well);
>> >> >> > + int pw_idx = i915_power_well_instance(power_well)-
>> >hsw.idx;
>> >> >> > +
>> >> >> > + /*
>> >> >> > + * WA_14017248603: adlp
>> >> >> > + * Type-C Phy are taking longer than expected for AUX IO
>> Power
>> >> >> Enabling.
>> >> >> > + * Increase timeout to 500ms.
>> >> >> > + */
>> >> >> > + if (IS_ALDERLAKE_P(i915) && intel_phy_is_tc(i915, phy)) {
>> >> >> > + if (intel_de_wait_for_set(i915, regs->driver,
>> >> >> > +
>> >> >> HSW_PWR_WELL_CTL_STATE(pw_idx), 500)) {
>> >> >> > + drm_dbg_kms(&i915->drm, "%s power well
>> enable
>> >> >> timeout\n",
>> >> >> > +
>> intel_power_well_name(power_well));
>> >> >> > +
>> >> >> > + drm_WARN_ON(&i915->drm,
>> !timeout_expected);
>> >> >> > + }
>> >> >> > + return;
>> >> >> > + }
>> >> >> > +
>> >> >> > + hsw_wait_for_power_well_enable(i915, power_well,
>> >> >> timeout_expected);
>> >> >> > +}
>> >> >>
>> >> >> Please don't duplicate the function and the wait like this.
>> >> >>
>> >> >> Something like this is sufficient:
>> >> >>
>> >> >>
>> >> >> @@ -252,7 +252,9 @@ static void
>> >> hsw_wait_for_power_well_enable(struct
>> >> >> drm_i915_private *dev_priv,
>> >> >> bool timeout_expected)
>> >> >> {
>> >> >> const struct i915_power_well_regs *regs = power_well->desc->ops-
>> >> >> >regs;
>> >> >> + enum phy phy = icl_aux_pw_to_phy(i915, power_well);
>> >> >> int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
>> >> >> + int timeout = 1;
>> >> >>
>> >> >> /*
>> >> >> * For some power wells we're not supposed to watch the status
>> >> >> bit for @@ -264,9 +266,13 @@ static void
>> >> >> hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
>> >> >> return;
>> >> >> }
>> >> >>
>> >> >> + /* WA_14017248603: adlp */
>> >> >> + if (IS_ALDERLAKE_P(i915) && intel_phy_is_tc(i915, phy))
>> >> >
>> >> > I did try this but it ends up throwing a kernel null pointer error
>> >> > at intel_phy_is_tc which made me float the version of code I did.
>> >>
>> >> Please explain what causes it, and how your version avoids it.
>> >>
>> >
>> > icl_aux_pw_to_phy is called is hsw_wait_for_power_well is called
>> > everywhere where its not possible for aux_pw to phy conversion is not
>> possible with this change we only get the phy for adls version.
>> > Will address this is next version.
>>
>> Cc: Imre for input
>>
>> Maybe pass the timeout to hsw_wait_for_power_well_enable() as
>> parameter?
>> Other ideas?
>
> I did think of that but the idea of disturbing other functions stopped me.
> If that doesn't seem like an issue I could do that.
Please let Imre chime in first.
But in general we don't shy away from changes touching other places if
it makes sense, and keeps the code clean.
BR,
Jani.
>
> Regards,
> Suraj Kandpal
>>
>> BR,
>> Jani.
>>
>> >
>> > Regards,
>> > Suraj Kandpal
>> >> BR,
>> >> Jani.
>> >>
>> >>
>> >> >
>> >> > Regards,
>> >> > Suraj Kandpal
>> >> >> + timeout = 500;
>> >> >> +
>> >> >> /* Timeout for PW1:10 us, AUX:not specified, other PWs:20 us. */
>> >> >> if (intel_de_wait_for_set(dev_priv, regs->driver,
>> >> >> - HSW_PWR_WELL_CTL_STATE(pw_idx), 1)) {
>> >> >> + HSW_PWR_WELL_CTL_STATE(pw_idx),
>> >> >> timeout)) {
>> >> >> drm_dbg_kms(&dev_priv->drm, "%s power well enable
>> >> timeout\n",
>> >> >> intel_power_well_name(power_well));
>> >> >>
>> >> >>
>> >> >> > +
>> >> >
>> >> >> > static void
>> >> >> > icl_tc_phy_aux_power_well_enable(struct drm_i915_private
>> *dev_priv,
>> >> >> > struct i915_power_well
>> *power_well) @@ -
>> >> >> 517,7 +545,7 @@
>> >> >> > icl_tc_phy_aux_power_well_enable(struct drm_i915_private
>> *dev_priv,
>> >> >> > if (DISPLAY_VER(dev_priv) == 11 &&
>> >> >> intel_tc_cold_requires_aux_pw(dig_port))
>> >> >> > icl_tc_cold_exit(dev_priv);
>> >> >> >
>> >> >> > - hsw_wait_for_power_well_enable(dev_priv, power_well,
>> >> >> timeout_expected);
>> >> >> > + adl_aux_wait_for_power_well_enable(dev_priv, power_well,
>> >> >> > +timeout_expected);
>> >> >>
>> >> >> A function prefixed adl_ should indicate it's only needed for adl+.
>> >> >> This change is misleading.
>> >> >>
>> >> >> BR,
>> >> >> Jani.
>> >> >>
>> >> >>
>> >> >> >
>> >> >> > if (DISPLAY_VER(dev_priv) >= 12 && !is_tbt) {
>> >> >> > enum tc_port tc_port;
>> >> >>
>> >> >> --
>> >> >> Jani Nikula, Intel Open Source Graphics Center
>> >>
>> >> --
>> >> Jani Nikula, Intel Open Source Graphics Center
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-04-17 11:15 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 8:01 [Intel-gfx] [PATCH] drm/i915/display: Increase AUX timeout for Type-C Suraj Kandpal
2023-04-03 10:11 ` Nautiyal, Ankit K
2023-04-03 14:58 ` Murthy, Arun R
2023-04-04 5:40 ` Kandpal, Suraj
2023-04-03 15:01 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2023-04-05 7:19 ` [Intel-gfx] [PATCH v2] " Suraj Kandpal
2023-04-17 4:30 ` Murthy, Arun R
2023-04-17 6:51 ` Kandpal, Suraj
2023-04-17 7:33 ` Murthy, Arun R
2023-04-17 8:52 ` Jani Nikula
2023-04-17 10:18 ` Kandpal, Suraj
2023-04-17 10:33 ` Jani Nikula
2023-04-17 10:51 ` Kandpal, Suraj
2023-04-17 10:56 ` Jani Nikula
2023-04-17 11:00 ` Kandpal, Suraj
2023-04-17 11:15 ` Jani Nikula [this message]
2023-04-17 11:27 ` Imre Deak
2023-04-17 11:39 ` Kandpal, Suraj
2023-04-17 11:43 ` Kandpal, Suraj
2023-04-17 11:53 ` Imre Deak
2023-04-17 12:25 ` Kandpal, Suraj
2023-04-17 12:29 ` Imre Deak
2023-04-18 5:02 ` Kandpal, Suraj
2023-04-18 6:44 ` Jani Nikula
2023-04-05 19:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/display: Increase AUX timeout for Type-C (rev2) Patchwork
2023-04-06 10:48 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-04-17 15:24 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: Increase AUX timeout for Type-C (rev3) Patchwork
2023-04-17 15:37 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-04-17 23:30 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-04-18 9:23 ` [Intel-gfx] [PATCH v3] drm/i915/display: Increase AUX timeout for Type-C Suraj Kandpal
2023-04-18 10:00 ` Jani Nikula
2023-04-18 10:10 ` Imre Deak
2023-04-18 10:52 ` [Intel-gfx] [PATCH v4] " Suraj Kandpal
2023-04-18 10:54 ` Suraj Kandpal
2023-04-18 11:03 ` Imre Deak
2023-04-18 11:45 ` Kandpal, Suraj
2023-04-18 12:41 ` Imre Deak
2023-04-18 11:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: Increase AUX timeout for Type-C (rev6) Patchwork
2023-04-18 11:56 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-04-18 13:05 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/display: Increase AUX timeout for Type-C (rev7) Patchwork
2023-04-18 13:14 ` [Intel-gfx] [PATCH v5] drm/i915/display: Increase AUX timeout for Type-C Suraj Kandpal
2023-04-19 12:28 ` Imre Deak
2023-04-18 14:00 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: Increase AUX timeout for Type-C (rev8) Patchwork
2023-04-18 14:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-04-18 17:06 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=878reqep55.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=suraj.kandpal@intel.com \
/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