From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3F9CC5DF95 for ; Fri, 21 Aug 2026 13:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d7fuK6+2sBfRiv9LTZsz1qKLLn+Cz9lazmSanGjuBjM=; b=2PVt1KuhQhDkAr qhIlSeRRhi8UIt79ych1MHMXd72sONqddZ9Ils5WAeolQikBaRZ/C1OC4DZbXwIfGq5pg6HEwlTFw /NNY0MVs0l7mA54pHriH9ktItITD7oVip2Qld4hr6IdQbDJ815KMmrP32JTKwcOoeQFaHgHRJOzaF WzSrSMXGaksxyPvyfoKLq2S02FJFgs8k/GUdVxO3kE0muyW3bFWdWk2k5VXhXpt8gmAlYgksBA6Yf fGtrbEA9zB12W8zczPA6c5DfMPqkHh1vmrMazRdN0yHV9t0JRWoeDG0NN9wI+sKMPek5v7xkHOlN5 3HdWSqGpM/fZ+YOzsC7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wxPdu-0000000DSlo-1TkX; Fri, 21 Aug 2026 13:50:47 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wxPdj-0000000DSbS-0CRt; Fri, 21 Aug 2026 13:50:35 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 3954860A78; Fri, 21 Aug 2026 13:50:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id D8104C2BCB3; Fri, 21 Aug 2026 13:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1787320233; bh=+OdNmU3kQtFUJCrPPsP1ZLOdt+4zemG/iTRVI9Yczzo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nSIKX+gRiO/5nYNaej3KWZHgi0X+dJDb9wS5J33mX39xXn03Ex7DQvgEjdEZp4z58 RijZElCtvVTESWx92292ngDu6iqBQV/TLE6fl+rr3c3h0PZXZ4QQxna7cSLVaB+PQU c3ZnloBKWWHKfZfSss05uiDbc0L2iG7nWnabDDHYryaxA2k8cPK60XlkHb8aHWGjGx 30OZQE1+c40p/WGFrpfrCqcH4Awy0safJQUVqX18mUyMH4IokFNyGjna2/Izyz5TdL DQCDnJn729YSyMeyRcI1dA8o+4BkSNPeeVdADzSMYb+4BZSzXnWVqyBJZF16qqx3Yo MohE1K/rTebEQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C16D5C5DF93; Fri, 21 Aug 2026 13:50:33 +0000 (UTC) From: Sven Peter Date: Fri, 21 Aug 2026 15:50:27 +0200 Subject: [PATCH 1/3] phy: apple: atc: Support DUMMY PIPEHANDLER state in configure_pipehandler MIME-Version: 1.0 Message-Id: <20260821-b4-atcphy-usb4-v1-1-45c0b741e0c0@kernel.org> References: <20260821-b4-atcphy-usb4-v1-0-45c0b741e0c0@kernel.org> In-Reply-To: <20260821-b4-atcphy-usb4-v1-0-45c0b741e0c0@kernel.org> To: Janne Grunau , Neal Gompa , Vinod Koul , Neil Armstrong Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Sven Peter , Paul Cristian , stable@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1735; i=sven@kernel.org; h=from:subject:message-id; bh=+OdNmU3kQtFUJCrPPsP1ZLOdt+4zemG/iTRVI9Yczzo=; b=owGbwMvMwCXmIlirolUq95LxtFoSQ1ZH+NJX+Zztsv9Sudi8M7cUh0vmGn48crrmz45Vb74x1 2s2LZ3YUcrCIMbFICumyLJ9v73pk4dvBJduuvQeZg4rE8gQBi5OAZhIlR4jQ6+hnNtj3jKviK/b //jsTK7o5/oRb75/7nr+U3kp6utEvBgZrmluCP1l8O6V5tWoT/J/Zh7xTiipWt2SGP/9k//kgs6 9bAA= X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org For both Thunderbolt and DisplayPort atcphy_configure_pipehandler is reached with a request to switch to the DUMMY state (i.e. usb2 only). With the current code this breaks USB2 when all four SS lanes are used for DisplayPort AltMode because the -EINVAL is passed all the way back to the phy_set_mode() call which results in tearing down xhci and dwc3 again. Let's actually handle that case correctly and also drop the default from the switch such that we get a compiler warning if another pipehandler state is ever added and forgotten here. Reported-by: Paul Cristian Closes: https://github.com/AsahiLinux/linux/pull/515 Fixes: 8e98ca1e74db ("phy: apple: Add Apple Type-C PHY") Cc: stable@vger.kernel.org Signed-off-by: Sven Peter --- drivers/phy/apple/atc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c index 4156fabad742..a3162f25e6cd 100644 --- a/drivers/phy/apple/atc.c +++ b/drivers/phy/apple/atc.c @@ -1121,7 +1121,7 @@ static int atcphy_configure_pipehandler_dummy(struct apple_atcphy *atcphy) static int atcphy_configure_pipehandler(struct apple_atcphy *atcphy, bool host) { - int ret; + int ret = -EINVAL; lockdep_assert_held(&atcphy->lock); @@ -1136,8 +1136,10 @@ static int atcphy_configure_pipehandler(struct apple_atcphy *atcphy, bool host) ret = atcphy_configure_pipehandler_dummy(atcphy); atcphy->pipehandler_up = false; break; - default: - ret = -EINVAL; + case ATCPHY_PIPEHANDLER_STATE_DUMMY: + ret = atcphy_configure_pipehandler_dummy(atcphy); + atcphy->pipehandler_up = false; + break; } return ret; -- 2.55.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy