From patchwork Thu Nov 3 14:46:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 14922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp579257wru; Thu, 3 Nov 2022 07:50:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5j3OPQxiLa/hDn8gFJiPO0qVHNE+zHAVLSLQCVbpDKogL2Us89pwKs4rnsvCNinrgF/jzu X-Received: by 2002:a17:907:25c5:b0:782:978d:c3da with SMTP id ae5-20020a17090725c500b00782978dc3damr28233700ejc.623.1667487034046; Thu, 03 Nov 2022 07:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487034; cv=none; d=google.com; s=arc-20160816; b=caBfZ4slDtvtTgEGnSyEKYKXNuiQEa/1XQSy+GuRcgBJQ6MwJbhdiEeXlmocTefqm+ PXzSErqH72l1Y0k22c2ftWeIwWe094nZHuXPUVmNuaXFi9+6vgeZQQmNO3dKLm28VgWy zwB9GtwUErFYLzNay6Hz5oupDUoGhFTfELwYkE8Lz5+zkiEpEH7d8S/JvBeNC+96wwNp O4nvPLfBEHs72AFcJ24oyaP3mPfzy7aWgW1nbZx5XlMtKCTU1NyWerA4TAChTp2OVn62 tPttY3MCJ/dY//ajC6Mxo+u2iteFyq92jr8FpMwIe595WjYiPrKLzAMfpAHH6ogFFHpm lWXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MY1pMt9ujeUqGpdcPOYrQx7ZZ4rehyJPX3CF2Uq33UY=; b=FzUoltjq684casTnoXFrHmdicdeZxrZavjTxGO6wX43xdO4aJhFIL/X2+aXXqbTXbu mhU/CLgeoSEnFLWDd9mIPYEp07NGgrXqwb+L8crmt3BTdB8WHftsEPjvEy8n20rpYcRI 75SQP/pBzxcASaoM5B+/a1HGoB6NvCJKIzwMXl3U/A3kaM+z3AXE7O2GPHU2J3X9K5pS /cbMUoKz+mi57izMSBTo0Nd1EuqeLn9JPEdMX054s/CivqBHPCQUCzTrcGvdPOhLVlG9 ctcemUSPQDw9MoHqLX8I/dEGTqKWszf8pMmmw7DQmL+2RAwl6vAcJZ1q8A7RPoTavs8H LcDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f1mm6nrT; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a17090668cc00b0077d1df3967asi1076715ejr.563.2022.11.03.07.50.09; Thu, 03 Nov 2022 07:50:34 -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=@kernel.org header.s=k20201202 header.b=f1mm6nrT; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231567AbiKCOrW (ORCPT + 99 others); Thu, 3 Nov 2022 10:47:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbiKCOrU (ORCPT ); Thu, 3 Nov 2022 10:47:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 813A35FBF; Thu, 3 Nov 2022 07:47:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1C37161EE9; Thu, 3 Nov 2022 14:47:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 771DDC433D6; Thu, 3 Nov 2022 14:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667486838; bh=gbhpvtSXD4DQTboOw5UHAA7/5MJ3F47V20HOCICIiuA=; h=From:To:Cc:Subject:Date:From; b=f1mm6nrTbYcNw48+CiauaGuSzi3B9+xhtrqQI8lQcVKE3OqmZtM/6hhyo1gWqeVFP HfuxAvnf4cv8zaUllKGJ8YNqKALnk0qVbtlxzZx+3ZcTtrYsjVMY7FdEd6c6C0eJOZ ZLATaxLjPLJvz/I56s6CVsYwPY97FKKLMWuefncj3yDKEESNpsoPji6iikyUh63Z9q 3C5ZB6t/DbNZ9tnvMFoHIUFjz5RrWx2c02QlKZ1SlEj0QNaWs22Q4Vc8dBD1hN/sIg HgcXYWueX3Jv8qRqAw327RTnqgsQkA9ZcymjR/df0WvSPnGoo4WihRolV9OM1hucm+ XBDs2UzbCDaaw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oqbUj-0003hD-4H; Thu, 03 Nov 2022 15:47:01 +0100 From: Johan Hovold To: Greg Kroah-Hartman , Thinh Nguyen Cc: Marek Szyprowski , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Stefan Agner , stable@vger.kernel.org Subject: [PATCH] Revert "usb: dwc3: disable USB core PHY management" Date: Thu, 3 Nov 2022 15:46:48 +0100 Message-Id: <20221103144648.14197-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 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,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748486884357965330?= X-GMAIL-MSGID: =?utf-8?q?1748486884357965330?= This reverts commit 6000b8d900cd5f52fbcd0776d0cc396e88c8c2ea. The offending commit disabled the USB core PHY management as the dwc3 already manages the PHYs in question. Unfortunately some platforms have started relying on having USB core also controlling the PHY and this is specifically currently needed on some Exynos platforms for PHY calibration or connected device may fail to enumerate. The PHY calibration was previously handled in the dwc3 driver, but to work around some issues related to how the dwc3 driver interacts with xhci (e.g. using multiple drivers) this was moved to USB core by commits 34c7ed72f4f0 ("usb: core: phy: add support for PHY calibration") and a0a465569b45 ("usb: dwc3: remove generic PHY calibrate() calls"). The same PHY obviously should not be controlled from two different places, which for example do no agree on the PHY mode or power state during suspend, but as the offending patch was backported to stable, let's revert it for now. Reported-by: Stefan Agner Link: https://lore.kernel.org/lkml/808bdba846bb60456adf10a3016911ee@agner.ch/ Fixes: 6000b8d900cd ("usb: dwc3: disable USB core PHY management") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Tested-by: Marek Szyprowski Acked-by: Thinh Nguyen --- drivers/usb/dwc3/host.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index a7154fe8206d..f6f13e7f1ba1 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -11,13 +11,8 @@ #include #include -#include "../host/xhci-plat.h" #include "core.h" -static const struct xhci_plat_priv dwc3_xhci_plat_priv = { - .quirks = XHCI_SKIP_PHY_INIT, -}; - static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc, int irq, char *name) { @@ -97,11 +92,6 @@ int dwc3_host_init(struct dwc3 *dwc) goto err; } - ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv, - sizeof(dwc3_xhci_plat_priv)); - if (ret) - goto err; - memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); if (dwc->usb3_lpm_capable)