Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1610658rwb; Wed, 5 Oct 2022 02:04:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gAvNV8XmecbLcPAOfZMWSn0qHqMmBPQCwghcmYIMZOY8lmmN2VB8oTivIYz95Fey7CNiG X-Received: by 2002:a05:6a00:114c:b0:528:2c7a:630e with SMTP id b12-20020a056a00114c00b005282c7a630emr31252333pfm.86.1664960686414; Wed, 05 Oct 2022 02:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664960686; cv=none; d=google.com; s=arc-20160816; b=FCJ8vArd3CWtJyJBHd0hppIhdDMlrKxXDXNq9WquV7CKDJhRabRGyIw3wX2/S9BoiM AswL+2TQ/EcbkOhZiMaapnZ6eEVPhg33/dYFgG9yA4oBqzgvMAGm6m56xHRA09PD8Bec ZfPeqUBfdufLOYgK38UYsi2lnmGjEyUFV+V5MUjDk+s6lQ8PlQgFSvCnfYXi2xUXpi1D g+OuvF0JCIdE+j+Pm/DkJTly6XCezMn2DEYgMwRYAePg/e0uPKktDzokiFhUF5UK8gc1 SClZOOhthzBMa+zdC6Q1Uh9HP1Hs8LO/UN+qcPJGlkWD1PaYc+st9wAJztw8LInGeN2U aoGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id; bh=atPfD9BNEHIpoR7aS6eQFx5vB7F6IMR8Hk3zfBak70o=; b=W5G8PkoTUL4Jq/+bQyY2eBcMPRhThsST6/In/Q+eKL/NHlk77x2WwWZkAJWKtAtbIf 9DXDC3zIMm08Yeldi3Y7FDrWn3wjUf2MPD8eSZEdtJSCGy/pSZ1MmCOVqdk9R9/dSTUI wEdUt6NnuSB3K7jsk/VpdM2oTiy64dO3+cMqL53OKHgnD324aaPjuQ6nV6zLbyWN+03u SrzEO+yJ7AbuVY4rPaykhZ5AmS5DX9TCSj79YMykCG424PaGHFP291CsDuhreE56i3gj viDBjSjsVAFmhg0R1aZkvWgAMpqSiqzR7jhQ50+XHFymcJzb54tPgveY6CC0yhGl7sGH hIvQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020a170903120c00b00170a89f0d8asi17206609plh.310.2022.10.05.02.04.34; Wed, 05 Oct 2022 02:04:46 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbiJEIpS (ORCPT + 99 others); Wed, 5 Oct 2022 04:45:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230105AbiJEIpM (ORCPT ); Wed, 5 Oct 2022 04:45:12 -0400 Received: from radex-web.radex.nl (smtp.radex.nl [178.250.146.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 064D93C16A; Wed, 5 Oct 2022 01:45:04 -0700 (PDT) Received: from [192.168.1.35] (cust-178-250-146-69.breedbanddelft.nl [178.250.146.69]) by radex-web.radex.nl (Postfix) with ESMTPS id 5106C24065; Wed, 5 Oct 2022 10:45:03 +0200 (CEST) Message-ID: <53ca04e3-ee6f-1c4d-3a08-7b5d9dd0d629@gmail.com> Date: Wed, 5 Oct 2022 10:45:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 From: Ferry Toth Subject: Re: [PATCH v2 2/2] Revert "usb: dwc3: Don't switch OTG -> peripheral if extcon is present" To: Andrey Smirnov , Thinh Nguyen Cc: Andy Shevchenko , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Felipe Balbi , "stable@vger.kernel.org" References: <20220927155332.10762-1-andriy.shevchenko@linux.intel.com> <20220927155332.10762-3-andriy.shevchenko@linux.intel.com> <20221003215734.7l3cnb2zy57nrxkk@synopsys.com> <20221005021212.qwnbmq6p7t26c3a4@synopsys.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NICE_REPLY_A,NML_ADSP_CUSTOM_MED, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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 Hi On 05-10-2022 04:39, Andrey Smirnov wrote: > On Tue, Oct 4, 2022 at 7:12 PM Thinh Nguyen wrote: >> On Tue, Oct 04, 2022, Ferry Toth wrote: >>> Hi >>> >>> Op 04-10-2022 om 10:28 schreef Andy Shevchenko: >>>> On Mon, Oct 03, 2022 at 09:57:35PM +0000, Thinh Nguyen wrote: >>>>> On Tue, Sep 27, 2022, Andy Shevchenko wrote: >>>>>> This reverts commit 0f01017191384e3962fa31520a9fd9846c3d352f. >>>>>> >>>>>> As pointed out by Ferry this breaks Dual Role support on >>>>>> Intel Merrifield platforms. >>>>> Can you provide more info than this (any debug info/description)? It >>>>> will be difficult to come back to fix with just this to go on. The >>>>> reverted patch was needed to fix a different issue. >>> On Merrifield we have a switch with extcon driver to switch between host and >>> device mode. Now with commit 0f01017, device mode works. In host mode the >>> root hub appears, but no devices appear. In the logs there are no messages >>> from tusb1210, but there should be because lately there normally are >>> (harmless) error messages. Nothing in the logs point in the direction of >>> tusb1210 not being probed. >>> >>> The discussion is here:https://urldefense.com/v3/__https://lkml.org/lkml/2022/9/24/237__;!!A4F2R9G_pg!avfDjiGwi8xu0grHYrQQTZEEUnmaKu82xxdty0ZltxyU8BkoFD6AMq4a-7STYiKxNQpdYXgP1QG_IZbroEM$ >>> >>> I tried moving some code as suggested without result:https://urldefense.com/v3/__https://lkml.org/lkml/2022/9/24/434__;!!A4F2R9G_pg!avfDjiGwi8xu0grHYrQQTZEEUnmaKu82xxdty0ZltxyU8BkoFD6AMq4a-7STYiKxNQpdYXgP1QG_boaK8Qw$ >>> >>> And with success:https://urldefense.com/v3/__https://lkml.org/lkml/2022/9/25/285__;!!A4F2R9G_pg!avfDjiGwi8xu0grHYrQQTZEEUnmaKu82xxdty0ZltxyU8BkoFD6AMq4a-7STYiKxNQpdYXgP1QG_MbbbZII$ >>> >>> So, as Andrey Smirnov writes "I think we'd want to figure out why the >>> ordering is important if we want to justify the above fix." >>> >>>> It's already applied, but Ferry probably can provide more info if you describe >>>> step-by-step instructions. (I'm still unable to test this particular type of >>>> features since remove access is always in host mode.) >>>> >>> I'd be happy to test. >> Thanks! >> >> Does the failure only happen the first time host is initialized? Or can >> it recover after switching to device then back to host mode? >> >> Probably the failure happens if some step(s) in dwc3_core_init() hasn't >> completed. >> >> tusb1210 is a phy driver right? The issue is probably because we didn't >> initialize the phy yet. So, I suspect placing dwc3_get_extcon() after >> initializing the phy will probably solve the dependency problem. >> >> You can try something for yourself or I can provide something to test >> later if you don't mind (maybe next week if it's ok). > FWIW, I just got the same HW Ferry has last week and am planning to > work on this over the weekend. I can help you setup, we have binary images available on github as well as Yocto recipies to build them.