diff mbox series

drm/i915/display: Wait for PHY readiness not needed for disabling sequence

Message ID 20231212095520.452363-1-mika.kahola@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/display: Wait for PHY readiness not needed for disabling sequence | expand

Commit Message

Mika Kahola Dec. 12, 2023, 9:55 a.m. UTC
When going through the disconnection flow we don't need to wait for PHY
readiness and hence we can skip the wait part. For disabling the function
returns false as an indicator that the power is not enabled. After all,
we are not even using the return value when Type-C is disconnecting.

BSpec: 65380

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 drivers/gpu/drm/i915/display/intel_tc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Imre Deak Dec. 12, 2023, 10:08 a.m. UTC | #1
On Tue, Dec 12, 2023 at 11:55:20AM +0200, Mika Kahola wrote:
> When going through the disconnection flow we don't need to wait for PHY
> readiness and hence we can skip the wait part. For disabling the function
> returns false as an indicator that the power is not enabled. After all,
> we are not even using the return value when Type-C is disconnecting.
> 
> BSpec: 65380
> 
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_tc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
> index f64d348a969e..79ec17fa3edd 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.c
> +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> @@ -1030,6 +1030,9 @@ static bool xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool enabl
>  
>  	__xelpdp_tc_phy_enable_tcss_power(tc, enable);
>  
> +	if (!enable)
> +		return false;

Waiting for xelpdp_tc_phy_wait_for_tcss_power(tc, false); is also needed
in the above case.

> +
>  	if ((!tc_phy_wait_for_ready(tc) ||
>  	     !xelpdp_tc_phy_wait_for_tcss_power(tc, enable)) &&
>  	    !drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_LEGACY)) {
> -- 
> 2.34.1
>
Mika Kahola Dec. 12, 2023, 10:20 a.m. UTC | #2
> -----Original Message-----
> From: Deak, Imre <imre.deak@intel.com>
> Sent: Tuesday, December 12, 2023 12:08 PM
> To: Kahola, Mika <mika.kahola@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/i915/display: Wait for PHY readiness not needed for disabling sequence
> 
> On Tue, Dec 12, 2023 at 11:55:20AM +0200, Mika Kahola wrote:
> > When going through the disconnection flow we don't need to wait for
> > PHY readiness and hence we can skip the wait part. For disabling the
> > function returns false as an indicator that the power is not enabled.
> > After all, we are not even using the return value when Type-C is disconnecting.
> >
> > BSpec: 65380
> >
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_tc.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
> > b/drivers/gpu/drm/i915/display/intel_tc.c
> > index f64d348a969e..79ec17fa3edd 100644
> > --- a/drivers/gpu/drm/i915/display/intel_tc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> > @@ -1030,6 +1030,9 @@ static bool
> > xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool enabl
> >
> >  	__xelpdp_tc_phy_enable_tcss_power(tc, enable);
> >
> > +	if (!enable)
> > +		return false;
> 
> Waiting for xelpdp_tc_phy_wait_for_tcss_power(tc, false); is also needed in the above case.

Ok. I would still keep this disabling part separate as if I combine this with existing if() the code looks a bit busy for me. 

Thanks!
Mika

> 
> > +
> >  	if ((!tc_phy_wait_for_ready(tc) ||
> >  	     !xelpdp_tc_phy_wait_for_tcss_power(tc, enable)) &&
> >  	    !drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_LEGACY)) {
> > --
> > 2.34.1
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
index f64d348a969e..79ec17fa3edd 100644
--- a/drivers/gpu/drm/i915/display/intel_tc.c
+++ b/drivers/gpu/drm/i915/display/intel_tc.c
@@ -1030,6 +1030,9 @@  static bool xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool enabl
 
 	__xelpdp_tc_phy_enable_tcss_power(tc, enable);
 
+	if (!enable)
+		return false;
+
 	if ((!tc_phy_wait_for_ready(tc) ||
 	     !xelpdp_tc_phy_wait_for_tcss_power(tc, enable)) &&
 	    !drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_LEGACY)) {