Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2350397rdb; Fri, 8 Dec 2023 05:53:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRdFRaHr+vZK3+sC5V04Xx/8v4lMTKQeOedNz7/ycOzwJFQMz71V+fMlYBdfx+UThjZFoL X-Received: by 2002:a05:6a00:3918:b0:6ce:82bd:93e0 with SMTP id fh24-20020a056a00391800b006ce82bd93e0mr34516pfb.38.1702043605586; Fri, 08 Dec 2023 05:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702043605; cv=none; d=google.com; s=arc-20160816; b=hmY3EEOnq4MLN6nmyH/jzRipwyZqLQhJoIcobLyV8WZOI2946cTzv0vabxZ3GGvEcb j5Hb2zU+VAOmbFiMo9oXIoiPm8tcxxZ5JRUwn/t2mvN6GJfW8mrjflitWGpYLUzUtcqy p2qy5LEYi0M7WyUP/e6MfdxoUeZWYVWypTXB6diKPrnTATYlKcL3adUHKmvdBvBLtN+C 33Ks3IHHr3HBxeYoEu4doTBl7GMT4q+LNLasKYXzBxH8UQqwEN81Te79H7HqHoZ7Mart /p0WhbW91H4CuzYXYeBD+fLrk8qNgGzXa6Qh7QQnsf+oLqyDHoUCRx+B23nvyqfaOdEt TpnA== 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=UcSXHYYWkacclaf+1gj0rhg49SjmSYiMSVNoS8Aodb4=; fh=/Qozf689hlt4/vwl9ru3i9fhuepPGSEHh6lUexSRpEs=; b=osZREiLFF0tB9m/GEsd9gQKHonHSa78tcenokHFlDimXD5kXzQJiukpS6nf7bzWd5n eMX1oZbvdWsd+gYSc8im1fI3d/rjCPUm/tMDvBXDWNMC83pjyS3Ewfx3qYJ1pJSZQO9u ABjEspvFuuV05Fev5BiDUEvyVXm5sfs/12hVDWGR55b1do19bDwooTxmObiLQ4gH2X9c 3c/ZD6gjkF1zlm2Fu78gDBPARMFT908AT3wrNI/akmcq5gp4tARn0Fw8cK8YAi0U3Eq6 jixopjJvJNpV2xGTCJGuGT20rFz5t7xmV7ca9fVEXjIc+w/quNKJ4Mi5B89G108LGYim WyBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nMdyNC5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l3-20020a632503000000b005c1b28061b0si1619570pgl.65.2023.12.08.05.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 05:53:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nMdyNC5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3568080A9AAC; Fri, 8 Dec 2023 05:53:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573912AbjLHNw4 (ORCPT + 99 others); Fri, 8 Dec 2023 08:52:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573881AbjLHNwr (ORCPT ); Fri, 8 Dec 2023 08:52:47 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9221A198C; Fri, 8 Dec 2023 05:52:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702043560; x=1733579560; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=WZ4Xf9dWOy5IZ//fizYpQ6RRGOorDCF699W81k/I0MI=; b=nMdyNC5DrnTDhYFJOvyR3L9jkWnFsi6xtnraLur9H2iWuyQnwvZp8Kl/ UAup5hJ0XdlTCBqirSNJ2UsYjG1WI32S6KNcR7/9LHWxyE+WhsIBnsUil V/Ok1jncXFL5tOQDuWsmE4IQfPrQ3ehOFa2+BBDJZIZQhxf5PqH6SZuan W9VN5tLH6lf8iW3v0hRSdcZV4NqeczqGXibNxwqbABVW7YFzRU0jnKdTe joenGT4uknYoC/UheTO6q56zmHhJWsXQryIc95ciI4hYxD9kp39kg7yyr 8RPvDROTuLoTbNg6sH1fCHOrN8QXVr1M8bRqUhYm/Ez0yYzebduqmBZ8F A==; X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="384811099" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="384811099" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2023 05:52:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="721871594" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="721871594" Received: from kuha.fi.intel.com ([10.237.72.185]) by orsmga003.jf.intel.com with SMTP; 08 Dec 2023 05:52:37 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 08 Dec 2023 15:52:36 +0200 Date: Fri, 8 Dec 2023 15:52:36 +0200 From: Heikki Krogerus To: Kyle Tso Cc: linux@roeck-us.net, gregkh@linuxfoundation.org, badhri@google.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v1] usb: typec: tcpm: Query Source partner for FRS capability only if it is DRP Message-ID: References: <20231205074747.1821297-1-kyletso@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231205074747.1821297-1-kyletso@google.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 08 Dec 2023 05:53:23 -0800 (PST) On Tue, Dec 05, 2023 at 03:47:46PM +0800, Kyle Tso wrote: > Source-only port partner will always respond NOT_SUPPORTED to > GET_SINK_CAP. Avoid this redundant AMS by bailing out querying the FRS > capability if the Source port partner is not DRP. > > Signed-off-by: Kyle Tso Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 50cbc52386b3..192c103e0d10 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -4401,7 +4401,8 @@ static void run_state_machine(struct tcpm_port *port) > tcpm_set_current_limit(port, tcpm_get_current_limit(port), 5000); > tcpm_swap_complete(port, 0); > tcpm_typec_connect(port); > - mod_enable_frs_delayed_work(port, 0); > + if (port->pd_capable && port->source_caps[0] & PDO_FIXED_DUAL_ROLE) > + mod_enable_frs_delayed_work(port, 0); > tcpm_pps_complete(port, port->pps_status); > > if (port->ams != NONE_AMS) > -- > 2.43.0.472.g3155946c3a-goog -- heikki