Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3042075pxu; Tue, 8 Dec 2020 01:46:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrpWDqJ/7oaTPS8afwjAO6vykDR+03uFUmb3qvREUjwwfqAgrExq/CWAxOLo3Y+9m7WNtn X-Received: by 2002:aa7:dbc3:: with SMTP id v3mr24892081edt.199.1607420761458; Tue, 08 Dec 2020 01:46:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607420761; cv=none; d=google.com; s=arc-20160816; b=kjGH+KRA+N1BmH7ptOnnBpaoVRHIgQYWU5e5vGxxjpAEJbAz0xPMuHkYy+O+vjJnXe 9LXiIGWCrqb3cjP5FhWewcW2dGKO15xjZNrjR9R7wKtm97PT5DMkGEaRvkDhyK4E3Qgs dmLKf5YJPGj0SD+iufOVaw63RRI9iYTFK+GeD5jLwI+rwQRLCig/24Si2wi5wpIoMu8G GkQm/krBtAlVhnEkofz7/8omAKwGm0+qbx5KOMuJNr6ILB7tPNDp+c82Xk01AJFe1IIp YFvg7FsNFKwBtjLZcWapGeQfU2zXP0ZlS5tTJEoUWe4+xastakBp5f/TMgOKRNDJr8Uo jEjw== 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:ironport-sdr :ironport-sdr; bh=9Qj1fJS3T9FcAX/4p3cstOiu+nDq6qB5A0sCWieGkn0=; b=LFuKQabvVoYR5/kgs+AWZYIGVUDIOjqWy7sTQ7C3uD4AUqgAS7F/29fwI5ERBAR8wc XROgIjOGLhGUlCj5+8aSOIF3YfE7JFOQI+E1EGrZDDcJdR6Mxty8f4g4Do6KtfW6DYni jg+jei9RxFvpS5WvBDVT7BbuXkiqjhue0CdQOi2mKmJdUHw6l4ObpVEmZosPmfxWpY+/ IaxgVJJK/ZahRqEythtRvHSK4X0Ucyc2GHHCWqPs20qHHO3+C9oJi2YUwsGPw8kuhjLA NdEvgDrpSfALN54vbRX1+F9QPwp4Q+Uyy0u26L+o/RBLvC+avhHleWD5umUXYJUgdqJi cNrw== 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 si15si6376251ejb.394.2020.12.08.01.45.38; Tue, 08 Dec 2020 01:46:01 -0800 (PST) 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 S1729092AbgLHJn1 (ORCPT + 99 others); Tue, 8 Dec 2020 04:43:27 -0500 Received: from mga05.intel.com ([192.55.52.43]:49287 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728007AbgLHJnZ (ORCPT ); Tue, 8 Dec 2020 04:43:25 -0500 IronPort-SDR: QEvepFzE65JO+njNslgNHbO+bAX21UjN9RuxhBzlMYM0hODTtspCWEEWL67VQ+cYXo9vs4eW+r 4zP9z/J8cdxA== X-IronPort-AV: E=McAfee;i="6000,8403,9828"; a="258570644" X-IronPort-AV: E=Sophos;i="5.78,402,1599548400"; d="scan'208";a="258570644" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2020 01:41:40 -0800 IronPort-SDR: lphYxfNFm97c5yzRygv9/53SK56PjpPxm+/DnB/JV+EIhDyXVumECsDgQq5efEsU6vKblus7xv Rx1DGfH/DGFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,402,1599548400"; d="scan'208";a="437322162" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 08 Dec 2020 01:41:37 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 08 Dec 2020 11:41:36 +0200 Date: Tue, 8 Dec 2020 11:41:36 +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: Clear send_discover in tcpm_check_send_discover Message-ID: <20201208094136.GH680328@kuha.fi.intel.com> References: <20201203031908.1491542-1-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201203031908.1491542-1-badhri@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 02, 2020 at 07:19:08PM -0800, Badhri Jagan Sridharan wrote: > tcpm_check_send_discover does not clear the send_discover flag > when any of the following conditions are not met. > 1. data_role is TYPEC_HOST > 2. link is pd_capable > > Discovery indentity would anyways not be attempted during > the current session anymore when the above conditions are not > met. Hence clear the send_discover flag here to prevent > tcpm_enable_frs_work from rescheduling indefinetly. > > Signed-off-by: Badhri Jagan Sridharan Acked-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 3bbc1f10af49..012135ade7b1 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -3035,10 +3035,9 @@ 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) { > + port->pd_capable) > tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0); > - port->send_discover = false; > - } > + port->send_discover = false; > } > > static void tcpm_swap_complete(struct tcpm_port *port, int result) > -- > 2.29.2.576.ga3fc446d84-goog -- heikki