Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1733932rwi; Thu, 3 Nov 2022 08:30:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7oKU809dqIW4/mUfxa1eefotyOxZt7QpU/Tw+7TOuZ/01Lkw2zh/VNhMOEcqns2hdxnS0M X-Received: by 2002:a17:907:a087:b0:7ad:a2ec:1afa with SMTP id hu7-20020a170907a08700b007ada2ec1afamr29386249ejc.151.1667489422051; Thu, 03 Nov 2022 08:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667489422; cv=none; d=google.com; s=arc-20160816; b=OvNQCofdOOOPmVv5EMZKovTrzzoB2vsTnuwRL1LxZNSqBRZwwCZGWdDXa5FifkZCQW ARwy/2L4bvQcBtM2FOB/MuTOfaLRz6wHyPpiCGhoD5FL4lB/Y39yl1Gqxecyoi2Bmk7a /bpd53GqLOUe1rolNDNHvu4v4nzCClki4q6dNnGR6lo3S6mhEV3aUvttFWnTb1IpTogi bwaS2UEm5TmdnoBkXwVZo3en7MQ6ioSoJOnfVNebBDRt9sz8vXFkRDZv+GpGuwKQIslv dhTyLjelQbBg0MM+7jBq/boHb0zG+tKp4fX+Kav1IDwetkRYTgG3YDvnNpLUwkAjF/m+ wwfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=rbUMn6HqqS28Y3UuFN/O9DUfkW3PyC6du2nvuOus6QI=; b=iaEZGo3kI9IcV+HKNN/9/qXofgKXGJaR/eXjZ06LWeBJvYKzN/tGzqWdOZuvmYco7a LlKRPK+hNRZtpY1RZij/ys2eyEs5u4wY+fSkw2V1MysjAY5yNlgoe2efNa5q60Q5Y6RR SKBddwTPL1qoXbn3h26S77Z5mCoMnWHLkfQ5v0W6a+MmzvdIEP05qa59pZcxGKPmSXVX /bwmdYcHr64GNxDIFNp4ds3clsaYwMDGzVz97OhWEBCosQEzml/4AiV+9PyScQe7CmWV BfpdhNimxKI9WOc0VKSWl5IOvd7Eukx4oluogD0ShRHpgus3Tf/ndadgHceSOnSQV+lb ZfQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kfC2PtOw; 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=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq6-20020a056402220600b004573c1ae3fasi1348725edb.285.2022.11.03.08.29.54; Thu, 03 Nov 2022 08:30:22 -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=@samsung.com header.s=mail20170921 header.b=kfC2PtOw; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232073AbiKCPST (ORCPT + 97 others); Thu, 3 Nov 2022 11:18:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231991AbiKCPSR (ORCPT ); Thu, 3 Nov 2022 11:18:17 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A6A1193CD for ; Thu, 3 Nov 2022 08:18:16 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20221103151814euoutp01bfc5ce2880b43f3aca1fed76acaa0fb1~kHCH0mPQr3243132431euoutp01x for ; Thu, 3 Nov 2022 15:18:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20221103151814euoutp01bfc5ce2880b43f3aca1fed76acaa0fb1~kHCH0mPQr3243132431euoutp01x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1667488694; bh=rbUMn6HqqS28Y3UuFN/O9DUfkW3PyC6du2nvuOus6QI=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=kfC2PtOwv7WPM5S8+tPZwGDD1OvE+/JozBYn+1hhgvwTuWH4UVDiXmkvzol6emS08 D5+ZXYcNrkuzoh5rSj9YH/VgeugNTIrvqK/cn+sr5n3XsbuZAOByw5mFuBmlEy9uAQ 7aKv20s6ckxxn5tikEVqOyMpVewQzXYlYtR0Mw1I= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20221103151813eucas1p16cbb9fafd44f569dc22b07dfdb65a8d9~kHCHY8P2o2075520755eucas1p1s; Thu, 3 Nov 2022 15:18:13 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id AF.8B.29727.5BBD3636; Thu, 3 Nov 2022 15:18:13 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20221103151813eucas1p23d0fcda856fb48133a8a724f835b6665~kHCHANL7o1831318313eucas1p2P; Thu, 3 Nov 2022 15:18:13 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221103151813eusmtrp161e2d75364bb8d19ebb5ed0ecbd8b543~kHCG-apS70504605046eusmtrp1J; Thu, 3 Nov 2022 15:18:13 +0000 (GMT) X-AuditID: cbfec7f2-205ff7000001741f-78-6363dbb58b96 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 90.E1.07473.5BBD3636; Thu, 3 Nov 2022 15:18:13 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221103151812eusmtip23de54a39b28d6be6dda5601291548f1f~kHCGaHvPd2294822948eusmtip2W; Thu, 3 Nov 2022 15:18:12 +0000 (GMT) Message-ID: <53e543e8-f895-d4f1-da94-d0baca528e79@samsung.com> Date: Thu, 3 Nov 2022 16:18:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH stable-5.15 3/3] usb: dwc3: disable USB core PHY management Content-Language: en-US To: Johan Hovold , Stefan Agner Cc: Greg Kroah-Hartman , stable@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Matthias Kaehlcke , stable , regressions@lists.linux.dev, krzk@kernel.org From: Marek Szyprowski In-Reply-To: Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAKsWRmVeSWpSXmKPExsWy7djPc7pbbycnG2z9rWrRvHg9m8WKSoum Gz2sFufPb2C3uLxrDpvF5w2PGS02vu1gt/h0/gKbxYKNjxgtNq9rZ3fg8lj8/R6zx+yGiywe m1Z1snnsn7uG3ePF5pmMHp83yQWwRXHZpKTmZJalFunbJXBl9B74zFawQ7Ri6WzzBsa9/F2M nBwSAiYSu5atZO5i5OIQEljBKHFqzwRGCOcLo8SehglQmc+MEhMaFrDAtDTdeAtVtZxRYtGE oywQzkdGiQM73zOBVPEK2El8vrkTqJ2Dg0VAReL33UqIsKDEyZlPwAaJCqRI7O7eBmYLCwRK TNr/CqyVWUBc4taT+WC2iICzxN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Tk5rYIWwhSX+XOti62LkAqp5zyhx43MfG0iCV8BO4vPNncxdjBwcLAIqEr/vVkKE BSVOznzCAhIWFUiR+HauDiQsLBAoMWn/KyYQm1lAXOLWk/lgtoiAs8TVZWeZQcYzC7QzSTx+ toIFYtdzZol//5+AHcEmYCjR9bYLbC8n0NErdl5nhJhkJtG1tQvKlpfY/nYO8wRGoVlI7piF ZOEsJC2zkLQsYGRZxSiSWlqcm55bbKhXnJhbXJqXrpecn7uJERiV24793LyDcd6rj3qHGJk4 GA8xSnAwK4nwftqWnCzEm5JYWZValB9fVJqTWnyI0RQYFhOZpUST84FpIa8k3tDMwNTQxMzS wNTSzFhJnNezoCNRSCA9sSQ1OzW1ILUIpo+Jg1Oqganhw/2JdrPurvjbyN0yteIkR2eeXJv6 79ryPdVLrBu35AuInC46VbVkvsDOi1+PdBx2YN8+60jdo3khstPKd85+KjHPW1NiUePZ0HUG 3zafZxbLfZpyObfUz2Xu5BdVOVPWzLlwJk9RMTvuAmPmum7PuRv0r2nx+Z5WaV0xWWAJp/b0 1BmlMg+qVsTrbjrHfmfNzwszKt49buBRzjyw/OFvyZMffiX2hSQssNnf9ZpryqaM7/bFQTG5 v/jPzlLtn/F7wuzpE5a1n3Rs7t42bdn/q0smVGspb6v497thqonzsnM6O2INz814tveSpH2H qNvZjUWzp/ceO//j0Wvv2nVhf/wrvz7pi2PfzfaiqabrvhJLcUaioRZzUXEiAEaY6SVTAwAA X-CMS-MailID: 20221103151813eucas1p23d0fcda856fb48133a8a724f835b6665 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20221103145022eucas1p2218e78d51500c85b3cda59cc533a3631 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20221103145022eucas1p2218e78d51500c85b3cda59cc533a3631 References: <20220906120702.19219-1-johan@kernel.org> <20220906120702.19219-4-johan@kernel.org> <808bdba846bb60456adf10a3016911ee@agner.ch> <86c0f1ee8ffc94f9a53690dda6a83fbb@agner.ch> X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, 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 Hi Johan, On 03.11.2022 15:49, Johan Hovold wrote: > On Thu, Oct 27, 2022 at 02:45:15PM +0200, Johan Hovold wrote: >> On Wed, Oct 26, 2022 at 03:11:00PM +0200, Stefan Agner wrote: >>> The user reports the S-ATA disk is *not* recognized with that patch >>> applied. >> I just noticed a mistake in the instrumentation patch I sent you. Could >> you try moving the calibrations calls after dwc3_host_init() (e.g. as in >> the second chunk in the diff below)? >> >> As mentioned in the commit message for a0a465569b45 ("usb: dwc3: remove >> generic PHY calibrate() calls"), this may not work if the xhci-plat >> driver is built as a module and there are some corner cases that it does >> not cover. >> >> It seems we should revert the offending commit and then try to find some >> time to untangle this mess, but please check if the below addresses the >> issue first so we know what the problem is. >> >> I'll prepare a revert in the meantime. > I've now posted the revert, but please do check if the below patch was > enough to resolve the immediate issue. The below patch was a half-fix. It worked only if both dwc3 and xhci_plat_hcd were compiled into the kernel. Afair Debian-based distros used xhci compiled as a module, so this didn't work for that case due to timing issues. > > Johan > >> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c >> index 31156d4dec9f..37d49a394912 100644 >> --- a/drivers/usb/dwc3/core.c >> +++ b/drivers/usb/dwc3/core.c >> @@ -197,6 +197,8 @@ static void __dwc3_set_mode(struct work_struct *work) >> otg_set_vbus(dwc->usb2_phy->otg, true); >> phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_HOST); >> phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_HOST); >> + phy_calibrate(dwc->usb2_generic_phy); >> + phy_calibrate(dwc->usb3_generic_phy); >> if (dwc->dis_split_quirk) { >> reg = dwc3_readl(dwc->regs, DWC3_GUCTL3); >> reg |= DWC3_GUCTL3_SPLITDISABLE; >> @@ -1391,6 +1393,9 @@ static int dwc3_core_init_mode(struct dwc3 *dwc) >> ret = dwc3_host_init(dwc); >> if (ret) >> return dev_err_probe(dev, ret, "failed to initialize host\n"); >> + >> + phy_calibrate(dwc->usb2_generic_phy); >> + phy_calibrate(dwc->usb3_generic_phy); >> break; >> case USB_DR_MODE_OTG: >> INIT_WORK(&dwc->drd_work, __dwc3_set_mode); Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland