lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8336de0f-cad1-3f1c-c009-d7c592910ab3@roeck-us.net>
Date:   Mon, 1 Feb 2021 06:38:14 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Badhri Jagan Sridharan <badhri@...gle.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kyle Tso <kyletso@...gle.com>
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] usb: typec: tcpm: Handle vbus shutoff when in source
 mode

On 2/1/21 2:02 AM, Badhri Jagan Sridharan wrote:
> While in source mode, vbus could be shutoff by protections
> circuits. TCPM does not move back to toggling state to
> re-initiate connection. Fix this by moving to SRC_UNATTACHED
> state when vbus shuts off while in source mode.
> 
> Signed-off-by: Badhri Jagan Sridharan <badhri@...gle.com>

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

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 0afd8ef692e8..ff0732c12b8a 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -4897,6 +4897,17 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port)
>  		/* Do nothing, waiting for sink detection */
>  		break;
>  
> +	case SRC_STARTUP:
> +	case SRC_SEND_CAPABILITIES:
> +	case SRC_SEND_CAPABILITIES_TIMEOUT:
> +	case SRC_NEGOTIATE_CAPABILITIES:
> +	case SRC_TRANSITION_SUPPLY:
> +	case SRC_READY:
> +	case SRC_WAIT_NEW_CAPABILITIES:
> +		/* Force to unattached state to re-initiate connection */
> +		tcpm_set_state(port, SRC_UNATTACHED, 0);
> +		break;
> +
>  	case PORT_RESET:
>  		/*
>  		 * State set back to default mode once the timer completes.
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ