usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover
authorBadhri Jagan Sridharan <badhri@google.com>
Thu, 3 Dec 2020 03:19:08 +0000 (19:19 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 13:45:53 +0000 (14:45 +0100)
commit3bac42f02d41dd85da7afb9ffc3f4539fad20cc5
tree16f2650eb438ed81063df7933fb9d2395c71efa7
parente4a9378083c57a22624cda8b780ff5f5da4de7ef
usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover

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.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20201203031908.1491542-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c