From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796212190; b=q996lwlKNPNyOUHv8aNdc/qpN+29YlRrfY0b6xtwQkP9ClTUchB92efA5guE8ppEUso+ ZqIbx9xlLFWeS9zlSxXDRjCbAJ/5fyzh+01rCc0p6a5aQAeBroabkwkG57xHukP+c9Lk2 ST/tkuvzHyKuwEtiQHVkveEvq3oWrIlsgcI0ocCqC7dCoMQGusLPMuOeezpQY5TyCXIV3 yXa9eQQ0NS5ZEMWPmc9wr454+Xqmwb3vxoMOshpGPqzsPG2Rj5EgWU/NBtM4KfC3V5MwP +/bq4hqC6yKWALQRSfhIhzqiOTKHrUr+xlxxjrw7f4HRm1wWu+lxeEY3q6tMRCduN4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796212190; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=d/muDYVsl4fwzmZGzjSDlzgtRAbaaxxxv/wQJ3srTxk=; b=0cWZXMGsei89eJzwWIVtBkJ77MIREppKT1vRWO3V08IWSfSc3G6/39oQjb7GrIg8Mmj7 hinjjk4cyuCmoBvWR+eqjIW0r7BfTxQTIspcJB1pxzhHaLPRwWF8xcnjIiZmmhOgifQdP HBNuQ4TUrSKoPd7Gr6/dHxGd/TfdYZRZXVn91C2rB3alLJcmmdTp3vUroKVo7mjJcaO0v AsOkzou67K7w6JGHDPvlcVnaykH9JdYvA/N5UViEhBMyR7xp4yZ+OTdhsp716mp3tNTL4 7hYqPVb4n6a95TvUJRYNI1cGJWfOxlO+Wf70biScRukyRelWHTuM5YQZBjeXyKkX2Ww== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GWgFKWK7; arc=none 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 8C370606A31A for ; Wed, 2 Dec 2026 11:49:50 +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=GWgFKWK7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B34B11F00897; Wed, 2 Dec 2026 11:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796212190; bh=d/muDYVsl4fwzmZGzjSDlzgtRAbaaxxxv/wQJ3srTxk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=GWgFKWK7clTj9I5QOVsfVia5p4/xpu9v5bkO7ebxja5vRTZs6CkxQh9+MOldRbDn+ YdJFocVOlgtXiaijqDoY+oc4YBGvIytkI3ASxLEUEA2jzVDYdt9VcmpvSdThOoJUzY jXmtesWDiqDwh+n10GtFcOt8R1ao/AYnYtM6jyP+bz0ygch1xQu/AS0WORyy+F9oFN iCPyaRoDaajpbmAZ/5qx7YdkbCohdqGr1FPL5e2sasW+czZ/z6SXdqi3a5Nid2cmJe Qk7HTPrTUIL6Y+ilFhTq2syq2S2IOCywUHvrknoSVNoQSxJPOy86qtvnE0uM/0EXF8 9W3mhV0mmVitA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v7 2/2] phy: cix: add Sky1 USB/DP combo PHY driver Reply-To: sashiko-reviews@lists.linux.dev To: "Gary Yang" Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org, vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com In-Reply-To: <20261202112955.4189591-3-gary.yang@cixtech.com> References: <20261202112955.4189591-1-gary.yang@cixtech.com> <20261202112955.4189591-3-gary.yang@cixtech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 11:49:49 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] phy: cix: udphy_dp_phy_configure() updates dp_lanes before deferred reinit -- commit 6e4b9a67038e72e16be73a6054110e0fe8ccde59 Author: Gary Yang phy: cix: add Sky1 USB/DP combo PHY driver This commit adds a driver for the CIX Sky1 USB/DP combo PHY, exposing USB3 and DisplayPort PHYs and registering a Type-C orientation switch and mode mux. > diff --git a/drivers/phy/cix/phy-cix-usbdp.c b/drivers/phy/cix/phy-cix-us= bdp.c > new file mode 100644 > index 0000000000000..e5da39f75d56e > --- /dev/null > +++ b/drivers/phy/cix/phy-cix-usbdp.c > @@ -0,0 +1,1722 @@ [ ... ] > +static int udphy_dp_phy_configure(struct phy *phy, > + union phy_configure_opts *opts) > +{ > + struct cix_udphy *udphy =3D phy_get_drvdata(phy); > + struct phy_configure_opts_dp *dp =3D &opts->dp; > + int ret; > + > + guard(mutex)(&udphy->mutex); [ ... ] > + if (dp->set_rate) { > + ret =3D udphy_dp_phy_verify_link_rate(dp); > + if (ret) > + return ret; > + } > + > + if (dp->set_lanes) { > + ret =3D udphy_dp_phy_verify_lanes(udphy, dp); > + if (ret) > + return ret; > + } > + > + if (dp->set_voltages) { > + ret =3D udphy_dp_phy_verify_voltages(udphy, dp); > + if (ret) > + return ret; > + } > + > + /* > + * The mode or the plug orientation may have changed while the DP PHY > + * was already powered with the previous configuration, in which case > + * the reprogramming was deferred until the lanes are free. Reprogram > + * the PHY from the rate-setting call, which starts every link > + * training run, and not from the voltage updates that follow it: > + * resetting the block there would wipe the training progress. > + * Otherwise the link would be trained against the previous lane > + * mapping. > + */ > + if (dp->set_rate && udphy->needs_reinit) { > + ret =3D udphy->cfg->udphy_reinit(udphy); > + if (ret) { > + dev_err(udphy->dev, "failed to reconfigure udphy\n"); > + return ret; > + } > + > + udphy->needs_reinit =3D false; > + > + /* > + * The lane count configured in the previous mode only applies > + * to that mode, so let the new mode's lane count apply unless > + * the caller configured one for this mode already. Keep the > + * bus width in sync as udphy_dp_phy_power_on() does. > + */ > + udphy->dp_lanes =3D udphy_dp_lanes_after_reinit(udphy); > + > + phy_set_bus_width(phy, udphy_dplane_get(udphy)); > + > + if (udphy->next_mode =3D=3D UDPHY_MODE_DP) > + udphy->cur_mode &=3D ~UDPHY_MODE_USB; > + else if (udphy->u3_initialized) > + udphy->cur_mode |=3D UDPHY_MODE_USB; > + } > + > + /* All of the options are valid, so they can be applied now. */ > + if (dp->set_lanes) { > + udphy->dp_lanes =3D dp->lanes; > + udphy->lanes_configured =3D true; > + } [Severity: Medium] Can setting udphy->dp_lanes =3D dp->lanes when dp->set_rate is false raise udphy->dp_lanes to 4 while udphy->needs_reinit is still pending? After a mux switch from 2-lane USB+DP to 4-lane DP while the DP PHY is powered on, udphy_dp_phy_verify_lanes() validates dp->lanes against udphy_dplane_get() (which uses udphy->next_mode and allows 4 lanes), while the deferred udphy_reinit() only runs when dp->set_rate is true. A phy_configure() call with set_lanes =3D 1 and set_rate =3D 0 (explicitly anticipated by the comment above calling udphy_dp_lanes_after_reinit()) commits udphy->dp_lanes =3D 4 before the register table is switched, so any voltage update in the same call or before set_rate runs writes DisplayPort TX swing and pre-emphasis levels onto the two outer PMA lanes that still carry USB3 signals. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202112955.4189= 591-1-gary.yang@cixtech.com?part=3D2