From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794307146; b=ch8SbZJnwTf2ao8uTVQPzMCgtigPYVnLIYtsG6kB+V/h3YpmjQSjqz7BijKfWxrCMwmY TLgYlkHovI+c98G4mN+2EyAWQK8u2xQH/2x0q5gzXeCHcxG3pZk7hucQK9GnfcaBBG37Y hQPgnQxuXV+ktVRmgPeint+o6HfzFwv+yaBlxJQU3JM60VkJkU8fmS2CDjGH6on5eTdWV RBjuate5V9A52CrE7Tpei7TXYz8XvJP2ST/6MnVb0jJGmDIIfszw36QZjarUALRqhB1mx cQI5qLe7VjRFd2I630JzYdWYXS8qbNTTGvPcgrw8uhRq2+nuksZF41RszFozWxz1IEQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794307146; h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; bh=NHmyoMsCMwSG2/nuYw9a6DHQhzdO61SK7Mg+66RUzM8=; b=2jOKI9qFkzFvkL2q1hk0nnwR4hqyXm6tkqPARIXbEc7iauUFrQfrtP9M+NeNu3NKGTzP vPVP614n3j0dwqMv1uswk/G5Shq7AA9yRvuqMu3gTs7+lgDdt0fCqForPrPBacd7Bpgns l2cvj1myPQr+IKA0KmAQNXOBI/WSPHzt74GYHdIjIcGj/wLXcJwzK4LVE9/cYd/UxeuOq gaH7bGlwNeskFId20QB6INgHgFEBYhY/pvDq+PZce6oT8bC649zkKzUT4oskxtVQXvpTm iWnvsz3aimkPwxJ8OOtnQubicmAzt6nNwqtA4WZRehyQS557bpw/f+N6nVxamtriciQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Uxr76c0F; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 320F3606A325; Tue, 10 Nov 2026 10:39:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Uxr76c0F Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1794307146; b=3ATie1GfSKhRegJXXJMGYzgpDC9ZovxaRSsL/uDWrlQfof62/g5T/r/OjcQy5/seFXpP /Ol4fDRaj8O3ilz5N6HoHJS29ZqJMdggv0ePWSZXxJA4ThGJqejN1UdZsk5XFPb6wzSGt 7Pc17itxJ+gqUBcGit+7alijWTugxeIaoPxqJVjoR9mM/4DI0K6nofJoElka5MuVR20TI VEPtZyNssxQrM29nnVdU9cpCJ6qC0wZTqTbbjpEB5cJK3vVsJO5oHFWpQMkddDqX69T7a kENVId6bJltN6czt56YFo6cqqMZwev5f+7cPbaJRTSP6GUez6rtTMUuvaQpBKWmUx2w== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1794307146; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=NHmyoMsCMwSG2/nuYw9a6DHQhzdO61SK7Mg+66RUzM8=; b=L5Be5wDU8FN/svyjDfJlff1fur3fht18BHxJ+rJQ/KE62HypyrFVvRvOwerDWcAzIaF6 sDQvhyDXdzo2VpRqXNp+e4dYVdQDEY1NCf/hrdzbMz2GCZbfJ1nX94lti0q4c/wmIkHSe ByNokswUzpiJlnqClZ0RgPZzpw+3VPHJojVJep2sk8/AabHiP2ZoBO6z2cz8FFejbF/iI R7EHBH9BFJm1UTnyk95/jCIxILd6GW7XmxMa4WiV5aWf8TzMX5Ws1WUA5d9cC3KwKcWDU QmbmEigHr+EO7GKpW6HwvhDmYB6pdC9a9glBKoduREuTHgQ+0aqKZY7+sXiOOXx0cLQ== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id C53811F008A7; Tue, 10 Nov 2026 10:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794307145; bh=NHmyoMsCMwSG2/nuYw9a6DHQhzdO61SK7Mg+66RUzM8=; h=From:Subject:Date:To:Cc:Reply-To; b=Uxr76c0FGZe6yCa5hI0SSagc6Van0FKeqctAX1xi+anCBP2y0vzWiXCEHqPNStE73 E/boD53TXhrkVysDbf3rKc2QEciqrjqZyCf1zf15EjYuw44vgIArnJ53TZyAhN4KYc UW+X84RmDBdgPIUhQ0jZNy3CgcSq+5gdJNbuONeJIMa5IohXVDsAB2tTCNRjxaCO5v yddUVrGGTSLHXpLG1v8fUpOOrMtY21zKNy5tottvbATSBhhVL+64IUuJRJCaCfciDO 7UBAbqaMPtTLoyTvqEItstQmkYW4W6JnTjBmXUwfv1Jcj/9Kr0CsMjD15VpyqHh7OU ACQROmCBIeOqw== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 25C8748ADF; Tue, 10 Nov 2026 10:39:04 +0000 (UTC) From: Arun Iyengar via B4 Relay Subject: [PATCH 0/3] usb: typec: Find a Type-C partner after a warm reboot on the Orange Pi 5 Date: Tue, 10 Nov 2026 10:39:03 +0000 Message-Id: <20261110-tcpm-attach-reboot-v1-0-7657cc1e2dca@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXMTQqDMBBA4avIrDuQmCroVaSL/Iw6Qo0kowji3 Zu2y2/x3gWZElOGvrog0cGZ41qgHxX42a4TIYdiqFXdaq0Vit/eaEWsnzGRi1EwdCY0o2mfyjg o4ZZo5PM3HV5/590t5OV7gvv+AGKCFY12AAAA X-Change-ID: 20261110-tcpm-attach-reboot-d93d5f36403b To: Badhri Jagan Sridharan , Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Arun Iyengar , stable@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794307143; l=3436; i=aiyengar1990@gmail.com; s=20261110; h=from:subject:message-id; bh=iGPQ954ODCaz+2pIX0GxmrENRgHVatfGiGCahDtE+GM=; b=nGR6DIkFNsf6kRM8uWdYzOdsBCNyoOpAc44KAMwDdS41o8nk4dhn65CoIsEK9OkpUeJHJW0my tqQhYt+fWPjB1vnMrS5oq7kcyeSyQOvqVT5cjhkpuc4tdukMhi/hDo6 X-Developer-Key: i=aiyengar1990@gmail.com; a=ed25519; pk=zXpRgUTrhaFe6jLyPqbBy3ccfkj04w0g2690Wv3mg+0= X-Endpoint-Received: by B4 Relay for aiyengar1990@gmail.com/20261110 with auth_id=1480 X-Original-From: Arun Iyengar Reply-To: aiyengar1990@gmail.com After a warm reboot, an Orange Pi 5 (RK3588S, FUSB302) often did not see a Genesys Logic based USB-C to DisplayPort cable that stayed plugged in: tcpm toggled in SRC_UNATTACHED, the FUSB302 raised no interrupt at all, and only a replug at the board brought DisplayPort back. Three changes fix it: 1. tcpm: tcpm_init() sets two states back to back with the port lock held, so the state machine work is queued twice, and the second run applies the PORT_RESET -> PORT_RESET_WAIT_OFF transition at once: tErrorRecovery (100 ms) took 6 us. A pending delay is now re-armed for the time left. This is generic, with Fixes: and Cc: stable. 2. fusb302: toggle with the default Rp current. The FUSB302 found the cable within seconds when it toggled with the default current (after another device was detached), never while it toggled with Rp 3.0A. tcpm still sets the configured Rp level through set_cc() once the port is attached. 3. arm64: dts: rockchip: the Orange Pi 5/5B Type-C port is self-powered (its VBUS comes from vcc5v0_sys, the board runs from a separate power input), so tcpm opens CC during error recovery and the partner sees a real detach at boot. This one is for the Rockchip tree; it does not depend on 1 and 2 to build, but without patch 1 the open-CC period at boot is cut short. It is based on usb-next; on top of my pending "arm64: dts: rockchip: Add USB-C DP AltMode for Orange Pi 5/5B", which adds a node next to the same line, it needs git am -3 (no conflict). I can resend it rebased. Testing, on an Orange Pi 5 with 7.3-based kernels: before, after a warm reboot the cable was not detected (0 FUSB302 interrupts since boot) until it was replugged at the board. With the three patches it was detected on 4/4 boots, the first one starting from that stuck state, with DP connected 1-2 s after boot; the three were tested together, not one at a time. The patches have been in every kernel I have run since; in a later run of 30 reboots with a USB-C DisplayPort monitor, the partner was attached on 30/30 boots, and the tcpm log of every boot shows CC opened in PORT_RESET and 100-112 ms spent there before PORT_RESET_WAIT_OFF. Not tested: other TCPCs (patch 1 is generic, patch 2 only changes fusb302), and the Orange Pi 5B (same dtsi). W=1 arm64 builds of drivers/usb/typec at every patch, CHECK_DTBS for the Orange Pi 5 and 5B and checkpatch --strict are clean. This series was developed with Claude (Anthropic) as a coding assistant: it wrote the code and the commit messages, and I reviewed and tested every change as described above. Signed-off-by: Arun Iyengar --- Arun Iyengar (3): usb: typec: tcpm: Don't cut a pending state delay short on a re-queue usb: typec: fusb302: Toggle with the default Rp current arm64: dts: rockchip: Mark the Orange Pi 5/5B Type-C port self-powered arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5-5b.dtsi | 1 + drivers/usb/typec/tcpm/fusb302.c | 13 +++++++++++-- drivers/usb/typec/tcpm/tcpm.c | 12 ++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) --- base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 change-id: 20261110-tcpm-attach-reboot-d93d5f36403b Best regards, -- Arun Iyengar