Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp389086rwi; Mon, 10 Oct 2022 01:41:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WHSx6/7+QgUJmNU4mkAMnpImHTfv9YKSJfqon41AMKVRIDqjKfWJ67GwJYV96+H6DiZGL X-Received: by 2002:a05:6a00:1487:b0:563:6367:8a17 with SMTP id v7-20020a056a00148700b0056363678a17mr4159261pfu.85.1665391296346; Mon, 10 Oct 2022 01:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665391296; cv=none; d=google.com; s=arc-20160816; b=spdVFVtnMZfuhrfi5plrw4FeJqdCphEauC6bJZwY0Zrm+w28q0fmFSacJ88ywIDpGn HtLYn1uaKHjRR2E3eE8dHw2EsRjd+g/LQZD4yA6QkBVKcfoI4J1SQu68pOaMu6qG4R1R Zl0CptJr6X+rkfYBpdqFnq1vpvJhbCue9pDgTdFL3uc07KFwBalOA1lekx3MtrR2x3ER 70iC3bGITc1n00D+Hc429fBH/lQo1HMbIQm7jtQS85gwrr84OeeWB9fs79QRm4oEKGMK HQ4T2SlpnQ2jC3jxgcdllyulce6ur3CBZKZnHLG23jzMhpptlHGpWgKtUL/Yj3rxBjEB 3/qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jFjo6Ev3vYMJ/c8rTMfip6OTiPjStWqcUkRgqqpXNAA=; b=BfCvGkh7PHpc17CZ3111fSmV/NFOB3mlEZDxCofvP/EN24Eb+7cra50J9M7M9Ggk7J Sm+Osm7MXxBXmm4/Wn96ECDOLmXnVARruObFL1anoXV8q9YQFbCaM6wem5TK/FQT2gkh 5zIt3ss8ZxdZtEXWZOJLYSRE+m7mTt/ukba7hDyLIrYpVZsLkON1Kgfz4LtYlwAzcdnU kAVsfcVGl5zPWAA4zaFhcxw6whetMlpdIXMj2sGf6Fzd77TGwjZpM2IjHi7620hwOBsS iKU1JclfLzQ4I0xisjyxVFrKuY27ZegkaqWxKVJ9ebaWgySY0/2ymRqLBUFjQsfh4HxF InJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cgPYJ06T; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w33-20020a634921000000b0044e466f47a2si12174703pga.141.2022.10.10.01.41.25; Mon, 10 Oct 2022 01:41:36 -0700 (PDT) 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=@intel.com header.s=Intel header.b=cgPYJ06T; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232068AbiJJHTn (ORCPT + 99 others); Mon, 10 Oct 2022 03:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbiJJHSp (ORCPT ); Mon, 10 Oct 2022 03:18:45 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6285763F39; Mon, 10 Oct 2022 00:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665385999; x=1696921999; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=HKEWtJctxYEfqje53CBekXZxJ+dZd98yO90P5ZQ0vT4=; b=cgPYJ06TPV1YTIYWJKhSazsuRjLo7hnH9d3aX/FzWVASP9T7MOXWhOKb QetFA+b/Y+fMAmlzwY8aq2XwfT3+dno7goJzKDf93OoOia5keelT9Sr/e KN0B8HT/NpEHUFdu0wXK/9STJFGSZ7iaemJofl0BlyCBhrMCcXeGJCnwz rwlH/JjEddpnrMiFDzQvV5oiCiPMqIv1dM4VDntUw+0uFVEs3WL7IlHj7 PkLyr+xw6SlLwYP/IMWhjKJ0Zvs0yp6ScGTV2HKkHKznVL+75CFjFHPbk z/zADjPbQ93I2+GS3fvB2PuOEfO9h6XBPSk5faNCr6bBhk2f4bnnn4s+u A==; X-IronPort-AV: E=McAfee;i="6500,9779,10495"; a="366123853" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="366123853" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 00:12:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10495"; a="954818916" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="954818916" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP; 10 Oct 2022 00:10:30 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1ohmvk-004lLT-2M; Mon, 10 Oct 2022 10:10:28 +0300 Date: Mon, 10 Oct 2022 10:10:28 +0300 From: Andy Shevchenko To: Andrey Smirnov Cc: Ferry Toth , Thinh Nguyen , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Felipe Balbi , "stable@vger.kernel.org" Subject: Re: [PATCH v2 2/2] Revert "usb: dwc3: Don't switch OTG -> peripheral if extcon is present" Message-ID: References: <20221003215734.7l3cnb2zy57nrxkk@synopsys.com> <20221005021212.qwnbmq6p7t26c3a4@synopsys.com> <2886b82d-a1f6-d288-e8d1-edae54046b4f@gmail.com> <20221006021204.hz7iteao65dgsev6@synopsys.com> <20221007021122.nnwmqc6sq43e5xbn@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 Sun, Oct 09, 2022 at 10:02:26PM -0700, Andrey Smirnov wrote: > On Fri, Oct 7, 2022 at 6:07 AM Ferry Toth wrote: Thank you for the testing on your side! ... > OK, Ferry, I think I'm going to need clarification on specifics on > your test setup. Can you share your kernel config, maybe your > "/proc/config.gz", somewhere? When you say you are running vanilla > Linux, do you mean it or do you mean vanilla tree + some patch delta? > > The reason I'm asking is because I'm having a hard time reproducing > the problem on my end. In fact, when I build v6.0 > (4fe89d07dcc2804c8b562f6c7896a45643d34b2f) and then do a > > git revert 8bd6b8c4b100 0f0101719138 (original revert proposed by Andy) > > I get an infinite loop of reprobing that looks something like (some > debug tracing, function name + line number, included): Yes, this is (one of) known drawback(s) of deferred probe hack. I think the kernel that Ferry runs has a patch that basically reverts one from 2014 [1] and allows to have extcon as a module. (1) [1]: 58b116bce136 ("drivercore: deferral race condition fix") > which renders the system completely unusable, but USB host is > definitely going to be broken too. Now, ironically, with my patch > in-place, an attempt to probe extcon that ends up deferring the probe > happens before the ULPI driver failure (which wasn't failing driver > probe prior to https://lore.kernel.org/all/20220213130524.18748-7-hdegoede@redhat.com/), > there no "driver binding" event that re-triggers deferred probe > causing the loop, so the system progresses to a point where extcon is > available and dwc3 driver eventually loads. > > After that, and I don't know if I'm doing the same test, USB host > seems to work as expected. lsusb works, my USB stick enumerates as > expected. Switching the USB mux to micro-USB and back shuts the host > functionality down and brings it up as expected. Now I didn't try to > load any gadgets to make sure USB gadget works 100%, but since you > were saying it was USB host that was broken, I wasn't concerned with > that. Am I doing the right test? Hmm... What you described above sounds more like a yet another attempt to workaround (1). _If_ this is the case, we probably can discuss how to fix it in generic way (somewhere in dd.c, rather than in the certain driver). That said, the real test case should be performed on top of clean kernel before judging if it's good or bad. > For the reference what I test with is: > - vanilla kernel, no patch delta (sans minor debug tracing) + initrd > built with Buildroot 2022.08.1 > - Initrd is using systemd (don't think that really matters, but who knows) > - U-Boot 2022.04 (built with Buildroot as well) > - kernel config is x86_64_defconfig + whatever I gathered from *.cfg > files in https://github.com/edison-fw/meta-intel-edison/tree/master/meta-intel-edison-bsp/recipes-kernel/linux/files -- With Best Regards, Andy Shevchenko