Skip to contentSkip to conversation

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

PATCH Superseded Mika Kahola 2 participants 3 messages Dec 12, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

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

---
 drivers/gpu/drm/i915/display/intel_tc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_tc.c +3 -0
index f64d348a969e..79ec17fa3edd 100644
@@ -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)) {
Signature · 1 line
2.34.1
#1 lore raw
Quoted 17 lines · Mika Kahola

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

---
 drivers/gpu/drm/i915/display/intel_tc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_tc.c +0 -0
index f64d348a969e..79ec17fa3edd 100644

drivers/gpu/drm/i915/display/intel_tc.c static bool xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool enabl · line 1034

Quoted 5 lines
drivers/gpu/drm/i915/display/intel_tc.c +2 -0
@@ -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.

Quoted 7 lines
drivers/gpu/drm/i915/display/intel_tc.c +1 -0
+
 	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)) {
Signature · 1 line
2.34.1
#2 lore raw
Quoted 28 lines

-----Original Message-----
From: Deak, Imre <[email protected]>
Sent: Tuesday, December 12, 2023 12:08 PM
To: Kahola, Mika <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/i915/display: Wait for PHY readiness not needed for disabling sequence

Quoted 20 lines · Mika Kahola

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

---
 drivers/gpu/drm/i915/display/intel_tc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_tc.c +0 -0
index f64d348a969e..79ec17fa3edd 100644
@@ -1030,6 +1030,9 @@ static bool

xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool enabl

Quoted 6 lines

drivers/gpu/drm/i915/display/intel_tc.c static bool xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool enabl · line 1034

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_tc.c +2 -0
 	__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

Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_tc.c +1 -1
+
 	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