* [PATCH v1] usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover
@ 2020-12-03 3:19 Badhri Jagan Sridharan
2020-12-07 15:56 ` Guenter Roeck
2020-12-08 9:41 ` Heikki Krogerus
0 siblings, 2 replies; 3+ messages in thread
From: Badhri Jagan Sridharan @ 2020-12-03 3:19 UTC (permalink / raw)
To: Guenter Roeck, Heikki Krogerus, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Badhri Jagan Sridharan
tcpm_check_send_discover does not clear the send_discover flag
when any of the following conditions are not met.
1. data_role is TYPEC_HOST
2. link is pd_capable
Discovery indentity would anyways not be attempted during
the current session anymore when the above conditions are not
met. Hence clear the send_discover flag here to prevent
tcpm_enable_frs_work from rescheduling indefinetly.
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
---
drivers/usb/typec/tcpm/tcpm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 3bbc1f10af49..012135ade7b1 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -3035,10 +3035,9 @@ static inline enum tcpm_state unattached_state(struct tcpm_port *port)
static void tcpm_check_send_discover(struct tcpm_port *port)
{
if (port->data_role == TYPEC_HOST && port->send_discover &&
- port->pd_capable) {
+ port->pd_capable)
tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0);
- port->send_discover = false;
- }
+ port->send_discover = false;
}
static void tcpm_swap_complete(struct tcpm_port *port, int result)
--
2.29.2.576.ga3fc446d84-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover
2020-12-03 3:19 [PATCH v1] usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover Badhri Jagan Sridharan
@ 2020-12-07 15:56 ` Guenter Roeck
2020-12-08 9:41 ` Heikki Krogerus
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2020-12-07 15:56 UTC (permalink / raw)
To: Badhri Jagan Sridharan
Cc: Heikki Krogerus, Greg Kroah-Hartman, linux-usb, linux-kernel
On Wed, Dec 02, 2020 at 07:19:08PM -0800, Badhri Jagan Sridharan wrote:
> tcpm_check_send_discover does not clear the send_discover flag
> when any of the following conditions are not met.
> 1. data_role is TYPEC_HOST
> 2. link is pd_capable
>
> Discovery indentity would anyways not be attempted during
> the current session anymore when the above conditions are not
> met. Hence clear the send_discover flag here to prevent
> tcpm_enable_frs_work from rescheduling indefinetly.
>
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/usb/typec/tcpm/tcpm.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 3bbc1f10af49..012135ade7b1 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -3035,10 +3035,9 @@ static inline enum tcpm_state unattached_state(struct tcpm_port *port)
> static void tcpm_check_send_discover(struct tcpm_port *port)
> {
> if (port->data_role == TYPEC_HOST && port->send_discover &&
> - port->pd_capable) {
> + port->pd_capable)
> tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0);
> - port->send_discover = false;
> - }
> + port->send_discover = false;
> }
>
> static void tcpm_swap_complete(struct tcpm_port *port, int result)
> --
> 2.29.2.576.ga3fc446d84-goog
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover
2020-12-03 3:19 [PATCH v1] usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover Badhri Jagan Sridharan
2020-12-07 15:56 ` Guenter Roeck
@ 2020-12-08 9:41 ` Heikki Krogerus
1 sibling, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2020-12-08 9:41 UTC (permalink / raw)
To: Badhri Jagan Sridharan
Cc: Guenter Roeck, Greg Kroah-Hartman, linux-usb, linux-kernel
On Wed, Dec 02, 2020 at 07:19:08PM -0800, Badhri Jagan Sridharan wrote:
> tcpm_check_send_discover does not clear the send_discover flag
> when any of the following conditions are not met.
> 1. data_role is TYPEC_HOST
> 2. link is pd_capable
>
> Discovery indentity would anyways not be attempted during
> the current session anymore when the above conditions are not
> met. Hence clear the send_discover flag here to prevent
> tcpm_enable_frs_work from rescheduling indefinetly.
>
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/tcpm/tcpm.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 3bbc1f10af49..012135ade7b1 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -3035,10 +3035,9 @@ static inline enum tcpm_state unattached_state(struct tcpm_port *port)
> static void tcpm_check_send_discover(struct tcpm_port *port)
> {
> if (port->data_role == TYPEC_HOST && port->send_discover &&
> - port->pd_capable) {
> + port->pd_capable)
> tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0);
> - port->send_discover = false;
> - }
> + port->send_discover = false;
> }
>
> static void tcpm_swap_complete(struct tcpm_port *port, int result)
> --
> 2.29.2.576.ga3fc446d84-goog
--
heikki
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-08 9:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 3:19 [PATCH v1] usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover Badhri Jagan Sridharan
2020-12-07 15:56 ` Guenter Roeck
2020-12-08 9:41 ` Heikki Krogerus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).