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]
Date:   Thu, 10 Dec 2020 09:44:09 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     heikki.krogerus@...ux.intel.com, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, Kyle Tso <kyletso@...gle.com>,
        Badhri Jagan Sridharan <badhri@...gle.com>,
        Will McVicker <willmcvicker@...gle.com>
Subject: Re: [PATCH 4/5] USB: typec: tcpm: Add a 30ms room for tPSSourceOn in
 PR_SWAP

On Thu, Dec 10, 2020 at 05:05:20PM +0100, Greg Kroah-Hartman wrote:
> From: Kyle Tso <kyletso@...gle.com>
> 
> TCPM state machine needs 20-25ms to enter the ErrorRecovery state after
> tPSSourceOn timer timeouts. Change the timer from max 480ms to 450ms to
> ensure that the timer complies with the Spec. In order to keep the
> flexibility for other usecases using tPSSourceOn, add another timer only
> for PR_SWAP.
> 
> Cc: Guenter Roeck <linux@...ck-us.net>
> Cc: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> Cc: Badhri Jagan Sridharan <badhri@...gle.com>
> Signed-off-by: Kyle Tso <kyletso@...gle.com>
> Signed-off-by: Will McVicker <willmcvicker@...gle.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

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

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 2 +-
>  include/linux/usb/pd.h        | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index d51c45961893..5ed78194a1bd 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -3728,7 +3728,7 @@ static void run_state_machine(struct tcpm_port *port)
>  			tcpm_set_state(port, ERROR_RECOVERY, 0);
>  			break;
>  		}
> -		tcpm_set_state(port, ERROR_RECOVERY, PD_T_PS_SOURCE_ON);
> +		tcpm_set_state(port, ERROR_RECOVERY, PD_T_PS_SOURCE_ON_PRS);
>  		break;
>  	case PR_SWAP_SRC_SNK_SINK_ON:
>  		/* Set the vbus disconnect threshold for implicit contract */
> diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
> index 63a66dd5d832..bb9a782e1411 100644
> --- a/include/linux/usb/pd.h
> +++ b/include/linux/usb/pd.h
> @@ -466,6 +466,7 @@ static inline unsigned int rdo_max_power(u32 rdo)
>  #define PD_T_DRP_SRC		30
>  #define PD_T_PS_SOURCE_OFF	920
>  #define PD_T_PS_SOURCE_ON	480
> +#define PD_T_PS_SOURCE_ON_PRS	450	/* 390 - 480ms */
>  #define PD_T_PS_HARD_RESET	30
>  #define PD_T_SRC_RECOVER	760
>  #define PD_T_SRC_RECOVER_MAX	1000
> -- 
> 2.29.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ