From: Imre Deak <imre.deak@intel.com>
To: "Kahola, Mika" <mika.kahola@intel.com>
Cc: Chris Chiu <chris.chiu@canonical.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 01/14] drm/i915/tc: Abort DP AUX transfer on a disconnected TC port
Date: Tue, 21 Mar 2023 15:45:01 +0200 [thread overview]
Message-ID: <ZBm03dBdOOp26mJW@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <MW4PR11MB70547A0C5A6E323F4DC67826EF819@MW4PR11MB7054.namprd11.prod.outlook.com>
On Tue, Mar 21, 2023 at 01:09:41PM +0200, Kahola, Mika wrote:
> > -----Original Message-----
> > From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Imre
> > Deak
> > Sent: Thursday, March 16, 2023 3:17 PM
> > To: intel-gfx@lists.freedesktop.org
> > Cc: Chris Chiu <chris.chiu@canonical.com>
> > Subject: [Intel-gfx] [PATCH 01/14] drm/i915/tc: Abort DP AUX transfer on a
> > disconnected TC port
> >
> > On TC ports the 4ms AUX timeout combined with the 5 * 32 retry attempts
> > during DPCD accesses adds a 640ms delay to each access if the sink is
> > disconnected. This in turn slows down a modeset during which the sink is
> > disconnected (for instance a disabling modeset).
> >
> > Prevent the above delay by aborting AUX transfers on a TC port with a
> > disconnected sink.
> >
> > The DP 1.4a link CTS (4.2.1.5 Source Device Inactive HPD / Inactive AUX
> > Test") also requires not to initiate AUX transfers on disconnected DP ports in
> > general, however this patch doesn't change the behavior on non-TC ports,
> > leaving that for a follow-up.
> >
> > Reported-and-tested-by: Chris Chiu <chris.chiu@canonical.com>
> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8279
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_dp_aux.c | 15 +++++++++++++--
> > drivers/gpu/drm/i915/display/intel_tc.c | 15 +++++++++++----
> > drivers/gpu/drm/i915/display/intel_tc.h | 1 +
> > 3 files changed, 25 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > index 96967e21c94c2..eb07dc5d87099 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> > @@ -205,8 +205,19 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
> > for (i = 0; i < ARRAY_SIZE(ch_data); i++)
> > ch_data[i] = intel_dp->aux_ch_data_reg(intel_dp, i);
> >
> > - if (is_tc_port)
> > + if (is_tc_port) {
> > intel_tc_port_lock(dig_port);
> > + /*
> > + * Abort transfers on a disconnected port as required by
> > + * DP 1.4a link CTS 4.2.1.5, also avoiding the long AUX
> > + * timeouts that would otherwise happen.
> > + * TODO: abort the transfer on non-TC ports as well.
> > + */
> > + if (!intel_tc_port_connected_locked(&dig_port->base)) {
> > + ret = -ENXIO;
>
> TC port being a physical object this error code could be ENODEV as well, right?
The meaning of either error code is not defined precisely, but I
interpreted ENXIO as a - temporary - error/non-presence of the remote
device downstream of the port. There is another driver returning ENXIO
for the same case.
> Anyway, patch looks ok to me.
>
> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
>
> > + goto out_unlock;
> > + }
> > + }
> >
> > aux_domain = intel_aux_power_domain(dig_port);
> >
> > @@ -367,7 +378,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
> >
> > intel_pps_unlock(intel_dp, pps_wakeref);
> > intel_display_power_put_async(i915, aux_domain, aux_wakeref);
> > -
> > +out_unlock:
> > if (is_tc_port)
> > intel_tc_port_unlock(dig_port);
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
> > b/drivers/gpu/drm/i915/display/intel_tc.c
> > index f45328712bff1..050f998284592 100644
> > --- a/drivers/gpu/drm/i915/display/intel_tc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> > @@ -768,16 +768,23 @@ void intel_tc_port_sanitize_mode(struct
> > intel_digital_port *dig_port)
> > * connected ports are usable, and avoids exposing to the users objects they
> > * can't really use.
> > */
> > +bool intel_tc_port_connected_locked(struct intel_encoder *encoder) {
> > + struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> > + struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
> > +
> > + drm_WARN_ON(&i915->drm, !intel_tc_port_ref_held(dig_port));
> > +
> > + return tc_port_live_status_mask(dig_port) & BIT(dig_port->tc_mode); }
> > +
> > bool intel_tc_port_connected(struct intel_encoder *encoder) {
> > struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> > bool is_connected;
> >
> > intel_tc_port_lock(dig_port);
> > -
> > - is_connected = tc_port_live_status_mask(dig_port) &
> > - BIT(dig_port->tc_mode);
> > -
> > + is_connected = intel_tc_port_connected_locked(encoder);
> > intel_tc_port_unlock(dig_port);
> >
> > return is_connected;
> > diff --git a/drivers/gpu/drm/i915/display/intel_tc.h
> > b/drivers/gpu/drm/i915/display/intel_tc.h
> > index d54082e2d5e8d..93813056043a5 100644
> > --- a/drivers/gpu/drm/i915/display/intel_tc.h
> > +++ b/drivers/gpu/drm/i915/display/intel_tc.h
> > @@ -17,6 +17,7 @@ bool intel_tc_port_in_dp_alt_mode(struct
> > intel_digital_port *dig_port); bool intel_tc_port_in_legacy_mode(struct
> > intel_digital_port *dig_port);
> >
> > bool intel_tc_port_connected(struct intel_encoder *encoder);
> > +bool intel_tc_port_connected_locked(struct intel_encoder *encoder);
> >
> > u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
> > u32 intel_tc_port_get_pin_assignment_mask(struct intel_digital_port
> > *dig_port);
> > --
> > 2.37.1
>
next prev parent reply other threads:[~2023-03-21 13:45 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 13:17 [Intel-gfx] [PATCH 00/14] drm/i915/tc: Fix a few TypeC / MST issues Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 01/14] drm/i915/tc: Abort DP AUX transfer on a disconnected TC port Imre Deak
2023-03-21 11:09 ` Kahola, Mika
2023-03-21 13:45 ` Imre Deak [this message]
2023-03-22 11:19 ` Andrzej Hajda
2023-03-22 12:04 ` Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 02/14] drm/i915/tc: Fix TC port link ref init for DP MST during HW readout Imre Deak
2023-03-21 12:06 ` Kahola, Mika
2023-03-21 14:00 ` Imre Deak
2023-03-24 7:03 ` Kahola, Mika
2023-03-16 13:17 ` [Intel-gfx] [PATCH 03/14] drm/i915/tc: Fix the ICL PHY ownership check in TC-cold state Imre Deak
2023-03-16 13:51 ` Souza, Jose
2023-03-16 13:17 ` [Intel-gfx] [PATCH 04/14] drm/i915/tc: Fix system resume MST mode restore for DP-alt sinks Imre Deak
2023-03-20 20:16 ` Ville Syrjälä
2023-03-20 21:36 ` Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 05/14] drm/i915/tc: Wait for IOM/FW PHY initialization of legacy TC ports Imre Deak
2023-03-24 8:14 ` Kahola, Mika
2023-03-16 13:17 ` [Intel-gfx] [PATCH 06/14] drm/i915/tc: Factor out helpers converting HPD mask to TC mode Imre Deak
2023-03-24 8:16 ` Kahola, Mika
2023-03-16 13:17 ` [Intel-gfx] [PATCH 07/14] drm/i915/tc: Fix target TC mode for a disconnected legacy port Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 08/14] drm/i915/tc: Fix TC mode for a legacy port if the PHY is not ready Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 09/14] drm/i915/tc: Fix initial TC mode on disabled legacy ports Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 10/14] drm/i915/tc: Make the TC mode readout consistent in all PHY states Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 11/14] drm/i915/tc: Assume a TC port is legacy if VBT says the port has HDMI Imre Deak
2023-03-20 20:01 ` Ville Syrjälä
2023-03-20 21:33 ` Imre Deak
2023-03-21 22:00 ` [Intel-gfx] [PATCH v2 " Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 12/14] drm/i915: Add encoder hook to get the PLL type used by TC ports Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 13/14] drm/i915/tc: Factor out a function querying active links on a TC port Imre Deak
2023-03-20 20:05 ` Ville Syrjälä
2023-03-20 21:34 ` Imre Deak
2023-03-21 22:01 ` [Intel-gfx] [PATCH v2 " Imre Deak
2023-03-16 13:17 ` [Intel-gfx] [PATCH 14/14] drm/i915/tc: Check the PLL type used by an enabled " Imre Deak
2023-03-21 22:01 ` [Intel-gfx] [PATCH v2 " Imre Deak
2023-03-16 22:27 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/tc: Fix a few TypeC / MST issues Patchwork
2023-03-17 8:54 ` Imre Deak
2023-03-20 20:19 ` [Intel-gfx] [PATCH 00/14] " Ville Syrjälä
2023-03-20 21:48 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/tc: Fix a few TypeC / MST issues (rev2) Patchwork
2023-03-20 21:48 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-20 21:48 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-03-20 21:55 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-21 2:10 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-03-21 22:16 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning for drm/i915/tc: Fix a few TypeC / MST issues (rev5) Patchwork
2023-03-21 22:16 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: " Patchwork
2023-03-21 22:16 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-21 22:37 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-03-21 23:43 ` Imre Deak
2023-03-22 9:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/tc: Fix a few TypeC / MST issues (rev6) Patchwork
2023-03-22 9:45 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-22 9:45 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-03-22 10:01 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-22 15:07 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-03-22 18:38 ` Imre Deak
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=ZBm03dBdOOp26mJW@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=chris.chiu@canonical.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kahola@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