From patchwork Mon Nov 6 11:06:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 161947 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2579620vqu; Mon, 6 Nov 2023 03:08:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IF09E8p4WuqviK4k9CXwiNvN+R8ZLmaM57e+zjV6NGNyIS5bK9ocaTviBMB9beLbo/WWxHG X-Received: by 2002:a17:902:fb07:b0:1ca:72f9:253a with SMTP id le7-20020a170902fb0700b001ca72f9253amr29628097plb.23.1699268880951; Mon, 06 Nov 2023 03:08:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699268880; cv=none; d=google.com; s=arc-20160816; b=K3eqMtDw0CvGT+1G728xf9921b2zriJfq+I/zT+eORX2dQqN6aSEl6bn4vJgeKQQ6E OYqrOdsuLhzmQLmxpfcz++Jc4YJPd37mz/duySPk9gWXjG9JmkA91bcaNseReF/dcJdC N/0InnzLKKvhpLADeYHH0F4/2LPBW6U3uS9MILV/3GQ4RBml7YxsiClY9W/M7fjiI8qp 82XcADdyC6mzLxIBt7RfA2cGlwELIwg/mPpx5Sr2bPnhCmOtQauVDVsPN4wLz1AWY7qi Hv7LS3kmT7WuNFF99/R+Ud6og6re+XhT4CYle2bjEphPMlpQZDA9ozESY1W8B1uR2yV2 IjMg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ft/qdxZ+11oY5oiRUsTk9Xp/GFtS093bc8B5aRokb40=; fh=PGQnTi5hz5/Tkp9zCkOnRqrE6l+i+8Bz40om8sWfmt8=; b=zVfKwG53P7u5jpw9RZPMIT9u3IvXLed7g4vvBuFNHzVxon4OqN1I5Lh9LJ6lJmiLEC zt6kn+M44H0ysXhuF7Bw2iQpxgfBmHF2A5ZLtTincXF9zlVBe2bnSiw2pBm2FKvUtqnl ZNgNS6UjIFpkmQrWAz+C84r+LLzedjACE27aZZ7zrOAV3j19vqf3lJ5HyiGqT/UnofW5 ZUo35FbPvp6NVHVyFFl8WC3k5dq5a0hsk+1gaocR7bmMYVMAe0kZ7Wd6pUyJnQWQ4i7e yNbsRWNguZLFNvqrQOnil52a5r3KEeEMkg6ZFJAv4OWqTrr4iq5lf+a+qU4WR8J3S7aB dBEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=peZFJ2Cx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id s12-20020a170903200c00b001c3b4eb2135si7459951pla.463.2023.11.06.03.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 03:08:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=peZFJ2Cx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id F0880803FF82; Mon, 6 Nov 2023 03:07:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbjKFLGz (ORCPT + 36 others); Mon, 6 Nov 2023 06:06:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbjKFLGt (ORCPT ); Mon, 6 Nov 2023 06:06:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC10A134; Mon, 6 Nov 2023 03:06:46 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30902C433C9; Mon, 6 Nov 2023 11:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699268806; bh=q/xLTHFuLYcmp6NtzuTCC0cv7q+YbosYhXcrvfEUmDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=peZFJ2Cx2PvFGctJiv0cWGJ08qUNymKNlkYLTLpkqoXiArTcIJNUYJI/EsGt4IR01 oVbC/gxtOuvLRFsV84BwdE0vMOvIStwpjxcap9A9CEZyXON5ey4A+g2lWQF7Xb7zt9 co1rbZNvoMLWQfunW+U5dM7fYiX7BsYsIIDllUtYP81863crCx+9kg2x/VHNBtNhsE 0BxKDuV10vrHoLHrMOv9PnB8Xjc7BX4UJzqExtfzKAHRB4S4anQEQDEtoY62wAHDbT kI28FsWsByAt4gXXw0h7CJ6/cf35jLKQVe2e+SXU9ltrVNfd1tNWH5SOP6KIvH2Vqm URkZ50dMEpVQw== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qzxS7-00085v-2e; Mon, 06 Nov 2023 12:07:31 +0100 From: Johan Hovold To: Greg Kroah-Hartman Cc: Vinod Koul , Kishon Vijay Abraham I , Stanley Chang , linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-usb@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 3/3] Revert "usb: phy: add usb phy notify port status API" Date: Mon, 6 Nov 2023 12:06:54 +0100 Message-ID: <20231106110654.31090-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110654.31090-1-johan+linaro@kernel.org> References: <20231106110654.31090-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 06 Nov 2023 03:07:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781812554740029167 X-GMAIL-MSGID: 1781812566562357728 This reverts commit a08799cf17c22375752abfad3b4a2b34b3acb287. The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding. Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong. We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo. Revert the new notification interface which is broken by design. Fixes: a08799cf17c2 ("usb: phy: add usb phy notify port status API") Cc: stable@vger.kernel.org # 6.6 Cc: Stanley Chang Signed-off-by: Johan Hovold --- drivers/usb/core/hub.c | 23 ----------------------- include/linux/usb/phy.h | 13 ------------- 2 files changed, 36 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 0ff47eeffb49..dfc30cebd4c4 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -622,29 +622,6 @@ static int hub_ext_port_status(struct usb_hub *hub, int port1, int type, ret = 0; } mutex_unlock(&hub->status_mutex); - - /* - * There is no need to lock status_mutex here, because status_mutex - * protects hub->status, and the phy driver only checks the port - * status without changing the status. - */ - if (!ret) { - struct usb_device *hdev = hub->hdev; - - /* - * Only roothub will be notified of port state changes, - * since the USB PHY only cares about changes at the next - * level. - */ - if (is_root_hub(hdev)) { - struct usb_hcd *hcd = bus_to_hcd(hdev->bus); - - if (hcd->usb_phy) - usb_phy_notify_port_status(hcd->usb_phy, - port1 - 1, *status, *change); - } - } - return ret; } diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index b513749582d7..e4de6bc1f69b 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -144,10 +144,6 @@ struct usb_phy { */ int (*set_wakeup)(struct usb_phy *x, bool enabled); - /* notify phy port status change */ - int (*notify_port_status)(struct usb_phy *x, int port, - u16 portstatus, u16 portchange); - /* notify phy connect status change */ int (*notify_connect)(struct usb_phy *x, enum usb_device_speed speed); @@ -320,15 +316,6 @@ usb_phy_set_wakeup(struct usb_phy *x, bool enabled) return 0; } -static inline int -usb_phy_notify_port_status(struct usb_phy *x, int port, u16 portstatus, u16 portchange) -{ - if (x && x->notify_port_status) - return x->notify_port_status(x, port, portstatus, portchange); - else - return 0; -} - static inline int usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed) {