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: <20210212041934.GE103223@roeck-us.net>
Date:   Thu, 11 Feb 2021 20:19:34 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Kyle Tso <kyletso@...gle.com>
Cc:     heikki.krogerus@...ux.intel.com, gregkh@...uxfoundation.org,
        hdegoede@...hat.com, robh+dt@...nel.org, badhri@...gle.com,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org
Subject: Re: [PATCH v6 5/7] usb: typec: displayport: Fill the negotiated SVDM
 Version in the header

On Fri, Feb 05, 2021 at 11:34:13AM +0800, Kyle Tso wrote:
> VDM header now requires SVDM Version. Get it from typec_partner.
> 
> Signed-off-by: Kyle Tso <kyletso@...gle.com>

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

> ---
> Changes since v5:
> - follow the changes of "usb: typec: Manage SVDM version"
> 
>  drivers/usb/typec/altmodes/displayport.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index 0abc3121238f..b7f094435b00 100644
> --- a/drivers/usb/typec/altmodes/displayport.c
> +++ b/drivers/usb/typec/altmodes/displayport.c
> @@ -15,8 +15,8 @@
>  #include <linux/usb/typec_dp.h>
>  #include "displayport.h"
>  
> -#define DP_HEADER(_dp, cmd)		(VDO((_dp)->alt->svid, 1, SVDM_VER_1_0, cmd) | \
> -					 VDO_OPOS(USB_TYPEC_DP_MODE))
> +#define DP_HEADER(_dp, ver, cmd)	(VDO((_dp)->alt->svid, 1, ver, cmd)	\
> +					 | VDO_OPOS(USB_TYPEC_DP_MODE))
>  
>  enum {
>  	DP_CONF_USB,
> @@ -156,9 +156,14 @@ static int dp_altmode_configured(struct dp_altmode *dp)
>  
>  static int dp_altmode_configure_vdm(struct dp_altmode *dp, u32 conf)
>  {
> -	u32 header = DP_HEADER(dp, DP_CMD_CONFIGURE);
> +	int svdm_version = typec_altmode_get_svdm_version(dp->alt);
> +	u32 header;
>  	int ret;
>  
> +	if (svdm_version < 0)
> +		return svdm_version;
> +
> +	header = DP_HEADER(dp, svdm_version, DP_CMD_CONFIGURE);
>  	ret = typec_altmode_notify(dp->alt, TYPEC_STATE_SAFE, &dp->data);
>  	if (ret) {
>  		dev_err(&dp->alt->dev,
> @@ -181,6 +186,7 @@ static int dp_altmode_configure_vdm(struct dp_altmode *dp, u32 conf)
>  static void dp_altmode_work(struct work_struct *work)
>  {
>  	struct dp_altmode *dp = container_of(work, struct dp_altmode, work);
> +	int svdm_version;
>  	u32 header;
>  	u32 vdo;
>  	int ret;
> @@ -194,7 +200,10 @@ static void dp_altmode_work(struct work_struct *work)
>  			dev_err(&dp->alt->dev, "failed to enter mode\n");
>  		break;
>  	case DP_STATE_UPDATE:
> -		header = DP_HEADER(dp, DP_CMD_STATUS_UPDATE);
> +		svdm_version = typec_altmode_get_svdm_version(dp->alt);
> +		if (svdm_version < 0)
> +			break;
> +		header = DP_HEADER(dp, svdm_version, DP_CMD_STATUS_UPDATE);
>  		vdo = 1;
>  		ret = typec_altmode_vdm(dp->alt, header, &vdo, 2);
>  		if (ret)
> -- 
> 2.30.0.365.g02bc693789-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ