Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp553525lqo; Thu, 16 May 2024 14:12:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUHsN3Zb/lrKKrnxWoBR7TapWuVoMC8DNObImYCfn7+ueeBTr5mi6Kcb4X3yIj/gfbcSHHAiABKoCbt67gkTLPvCF3WIG7KZyA41iO4CQ== X-Google-Smtp-Source: AGHT+IE8bzdN67XP9AIH8K3xBAMXdUROrHS2+r/aOY9Vm8nrDb9VZl4MN3iqw8QXm1rnWCupE2ZH X-Received: by 2002:a05:6808:2006:b0:3c9:68ee:dffa with SMTP id 5614622812f47-3c997039df3mr24614251b6e.5.1715893929311; Thu, 16 May 2024 14:12:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715893929; cv=pass; d=google.com; s=arc-20160816; b=VtBFd7GObxe6Cf/2wdWFbQHB1YlneJvqGqBNAKrO3nhU07zXUjWw5rSbBx3CLueIaw rip5v3jTQQiR3URxAOMi8bhBEU17jt0MCMzIk1uPruUEfZyWAfWWMIkGIxzVcND0ASpL MxLXoZSZVixBFVAQmVwFQBo0NugMETVwRMBp+ghHKMlm1d4e5ERESRQckqiBP1KAXUV0 PxG4R0LKfsfW9vegZiGzEde3u2oN0TlRGvecp++yfYyBSiCjAqzJAM3OX1wwMgdF46RU fzwkFA3bAWk/UPiMYavGWPMWRR45Sk3QOoT1CR0X1psFG4BoVVO+xusHChZ0xlouk62v JW3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:message-id:subject:cc :from:to:date:dkim-signature; bh=d4j2OtGA6Vp0Lt9eyDtzX/aZext1Y5uousK6juRLCrY=; fh=QqTluNbsgr+uMt+dUS7MP1aqZgtp2t4D+sqk0VoOB24=; b=ARip3V0NosfTPQIfZSnCWCCjykrWTJwvvy8W4uUWqr3Zysug4fVAzTubsNz1I5+m1y Dhj3PB/k6OVnrjGAOVD6eOkI4DuSmmqp5SxgLtvQBynaykiwUeruYWpPrBn8SgzuISWz ClntNiBDG7/h0twcyutp8/qep4xsMv7ZhnULs5t2O04a7XrdVZRuEOn4BEp2A1Ca70cH 7C3FHlq3jhZ90ytakMH0tOHrhFqcVFDQtXvs8xFucL3d/raC1gTDJe1cfnH3qSoqKzab vg60xMqbVp6bdhObEqeorfeKV3vWn1nhH0feKwqQAaduUkaRBOk4YJMmgr22ruWNXXaX ZiPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@franken-peeters.be header.s=protonmail2 header.b=1LKw1Jze; arc=pass (i=1 spf=pass spfdomain=franken-peeters.be dkim=pass dkdomain=franken-peeters.be dmarc=pass fromdomain=franken-peeters.be); spf=pass (google.com: domain of linux-kernel+bounces-181582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=franken-peeters.be Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf38d2dfsi1625261985a.755.2024.05.16.14.12.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 14:12:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@franken-peeters.be header.s=protonmail2 header.b=1LKw1Jze; arc=pass (i=1 spf=pass spfdomain=franken-peeters.be dkim=pass dkdomain=franken-peeters.be dmarc=pass fromdomain=franken-peeters.be); spf=pass (google.com: domain of linux-kernel+bounces-181582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=franken-peeters.be Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E0C121C214CD for ; Thu, 16 May 2024 21:12:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81109158202; Thu, 16 May 2024 21:12:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=franken-peeters.be header.i=@franken-peeters.be header.b="1LKw1Jze" Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E7AF157E9E for ; Thu, 16 May 2024 21:11:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715893920; cv=none; b=MM5iPltOxt4GHiOcZmJFCemRSpMq3Yo5eUL3lewJF4A43pqt+Uoont8E+36t4Eyv2D/sDLt8aN6Gf6cR5+ZyZSv9diQo78xCr9GF7Yr/6oa4Ba+14pjtlqJ+rig1Xw7n/wKrvptFDYgvTpYaEC++Dn1j/zYMTA4xtU9R2/rbwpU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715893920; c=relaxed/simple; bh=obqdqVwbBsHvvAadtY0OXNbvhRT40zmjIJh2iWnmyx4=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=S1K4y9a1reIxKtCPqilA3jeMP3IecnUvSCFMo0s86I3gZUfZdbV0fqqF14evmM4xOLKh8zuSgAqGrVM+5MBNou9sPcrENYi4juih3eHEFq5BisYH56/yTjz0kJuz06IKP+KXvoLOhE+NzvOL7d+COAVLgn9skBKS+6YrblES0AQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=franken-peeters.be; spf=pass smtp.mailfrom=franken-peeters.be; dkim=pass (2048-bit key) header.d=franken-peeters.be header.i=@franken-peeters.be header.b=1LKw1Jze; arc=none smtp.client-ip=185.70.43.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=franken-peeters.be Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=franken-peeters.be DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=franken-peeters.be; s=protonmail2; t=1715893913; x=1716153113; bh=d4j2OtGA6Vp0Lt9eyDtzX/aZext1Y5uousK6juRLCrY=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=1LKw1JzeqfQqkzdnHPc02Dm77/8yccgoDhaffBhZyN0NqYCL9yLn+HQQjdr+eROXd lEmqWcPjlcrtcSF8eWlZ5bw7kMcnY6ThathI8HA3X3On4jnCtiHpkgHQ9Z2Nu+C9L3 XGf6N7BAnSLbNEvMgqGVaMmLo/nGIfWmr2Ke/PPZ2fI/1MYNEa23zHND8w5bjB4MwL JnrrgoyvYjY99PzxutogeJS3gzu9hdun9esexWQZtpnx/Z8pqtkf/Xy3Obw4rhgWBL 0scTY1m5tL7vLv3kAgZMUwJPlejH9JQT/CrfzgBM9+if/jA6l30JZya3cSf1AQXHpM DJ92ChVwnw8DQ== Date: Thu, 16 May 2024 21:11:46 +0000 To: Marek Szyprowski , Michael Grzeschik , Peter Chen , Greg Kroah-Hartman From: Wouter Franken Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: chipidea: move ci_ulpi_init after the phy initialization Message-ID: Feedback-ID: 87808963:user:proton X-Pm-Message-ID: f9e38adc63416260f2281549bc731935d9ca77cb Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello all, On 4/25/24 21:40, Marek Szyprowski wrote: > Dear All, > > On 02.04.2024 08:23, Michael Grzeschik wrote: >> The function ci_usb_phy_init is already handling the >> hw_phymode_configure path which is also only possible after we have >> a valid phy. So we move the ci_ulpi_init after the phy initialization >> to be really sure to be able to communicate with the ulpi phy. >> >> Signed-off-by: Michael Grzeschik > This patch landed in linux-next some time ago as commit 22ffd399e6e7 > ("usb: chipidea: move ci_ulpi_init after the phy initialization"). > Unfortunately it breaks host USB operation on DragonBoard410c > (arch/arm64/boot/dts/qcom/apq8016-sbc.dts). There is no error nor > warning in the kernel log besides the information about deferred probe > on the chipidea controller: > > platform ci_hdrc.0: deferred probe pending: (reason unknown) > > Tomorrow I will try to investigate which operation during driver probe > triggers it. If there is anything else to check that might help fixing > this issue, let me know. I have the same problem on sony yuga=20 (arch/arm/boot/dts/qcom/qcom-apq8064-sony-xperia-lagan-yuga.dts): it breaks USB operation and shows the same message in the kernel log. I have analyzed this issue and came to the following conclusion: >> --- >> drivers/usb/chipidea/core.c | 8 ++++---- >> drivers/usb/chipidea/ulpi.c | 5 ----- >> 2 files changed, 4 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c >> index 835bf2428dc6e..bada13f704b62 100644 >> --- a/drivers/usb/chipidea/core.c >> +++ b/drivers/usb/chipidea/core.c >> @@ -1084,10 +1084,6 @@ static int ci_hdrc_probe(struct platform_device *= pdev) >> =09=09return -ENODEV; >> =09} >> =20 >> -=09ret =3D ci_ulpi_init(ci); >> -=09if (ret) >> -=09=09return ret; >> - This ci_ulpi_init(...) call eventually calls probe(..) on the USB phy=20 when the ulpi driver registers all its child nodes. A couple lines later devm_phy_get(..) is=20 called to get the initialized phy device. Due to the move of the=20 ci_ulpi_init(..) the phy is not probed and the devm_phy_get(..) call fails with EPROBE_DEFER.=20 This results in a deadlock. I don't understand the complete train of thought behind this patch to=20 propose a fix but hopefully my investigation can help to solve the issue. >> =09if (ci->platdata->phy) { >> =09=09ci->phy =3D ci->platdata->phy; >> =09} else if (ci->platdata->usb_phy) { >> @@ -1142,6 +1138,10 @@ static int ci_hdrc_probe(struct platform_device *= pdev) >> =09=09goto ulpi_exit; >> =09} >> =20 >> +=09ret =3D ci_ulpi_init(ci); >> +=09if (ret) >> +=09=09return ret; >> + >> =09ci->hw_bank.phys =3D res->start; >> =20 >> =09ci->irq =3D platform_get_irq(pdev, 0); >> diff --git a/drivers/usb/chipidea/ulpi.c b/drivers/usb/chipidea/ulpi.c >> index dfec07e8ae1d2..89fb51e2c3ded 100644 >> --- a/drivers/usb/chipidea/ulpi.c >> +++ b/drivers/usb/chipidea/ulpi.c >> @@ -68,11 +68,6 @@ int ci_ulpi_init(struct ci_hdrc *ci) >> =09if (ci->platdata->phy_mode !=3D USBPHY_INTERFACE_MODE_ULPI) >> =09=09return 0; >> =20 >> -=09/* >> -=09 * Set PORTSC correctly so we can read/write ULPI registers for >> -=09 * identification purposes >> -=09 */ >> -=09hw_phymode_configure(ci); >> =20 >> =09ci->ulpi_ops.read =3D ci_ulpi_read; >> =09ci->ulpi_ops.write =3D ci_ulpi_write; >> >> --- >> base-commit: 5bab5dc780c9ed0c69fc2f828015532acf4a7848 >> change-id: 20240328-chipidea-phy-misc-b3f2bc814784 >> >> Best regards, > Best regards Best regards -- Wouter Franken