Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp607162pxf; Thu, 18 Mar 2021 07:57:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLUF7bPjvDwl3C+Qx44Kp4FRSSjbbODoJ2prTUR/DaWUnKXyOSQEUKL1rCzismkOFOmoQW X-Received: by 2002:a05:6402:2d0:: with SMTP id b16mr4229859edx.194.1616079470418; Thu, 18 Mar 2021 07:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616079470; cv=none; d=google.com; s=arc-20160816; b=0SGDrklrwyF+ztAesCHjCUXvKbsmQ7nBPtTU0p1DSkPc/LowfALmdq7l8Rk52hnb1b B+jxB5gfjJ6D4AlOxL8Fq1bMs10e04Dg8Ap2F+jAUiMYZ3vcUMGRuLT6fm01e9OzwPZy TyE0wgbpksDMhTm2gLlwnXD6haQ7G/DHxfFGq7aCqJpgFiH2uMiRGzgLum8TFpLb17Vx Z0puPdo6xL5CKd9dlk/1pLtK0L+xB/YEcw9Es5Ixxwk6cLbv2lnbBcB1viooUli+Scc9 +kSPWaLK6C0tm+BkP0fEbd/0jSrol8NcGbTDJVvp+8ubQPDisxzAwFAJQN0QIkYsjIvF Bbnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:sender:dkim-signature; bh=dUT3HZrqRsv9CgEECG+Bbe9wAdt88hfxSecgS7Fm9sM=; b=f8lLa0WPIrAG5S4PFxg7AwVP/sSgpRHWNpyJ+kRUsvPVetsESxAEMXT7UoJduIa8IY FcQ/ZO+OwK0xtJsxwMI9bA9ZwR9RFgQONqIMMp1T/r5E7E9KwZQjTVl0M7NzKyF6711P TtJTVBGMNDjJxqzYw4+T3nkRZjdJaJnY1Ap9/xQu5+nIDMY+k6xHQJ/nc/Pn3EQQcL+i Cq9hoAIxjsYFnt0W+a7SdiBZunkabg3eUh5abutmqd6afa2cw2r52B+SN9DoYYU+4YYY pKHck/UttX2ORiPMlrR2szZxzGSdqWPh71VxANzn0855c8g6gyed23H05M5q6DsJlkp2 K5RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z6EHfu88; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si1833358eje.591.2021.03.18.07.57.27; Thu, 18 Mar 2021 07:57:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z6EHfu88; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbhCROzX (ORCPT + 99 others); Thu, 18 Mar 2021 10:55:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231627AbhCROzU (ORCPT ); Thu, 18 Mar 2021 10:55:20 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8357C06174A; Thu, 18 Mar 2021 07:55:20 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id k14-20020a9d7dce0000b02901b866632f29so5456247otn.1; Thu, 18 Mar 2021 07:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dUT3HZrqRsv9CgEECG+Bbe9wAdt88hfxSecgS7Fm9sM=; b=Z6EHfu88HcenUtv0kcLV1Lz1n1D/421zAOeVjdPeTajgfSLzPftAB6ne+yoLSfWBd+ I/VznjMtyef+KmkZzRcDqKMT5SaqTMBmOMMJasm0T1nL9gjYscj8d+bcfBW4yzr3uU6R nld4aSGPQVCn2vsR8Axier6gBDpbcqgDzfa/ANjK14cNlIHbH1/jXlpE4pqhDM1J2Jv5 Lk8t/P+jXD5k71RCOMI6BJRpTWVWezr0x1sFojGuTaquK9kDcEThzJDE1Tli2hMmt/VI r9Xn/+NAHPpMN1jVdlNP2JAEag7qtPth4khNRVSn8qN55d367QGV2MqudoGMJopkxiL1 hpKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=dUT3HZrqRsv9CgEECG+Bbe9wAdt88hfxSecgS7Fm9sM=; b=etrdqQClfOB1ZcP15Ddy8Kxf0ZvrlkE2t0klAkg3m0H9OS2r1pjfiU1NJg4X8aHd8b aTN4AFBp4X+NIqQAWpj3Le0Gveru6MGPM/k4MhonPFZR2jSFiJlFuHODawzj92lo1QbO Bk5Yo9hu7+JrwMiR56+qbM1+YSM2n9EdiudkxTpqJNOUiyvBuEgJ93o+xogENcpB0yVt pWh2FvfVj2QjorH0fKUMK2kxEEdHgpnVy0bI55u0/rXuQO9N80psp0kZTSg24kx7Ot/E X1Fn5U6wrlxCWdfyWWw9N1Ogq8l9vG8bg8bg26yWCqzIiT2LkH6J4VETPDtufKJU1z+b dbnw== X-Gm-Message-State: AOAM5310cwaFNqnXfDCC24WbEAGJXhy5Rcs/Tp1fJD2EWFqKxFjyeRWS X3/PCVqYu8tiQ2TVZ7+1u0YgHCmchmc= X-Received: by 2002:a05:6830:1bed:: with SMTP id k13mr7382800otb.265.1616079319854; Thu, 18 Mar 2021 07:55:19 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id o204sm568146oig.14.2021.03.18.07.55.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Mar 2021 07:55:19 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH v1] usb: typec: tcpm: PD3.0 sinks can send Discover Identity even in device mode To: Badhri Jagan Sridharan , Heikki Krogerus , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210318065604.3757307-1-badhri@google.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9L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1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <3dbda4c3-f623-e52f-eb95-e7c0cc5ac498@roeck-us.net> Date: Thu, 18 Mar 2021 07:55:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210318065604.3757307-1-badhri@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/17/21 11:56 PM, Badhri Jagan Sridharan wrote: >>From 6.4.4.2 Structured VDM: > • Either Port May be an Initiator of Structured VDMs except for the Enter > Mode and Exit Mode Commands which Shall only be initiated by the DFP." > > The above implies that when PD3.0 link is established PD3.0 sinks > can send out discover identity command/AMS once PD negotiation is done. > This allows discovering identity for PD3.0 UFP ports as well. > > Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 11d0c40bc47d..410856ec1702 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -3653,8 +3653,8 @@ static inline enum tcpm_state unattached_state(struct tcpm_port *port) > > static void tcpm_check_send_discover(struct tcpm_port *port) > { > - if (port->data_role == TYPEC_HOST && port->send_discover && > - port->pd_capable) > + if ((port->data_role == TYPEC_HOST || port->negotiated_rev > PD_REV20) && > + port->send_discover && port->pd_capable) > tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0); > port->send_discover = false; > } >