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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201126120120.GM1008337@kuha.fi.intel.com>
Date:   Thu, 26 Nov 2020 14:01:20 +0200
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Badhri Jagan Sridharan <badhri@...gle.com>
Cc:     Guenter Roeck <linux@...ck-us.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] usb: typec: tcpm: Disregard vbus off while in
 PR_SWAP_SNK_SRC_SOURCE_ON

On Tue, Nov 24, 2020 at 06:07:03PM -0800, Badhri Jagan Sridharan wrote:
> During PR_SWAP sequence, when TCPM is waiting in PR_SWAP_SNK_SRC_SOURCE_ON
> for the vbus source to ramp up, TCPM would prematurely exit
> PR_SWAP_SNK_SRC_SOURCE_ON and transition to SNK_UNATTACHED state when a
> vbus off notification is received. This should not be the case as vbus
> can still be off while in PR_SWAP_SNK_SRC_SOURCE_ON and the vbus source
> has PD_T_NEWSRC to ramp up.
> 
> Signed-off-by: Badhri Jagan Sridharan <badhri@...gle.com>

FWIW:

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

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 4aac0efdb720..277b9d4d9c84 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -4218,6 +4218,14 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port)
>  		/* Do nothing, expected */
>  		break;
>  
> +	case PR_SWAP_SNK_SRC_SOURCE_ON:
> +		/*
> +		 * Do nothing when vbus off notification is received.
> +		 * TCPM can wait for PD_T_NEWSRC in PR_SWAP_SNK_SRC_SOURCE_ON
> +		 * for the vbus source to ramp up.
> +		 */
> +		break;
> +
>  	case PORT_RESET_WAIT_OFF:
>  		tcpm_set_state(port, tcpm_default_state(port), 0);
>  		break;
> -- 
> 2.29.2.454.gaff20da3a2-goog

thanks,

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ