Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3911381rwb; Mon, 21 Nov 2022 00:55:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf5soiLfy5AV4aq9/h+m9dAe14QAInIvqWAuSB7GpIZmDlS1VQeYQyYt784Ic/ppPjlTVGl6 X-Received: by 2002:a17:906:7f96:b0:7b2:b782:73 with SMTP id f22-20020a1709067f9600b007b2b7820073mr10936450ejr.641.1669020902733; Mon, 21 Nov 2022 00:55:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669020902; cv=none; d=google.com; s=arc-20160816; b=aGALx85arQ8tYNMdX4TIIrkAbY+zEr4JUakaMJ5x/8pzHpF89qsBy0cQjJGs5ijno3 jkoT//IP+BTBTz3QmCTmgZXiVC369bEKZ5pUt1A5jeB2JJurRx7u7BaLNvFvax7L8lFi 7tHjoazKKZUUFyahT+LnVXx3e1yDitQJdHrizLef9v60fSKrApVTSsgdFcjLsuJQFyP1 HreR9MNKfSN/yWyELCrdEUMYskBqt4Ffll/oDZQiIlFHmJ16beMhYG7q1oAJqJFT3Tpf DemEP00qwMFUFUDeXcTADa1e8BpchK08CZZ4PoEdg5aq7fbxaEaoF5Z2aqa+AYCCmBOV cHAA== 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=nUP6KKWo06p2fwc6Ywc8eblSDIGCjwUurFaWYsTGIKk=; b=B+qQIT/1Ql43IiebNaOeL5hWQDcFfyqK+3Dw5DpBL2151702XPJpq0o8ByCCplF+uC jn/wadKGstdab14B/evx3BEyvRPh15faCVDrem2XRV0+RTB+zRX8CYZjFx8Cn+zaU60f V2X4B6dNwSzlYQXR2sEBjmvJBpYzbuNQIrdybIxEKrCKlcO/60W6UWRzvpKefGYe5FRQ JBz7C62IvjitGk5eLr8qtJ5pvCDaTNcwO4cVNZ+KUfksiL4eWiFoFKtn2VpGxK9mUO5O dIrgBsfsEpL41tK7su+6Jv6cEsB6mnGpsQ5Iww7A7bVL5tutEK7CL8g8fVMFz9UBrj7x 5vJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Bq0/coA4"; 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 p1-20020a056402500100b004580ae4abfcsi8502360eda.460.2022.11.21.00.54.39; Mon, 21 Nov 2022 00:55:02 -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=@intel.com header.s=Intel header.b="Bq0/coA4"; 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 S230168AbiKUIhq (ORCPT + 91 others); Mon, 21 Nov 2022 03:37:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230158AbiKUIhg (ORCPT ); Mon, 21 Nov 2022 03:37:36 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21A9B120A8; Mon, 21 Nov 2022 00:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669019850; x=1700555850; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ONVx5JUDDrdY/F0j8BvBpBwoBCSINvKCjtNVzmScM5k=; b=Bq0/coA4qOPVib4ZO7riUzYMGY/rscjOiCa4hhGN4pEq/V0irkwx7tXL ul5aBEd8dvYlTywtgCCWJVbq8Q2M8mvE4VDEWCUCz3NsIHpEq2FaM3uwO GDMR9xrH9ejlRKULMfSZnUmvakA5e4jNRypxP5/JXfjW/8EcixdPuhrIJ BI6BXi/1JiWxMXW7H0miaV/FbVB5lv2FMyH9VFaMlL4xGqqbDLrvrq6fh pOaPs4D8QH4BFDvUTZMUmzIaAWN6ZT0KuYrP4EbfubPKjporvniF4Pd6r DQEnpNw+jl/81Uayo4NH0vQYNN3JfICDppgds5MIWAkrTnERr5ZtPofdW w==; X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="293894511" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="293894511" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 00:37:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="643235256" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="643235256" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP; 21 Nov 2022 00:37:14 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1ox2Ii-00FBOw-0B; Mon, 21 Nov 2022 10:37:12 +0200 Date: Mon, 21 Nov 2022 10:37:11 +0200 From: Andy Shevchenko To: Ferry Toth Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Heikki Krogerus , Greg Kroah-Hartman , Thinh Nguyen , Sean Anderson , Liu Shixin , Ferry Toth , Andrey Smirnov , stable@vger.kernel.org Subject: Re: [PATCH v4 2/2] usb: dwc3: core: defer probe on ulpi_read_id timeout Message-ID: References: <20221120153704.9090-1-ftoth@exalondelft.nl> <20221120153704.9090-3-ftoth@exalondelft.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221120153704.9090-3-ftoth@exalondelft.nl> 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, Nov 20, 2022 at 04:37:04PM +0100, Ferry Toth wrote: > Since commit 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present"), > Dual Role support on Intel Merrifield platform broke due to rearranging > the call to dwc3_get_extcon(). > > It appears to be caused by ulpi_read_id() masking the timeout on the first > test write. In the past dwc3 probe continued by calling dwc3_core_soft_reset() > followed by dwc3_get_extcon() which happend to return -EPROBE_DEFER. > On deferred probe ulpi_read_id() finally succeeded. Due to above mentioned > rearranging -EPROBE_DEFER is not returned and probe completes without phy. > > As we now changed ulpi_read_id() to return -ETIMEDOUT in this case, we > need to handle the error by calling dwc3_core_soft_reset() and request > -EPROBE_DEFER. On deferred probe ulpi_read_id() is retried and succeeds. > > Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT") > Cc: stable@vger.kernel.org > > Signed-off-by: Ferry Toth Same comments as per patch 1. But before sending v5, let give a chance to others to review the code and other aspects of the changes. -- With Best Regards, Andy Shevchenko