Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp663651rwl; Fri, 31 Mar 2023 00:04:40 -0700 (PDT) X-Google-Smtp-Source: AKy350baDPyyagJR3HHwhdikg9/7x2hKisPyJpJahHqd51bPMAhGbyJl349Cx7YNRQt6HtikRBaL X-Received: by 2002:a17:906:1001:b0:93f:e5e4:8c13 with SMTP id 1-20020a170906100100b0093fe5e48c13mr16477324ejm.5.1680246280617; Fri, 31 Mar 2023 00:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680246280; cv=none; d=google.com; s=arc-20160816; b=X+Jkt2eit469R6AYezdBcIBMGNHR5tNhEx8fX05RcUENQz4DE+cdQxlZkSx9YewNx+ HBBXwFfMgqrDONQoRpHpqyZRwJc134eyF6mt4p/eqtJ6eEKVzvUQWL8DzucbxT9k3vs1 Qn64yU6n69AQJGzrAD7Xt972pjDBUEqfRsJ8NHKbC6pPdOePPyfYu6ogu3c/rVME5EJ+ ZxYui8SPUpLwbW4mKJ56jYYwW4wL6XqWIN52ynp1m+szBkT+5Q4ud3fqtclZwstEtjHC 3/NZyiapmJiYZPEoLRAE80ThGs9JhstEl72t+6+6L5euth0rybVTwzSBTRHxRHQN7Guj sSRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+zSKFYWr2ttqDyx6LiOjdEvMCXlCd/T+FotmNjQp/uk=; b=tNTKhnMXCXEbjMCRqv7G8yVOxdb6yS6bnAoI08lJGsyoKfLRzpyHf7g0s0ixR7h+24 WAlcKdwZRufvpw9LsXCxN0kJ+bbb4crTfeX1uS7ZgSQWMKLtOkRE2utmvZvgJBOUu7G6 PfqaS868RbMy7GuAspwkIGo4C3d3b05etOR6BFmY7C+JZuqv4qj6w4zLIV2WaobnPj0d /ov66g4N48C27FL7Yf+hti2XzSQAgVvdn2lwqo9vuU2TwWKcaN6NvjL2gEkiol3IyXUJ xQ2VcsOnFR1N4JoK6KD3ZikQh4uK20oGXMfbD6hycOTrBOS82ygHdkIRRSmD5unjeTDV 5i8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WM6Nxy9p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ke4-20020a17090798e400b009300c219570si1379642ejc.834.2023.03.31.00.04.15; Fri, 31 Mar 2023 00:04:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WM6Nxy9p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230315AbjCaGxR (ORCPT + 99 others); Fri, 31 Mar 2023 02:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbjCaGxO (ORCPT ); Fri, 31 Mar 2023 02:53:14 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70BDD171E; Thu, 30 Mar 2023 23:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680245591; x=1711781591; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=R+AJz0WdWGL1LWdc8q+nVGj5eIhBLWtb4iQl8vjevik=; b=WM6Nxy9pSwBFyd0oRmzAVzhx9bHeQMj0Zj+Lt0N0hDhQur5YT0zo0Owr DIAf6z9DjjOjgDE1+WTwfFLPlMjFTkrU+tFd9fy6Q2sQO6sBXW6UjVhFW 9xGW9p9XcAerZBf+J0OxA+HCaRPf6YQtdIOgtdxKeh5RoDwCAwXD/b9kZ xLb6g9Cw4iOWhEwvGUNLNgCMbBYHP8SDdG9t05786I7mca4f4xA4gL1n9 K8Q1dLT2bkwhdJqrCruP6qvKv1sgSmaSAqi2QioIGE/j8LtDZUKq41KFI i+ZK7vfPp46yzoax3fO7t8wYshMMV/9xc65hU2kfQZrVGI6j4CbHRBEmz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="369167450" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="369167450" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 23:53:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="828605299" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="828605299" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 30 Mar 2023 23:53:08 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 31 Mar 2023 09:53:08 +0300 Date: Fri, 31 Mar 2023 09:53:08 +0300 From: Heikki Krogerus To: RD Babiera Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v1] usb: typec: altmodes/displayport: Fix configure initial pin assignment Message-ID: References: <20230329215159.2046932-1-rdbabiera@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230329215159.2046932-1-rdbabiera@google.com> X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 29, 2023 at 09:51:59PM +0000, RD Babiera wrote: > While determining the initial pin assignment to be sent in the configure > message, using the DP_PIN_ASSIGN_DP_ONLY_MASK mask causes the DFP_U to > send both Pin Assignment C and E when both are supported by the DFP_U and > UFP_U. The spec (Table 5-7 DFP_U Pin Assignment Selection Mandates, > VESA DisplayPort Alt Mode Standard v2.0) indicates that the DFP_U never > selects Pin Assignment E when Pin Assignment C is offered. > > Update the DP_PIN_ASSIGN_DP_ONLY_MASK conditional to intially select only > Pin Assignment C if it is available. > > Fixes: 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode") > Cc: stable@vger.kernel.org > Signed-off-by: RD Babiera Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/altmodes/displayport.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c > index 662cd043b50e..8f3e884222ad 100644 > --- a/drivers/usb/typec/altmodes/displayport.c > +++ b/drivers/usb/typec/altmodes/displayport.c > @@ -112,8 +112,12 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con) > if (dp->data.status & DP_STATUS_PREFER_MULTI_FUNC && > pin_assign & DP_PIN_ASSIGN_MULTI_FUNC_MASK) > pin_assign &= DP_PIN_ASSIGN_MULTI_FUNC_MASK; > - else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK) > + else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK) { > pin_assign &= DP_PIN_ASSIGN_DP_ONLY_MASK; > + /* Default to pin assign C if available */ > + if (pin_assign & BIT(DP_PIN_ASSIGN_C)) > + pin_assign = BIT(DP_PIN_ASSIGN_C); > + } > > if (!pin_assign) > return -EINVAL; > > base-commit: 97318d6427f62b723c89f4150f8f48126ef74961 > -- > 2.40.0.348.gf938b09366-goog -- heikki