All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tcpm: Do not finish VDM AMS for retrying Responses
@ 2021-06-06  8:14 Kyle Tso
  2021-06-06 12:30 ` Guenter Roeck
  2021-06-07  9:20 ` Heikki Krogerus
  0 siblings, 2 replies; 3+ messages in thread
From: Kyle Tso @ 2021-06-06  8:14 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh; +Cc: badhri, linux-usb, linux-kernel, Kyle Tso

If the VDM responses couldn't be sent successfully, it doesn't need to
finish the AMS until the retry count reaches the limit.

Fixes: 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance")
Signed-off-by: Kyle Tso <kyletso@google.com>
---
 drivers/usb/typec/tcpm/tcpm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 0db685d5d9c0..08fabe1fc31d 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -1965,6 +1965,9 @@ static void vdm_run_state_machine(struct tcpm_port *port)
 			tcpm_log(port, "VDM Tx error, retry");
 			port->vdm_retries++;
 			port->vdm_state = VDM_STATE_READY;
+			if (PD_VDO_SVDM(vdo_hdr) && PD_VDO_CMDT(vdo_hdr) == CMDT_INIT)
+				tcpm_ams_finish(port);
+		} else {
 			tcpm_ams_finish(port);
 		}
 		break;
-- 
2.32.0.rc1.229.g3e70b5a671-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: typec: tcpm: Do not finish VDM AMS for retrying Responses
  2021-06-06  8:14 [PATCH] usb: typec: tcpm: Do not finish VDM AMS for retrying Responses Kyle Tso
@ 2021-06-06 12:30 ` Guenter Roeck
  2021-06-07  9:20 ` Heikki Krogerus
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2021-06-06 12:30 UTC (permalink / raw)
  To: Kyle Tso; +Cc: heikki.krogerus, gregkh, badhri, linux-usb, linux-kernel

On Sun, Jun 06, 2021 at 04:14:52PM +0800, Kyle Tso wrote:
> If the VDM responses couldn't be sent successfully, it doesn't need to
> finish the AMS until the retry count reaches the limit.
> 
> Fixes: 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance")
> Signed-off-by: Kyle Tso <kyletso@google.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 0db685d5d9c0..08fabe1fc31d 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -1965,6 +1965,9 @@ static void vdm_run_state_machine(struct tcpm_port *port)
>  			tcpm_log(port, "VDM Tx error, retry");
>  			port->vdm_retries++;
>  			port->vdm_state = VDM_STATE_READY;
> +			if (PD_VDO_SVDM(vdo_hdr) && PD_VDO_CMDT(vdo_hdr) == CMDT_INIT)
> +				tcpm_ams_finish(port);
> +		} else {
>  			tcpm_ams_finish(port);
>  		}
>  		break;
> -- 
> 2.32.0.rc1.229.g3e70b5a671-goog
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: typec: tcpm: Do not finish VDM AMS for retrying Responses
  2021-06-06  8:14 [PATCH] usb: typec: tcpm: Do not finish VDM AMS for retrying Responses Kyle Tso
  2021-06-06 12:30 ` Guenter Roeck
@ 2021-06-07  9:20 ` Heikki Krogerus
  1 sibling, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2021-06-07  9:20 UTC (permalink / raw)
  To: Kyle Tso; +Cc: linux, gregkh, badhri, linux-usb, linux-kernel

On Sun, Jun 06, 2021 at 04:14:52PM +0800, Kyle Tso wrote:
> If the VDM responses couldn't be sent successfully, it doesn't need to
> finish the AMS until the retry count reaches the limit.
> 
> Fixes: 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance")
> Signed-off-by: Kyle Tso <kyletso@google.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 0db685d5d9c0..08fabe1fc31d 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -1965,6 +1965,9 @@ static void vdm_run_state_machine(struct tcpm_port *port)
>  			tcpm_log(port, "VDM Tx error, retry");
>  			port->vdm_retries++;
>  			port->vdm_state = VDM_STATE_READY;
> +			if (PD_VDO_SVDM(vdo_hdr) && PD_VDO_CMDT(vdo_hdr) == CMDT_INIT)
> +				tcpm_ams_finish(port);
> +		} else {
>  			tcpm_ams_finish(port);
>  		}
>  		break;
> -- 
> 2.32.0.rc1.229.g3e70b5a671-goog

-- 
heikki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-07  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06  8:14 [PATCH] usb: typec: tcpm: Do not finish VDM AMS for retrying Responses Kyle Tso
2021-06-06 12:30 ` Guenter Roeck
2021-06-07  9:20 ` Heikki Krogerus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.