Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp326220pxf; Thu, 18 Mar 2021 00:49:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzecmP6fyw1BEiCFiAhX/ngM2Yhqb0FQLJd18IoGkp8Qf2Zy7tXs37LRigTJnIsUSCX8+7a X-Received: by 2002:a17:906:39a:: with SMTP id b26mr40396673eja.158.1616053782813; Thu, 18 Mar 2021 00:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616053782; cv=none; d=google.com; s=arc-20160816; b=W2QQMFvPfmoBh2H6PgQ6NtYiu1HphH25X19OIgWT2tUA/4HYVcjCjbk5hau0TFCmt3 0zy2FrCFpF+yR+jIMb65vSgKecfb+RbOORqxI3uhytBfB7U42XOlkTmun2VxSyiU59oc OabS1ddGtGufErOmVy1DfI2tdr6r52oIo2e2qHYVCKdRI0odDCHE2G9GqLRb70VCcvEO pKK2Q1zeUpYvcUoDCgKQjkH521JRV81B3oMArBUShW1Nmh6J7tTFgFXFLWBOJmJtcWQA Ny12Ya9sI6+I2N/K8ihv2Vp1wep1+KV8ltMc5phVYtQkYrwk9HcRAghx7xoOVZ9XtGCV 1yng== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=O/jI8rXq/QUlqe5198cNt1NmjO2JkPJ1LUr14ETylZE=; b=xtUa8HPwu+srsGrAQOgYmVjfjyAEii4gOwwkfEhOKbpHHlYm6Til7ASQq51id9CfQv HzXdwx4sgoLNHtIVHbojOyghwy0zVDkzQdlXMFfJgskV04RowO2H7Kupi9qy7NDVWtTe Ra6QdiMdi5FUyy6THr1aGL/oX0wQlwV/YZ+h9TwV42PztlNn5I8NJgEIZ7FiUzC6996Z 3Wi3IXBSlRfc2haZG08OPuqMGFat5Yem5ahuEQuwMq8AfRcc+ZEL/1A+qGVO96bJdXG8 llRUDDHROYS1kBPRYcU90d4HOI+Dv/K1KnZP+mQCU+VlPsNn3ste6x5If07knMPlccGl ym1Q== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg21si1063675ejb.168.2021.03.18.00.49.20; Thu, 18 Mar 2021 00:49:42 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229739AbhCRHsZ (ORCPT + 99 others); Thu, 18 Mar 2021 03:48:25 -0400 Received: from mga17.intel.com ([192.55.52.151]:12929 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229708AbhCRHsI (ORCPT ); Thu, 18 Mar 2021 03:48:08 -0400 IronPort-SDR: KYaEThI1hpFF5N0OS5No2h36GGSk6/QDyCN+S1VGTtqpjl+P4RCLIn/SrrkMXZc6q/hWx7qPwZ c59ZUehM+Q7Q== X-IronPort-AV: E=McAfee;i="6000,8403,9926"; a="169545502" X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="169545502" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 00:48:08 -0700 IronPort-SDR: 0DV7MTEJwdl7a16FZabxjpgqu8Guupv/VWk+KKLr4Y09jl3NNOF51fF/I9dWt41DCnnp/q8MdI sBCifOOWK+7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="512019214" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 18 Mar 2021 00:48:05 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Thu, 18 Mar 2021 09:48:05 +0200 Date: Thu, 18 Mar 2021 09:48:05 +0200 From: Heikki Krogerus To: Badhri Jagan Sridharan Cc: Guenter Roeck , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] usb: typec: tcpm: PD3.0 sinks can send Discover Identity even in device mode Message-ID: References: <20210318065604.3757307-1-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210318065604.3757307-1-badhri@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 11:56:04PM -0700, 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 Acked-by: Heikki Krogerus > --- > 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; > } > -- > 2.31.0.rc2.261.g7f71774620-goog thanks, -- heikki