[PATCH v2 1/1] phy: rockchip: naneng-combphy: compatible reset with old DT
Jonas Karlman
jonas at kwiboo.se
Mon Jan 13 13:45:57 PST 2025
Hi Vinod,
On 2025-01-06 11:00, Chukun Pan wrote:
> The device tree of RK3568 did not specify reset-names before.
> So add fallback to old behaviour to be compatible with old DT.
>
> Fixes: fbcbffbac994 ("phy: rockchip: naneng-combphy: fix phy reset")
The commit fbcbffbac994 ("phy: rockchip: naneng-combphy: fix phy reset")
broke backwards compatibly with old DTs and has already been backported
breaking i.e. PCIe and USB on Rockchip RK356x boards on stable and
longterm kernels.
E.g with v6.12.9 on a Radxa ROCK 3A (RK3568) board:
rockchip-naneng-combphy fe830000.phy: error -ENOENT: failed to get phy reset
rockchip-naneng-combphy fe830000.phy: probe with driver rockchip-naneng-combphy failed with error -2
rockchip-naneng-combphy fe840000.phy: error -ENOENT: failed to get phy reset
rockchip-naneng-combphy fe840000.phy: probe with driver rockchip-naneng-combphy failed with error -2
rockchip-naneng-combphy fe820000.phy: error -ENOENT: failed to get phy reset
rockchip-naneng-combphy fe820000.phy: probe with driver rockchip-naneng-combphy failed with error -2
# cat /sys/kernel/debug/devices_deferred
3c0000000.pcie platform: supplier fe840000.phy not ready
fcc00000.usb platform: supplier fe820000.phy not ready
fd000000.usb platform: supplier fe830000.phy not ready
Please revert the commit fbcbffbac994 ("phy: rockchip: naneng-combphy:
fix phy reset") or merge this patch to restore PCIe and USB RK356x.
> Cc: Jianfeng Liu <liujianfeng1994 at gmail.com>
> Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
With this patch PCIe and USB start working again on same board.
Reviewed-by: Jonas Karlman <jonas at kwiboo.se>
Regards,
Jonas
> ---
> drivers/phy/rockchip/phy-rockchip-naneng-combphy.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
> index a1532ef8bbe9..8c3ce57f8915 100644
> --- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
> +++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
> @@ -324,7 +324,10 @@ static int rockchip_combphy_parse_dt(struct device *dev, struct rockchip_combphy
>
> priv->ext_refclk = device_property_present(dev, "rockchip,ext-refclk");
>
> - priv->phy_rst = devm_reset_control_get(dev, "phy");
> + priv->phy_rst = devm_reset_control_get_exclusive(dev, "phy");
> + /* fallback to old behaviour */
> + if (PTR_ERR(priv->phy_rst) == -ENOENT)
> + priv->phy_rst = devm_reset_control_array_get_exclusive(dev);
> if (IS_ERR(priv->phy_rst))
> return dev_err_probe(dev, PTR_ERR(priv->phy_rst), "failed to get phy reset\n");
>
More information about the Linux-rockchip
mailing list