Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3759614rwb; Tue, 8 Nov 2022 08:06:27 -0800 (PST) X-Google-Smtp-Source: AMsMyM6rRyUHPt8MxtrdA4oATdPwIXiOzs91vmfdeUG9IgnAY52mHiFR/vqSs0BZ8L8grP2g8MHa X-Received: by 2002:a05:6a00:1309:b0:535:d421:1347 with SMTP id j9-20020a056a00130900b00535d4211347mr57093327pfu.5.1667923587190; Tue, 08 Nov 2022 08:06:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667923587; cv=none; d=google.com; s=arc-20160816; b=ByxvgrpiPzenmLk9fm+3tP+ukKLLgyl8CjmaVB9vicAIKY2bGxUkx+YuNpvGXiI7T+ rkg70Jy2/9hD09g3JcU3BpXzSFQVfAWO8PbUQx8gOPEAXiZQ1OmTh8PHsD+e2VpX4tnR vOCtdP5C9gLX5mET9s4czFBWFHsg/YGxGq2/P7f+wdO7fBLtEcmAVpV8haLW1FiVeGqK kotcntgDs70GVnObQsaqIrV3XHweUvEtZmUboOocIXwUPUaAEWQUw9Ovs7K/ExgyH0bW JhweCceoh1XAHUoT/lPZdzEbPICxy2NIsXy4CwJ+g/P3hgd8wkj52qc5dgQv0ZYU8J2g Uc/Q== 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=tYS24h32TrVcpVucGV2y/Bl3PxfWURHlkXyOV1B3WvY=; b=VjB8xA+CprtGwJ5hMcGbKLNoyH7mqHQyeWoZECLbE1aFCcBNdT5mpRi6z0w02vmf12 El6RTK65sy1F/Bnml8c9FTa62ItQk9eKd+1uD7yguA9Uuxa4vivtI6yZdiJUqJBJYQIK 5+5FtPMEXkIRue/zwITJ+uzHxsFJa1FglLvcKSNWKyw3RAkTg2CNEyQY/nti8JsQBQa/ AnOmIL5JtV+0Gw1CWsPc36CoIt1JvomnLu3XLV1dR3nv8ohtjzRgoVs77HWZYfkg9DVG BtIbgAZYZuFh7y16y518+LSWsv3wIZJxTbjOI/uHAhDTqETuQKv5heHw5s9qjdLcQK44 NUvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gjTjmRE2; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a170902e54d00b001865d74328esi15786135plf.312.2022.11.08.08.06.13; Tue, 08 Nov 2022 08:06:27 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=gjTjmRE2; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234286AbiKHPnw (ORCPT + 91 others); Tue, 8 Nov 2022 10:43:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233472AbiKHPnu (ORCPT ); Tue, 8 Nov 2022 10:43:50 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6A76F0A; Tue, 8 Nov 2022 07:43:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id F32A4CE1B78; Tue, 8 Nov 2022 15:43:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B606EC433C1; Tue, 8 Nov 2022 15:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667922226; bh=Nw+U58XmhceIB7jzCZHqVjztahNIyAoUjYrmbLVFswk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gjTjmRE2cag7LiHDhndJ/UtlEdZTY9jzj9/E2C8GlIu8QNpluwTafpDb05ZrRNMt5 4UP/zDYDQu8u+3nrKtj3I2IKBpALhoXqIBBvf6REivwBA0R1E2TxNGENqDyeym5AHx lkS6Ea6/xK5OyJub6NwqVgXVrtn7iznIEhO3Nhm8= Date: Tue, 8 Nov 2022 16:43:42 +0100 From: Greg Kroah-Hartman To: Thinh Nguyen Cc: Janne Grunau , "linux-usb@vger.kernel.org" , Sven Peter , "stable@kernel.org" , Andrey Smirnov , Andy Shevchenko , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/1] usb: dwc3: Do not get extcon device when usb-role-switch is used Message-ID: References: <20221106214804.2814-1-j@jannau.net> <20221108020208.y3hrbpaxmzke2lms@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221108020208.y3hrbpaxmzke2lms@synopsys.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Tue, Nov 08, 2022 at 02:02:19AM +0000, Thinh Nguyen wrote: > Hi, > > On Sun, Nov 06, 2022, Janne Grunau wrote: > > The change breaks device tree based platforms with PHY device and use > > usb-role-switch instead of an extcon switch. extcon_find_edev_by_node() > > will return EPROBE_DEFER if it can not find a device so probing without > > an extcon device will be deferred indefinitely. Fix this by > > explicitly checking for usb-role-switch. > > At least the out-of-tree USB3 support on Apple silicon based platforms > > using dwc3 with tipd USB Type-C and PD controller is affected by this > > issue. > > > > Fixes: d182c2e1bc92 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present") > > Cc: stable@kernel.org > > Signed-off-by: Janne Grunau > > --- > > drivers/usb/dwc3/core.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > > index c0e7c76dc5c8..1f348bc867c2 100644 > > --- a/drivers/usb/dwc3/core.c > > +++ b/drivers/usb/dwc3/core.c > > @@ -1710,6 +1710,16 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc) > > if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) > > return extcon_get_extcon_dev(name); > > > > + /* > > + * Check explicitly if "usb-role-switch" is used since > > + * extcon_find_edev_by_node() can not be used to check the absence of > > can not -> can't or cannot "can not" is fine. > > > + * an extcon device. In the absence of an device it will always return > > "a" device, Not an issue. > > + * EPROBE_DEFER. > > + */ > > + if (IS_ENABLED(CONFIG_USB_ROLE_SWITCH) && > > + device_property_read_bool(dev, "usb-role-switch")) > > + return NULL; > > + > > /* > > * Try to get an extcon device from the USB PHY controller's "port" > > * node. Check if it has the "port" node first, to avoid printing the > > -- > > 2.37.3 > > > > Looks like the "port" node check from c824c73a5e08 ("usb: dwc3: drd: > Avoid error when extcon is missing") did not account for this platform > setup. > > This looks fine to me. Should we cleanup the incomplete check and stale > comment right after this too (as a separate patch)? Is this a Reviewed-by: ? thanks, greg k-h