diff mbox series

[3/7] drm/msm/dp: reset aux controller after dp_aux_cmd_fifo_tx() failed.

Message ID 1625592020-22658-4-git-send-email-khsieh@codeaurora.org
State Superseded
Headers show
Series add fixes to pass DP Link Layer compliance test cases | expand

Commit Message

Kuogee Hsieh July 6, 2021, 5:20 p.m. UTC
Aux hardware calibration sequence requires resetting the aux controller
in order for the new setting to take effect. However resetting the AUX
controller will also clear HPD interrupt status which may accidentally
cause pending unplug interrupt to get lost. Therefore reset aux
controller only when link is in connection state when dp_aux_cmd_fifo_tx()
fail. This fixes Link Layer CTS cases 4.2.1.1 and 4.2.1.2.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
---
 drivers/gpu/drm/msm/dp/dp_aux.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stephen Boyd July 8, 2021, 7:34 a.m. UTC | #1
Quoting Kuogee Hsieh (2021-07-06 10:20:16)
> Aux hardware calibration sequence requires resetting the aux controller
> in order for the new setting to take effect. However resetting the AUX
> controller will also clear HPD interrupt status which may accidentally
> cause pending unplug interrupt to get lost. Therefore reset aux
> controller only when link is in connection state when dp_aux_cmd_fifo_tx()
> fail. This fixes Link Layer CTS cases 4.2.1.1 and 4.2.1.2.
>
> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/dp/dp_aux.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c
> index 4a3293b..eb40d84 100644
> --- a/drivers/gpu/drm/msm/dp/dp_aux.c
> +++ b/drivers/gpu/drm/msm/dp/dp_aux.c
> @@ -353,6 +353,9 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux,
>                         if (!(aux->retry_cnt % MAX_AUX_RETRIES))
>                                 dp_catalog_aux_update_cfg(aux->catalog);
>                 }
> +               /* reset aux if link is in connected state */
> +               if (dp_catalog_link_is_connected(aux->catalog))

How do we avoid resetting aux when hpd is unplugged and then plugged
back in during an aux transfer?

> +                       dp_catalog_aux_reset(aux->catalog);
>         } else {
>                 aux->retry_cnt = 0;
>                 switch (aux->aux_error_num) {
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
Kuogee Hsieh July 8, 2021, 9:59 p.m. UTC | #2
On 2021-07-08 00:34, Stephen Boyd wrote:
> Quoting Kuogee Hsieh (2021-07-06 10:20:16)

>> Aux hardware calibration sequence requires resetting the aux 

>> controller

>> in order for the new setting to take effect. However resetting the AUX

>> controller will also clear HPD interrupt status which may accidentally

>> cause pending unplug interrupt to get lost. Therefore reset aux

>> controller only when link is in connection state when 

>> dp_aux_cmd_fifo_tx()

>> fail. This fixes Link Layer CTS cases 4.2.1.1 and 4.2.1.2.

>> 

>> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

>> ---

>>  drivers/gpu/drm/msm/dp/dp_aux.c | 3 +++

>>  1 file changed, 3 insertions(+)

>> 

>> diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c 

>> b/drivers/gpu/drm/msm/dp/dp_aux.c

>> index 4a3293b..eb40d84 100644

>> --- a/drivers/gpu/drm/msm/dp/dp_aux.c

>> +++ b/drivers/gpu/drm/msm/dp/dp_aux.c

>> @@ -353,6 +353,9 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux 

>> *dp_aux,

>>                         if (!(aux->retry_cnt % MAX_AUX_RETRIES))

>>                                 

>> dp_catalog_aux_update_cfg(aux->catalog);

>>                 }

>> +               /* reset aux if link is in connected state */

>> +               if (dp_catalog_link_is_connected(aux->catalog))

> 

> How do we avoid resetting aux when hpd is unplugged and then plugged

> back in during an aux transfer?

i am not sure this is possible.
it should get unplug interrupt followed by plugin interrupt.
In this case, aux will be re set and initialized
> 

>> +                       dp_catalog_aux_reset(aux->catalog);

>>         } else {

>>                 aux->retry_cnt = 0;

>>                 switch (aux->aux_error_num) {

>> --

>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 

>> Forum,

>> a Linux Foundation Collaborative Project

>>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c
index 4a3293b..eb40d84 100644
--- a/drivers/gpu/drm/msm/dp/dp_aux.c
+++ b/drivers/gpu/drm/msm/dp/dp_aux.c
@@ -353,6 +353,9 @@  static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux,
 			if (!(aux->retry_cnt % MAX_AUX_RETRIES))
 				dp_catalog_aux_update_cfg(aux->catalog);
 		}
+		/* reset aux if link is in connected state */
+		if (dp_catalog_link_is_connected(aux->catalog))
+			dp_catalog_aux_reset(aux->catalog);
 	} else {
 		aux->retry_cnt = 0;
 		switch (aux->aux_error_num) {