[PATCH v2 1/1] phy: rockchip: naneng-combphy: compatible reset with old DT

Jonas Karlman jonas at kwiboo.se
Thu Jan 30 02:11:54 PST 2025


Hi Vinod,

On 2025-01-30 06:57, Vinod Koul wrote:
> On 06-01-25, 18: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")
>> Cc: Jianfeng Liu <liujianfeng1994 at gmail.com>
>> Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
>> ---
>>  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);
> 
> That is not *same* behaviour on fallback, why _exclusive() for the
> fallback?

Prior to the commit fd3ac6e80497 ("dt-bindings: phy: rockchip: rk3588
has two reset lines") the dt-binding did not require reset-names and it
still does not for the rockchip,rk3568-naneng-combphy compatible. The
binding documentation also mentioned "exclusive PHY reset line" for the
resets prop.

The commit fbcbffbac994 ("phy: rockchip: naneng-combphy: fix phy reset")
broke backward compatibility with the rockchip,rk3568-naneng-combphy
compatible by requiring existence of a "phy" in reset-names.

This patch restores the old behavior prior to fbcbffbac994 ("phy:
rockchip: naneng-combphy: fix phy reset") when
devm_reset_control_array_get_exclusive() was used to restore
compatibility with the rockchip,rk3568-naneng-combphy dt-binding.

Regards,
Jonas

> 
>>  	if (IS_ERR(priv->phy_rst))
>>  		return dev_err_probe(dev, PTR_ERR(priv->phy_rst), "failed to get phy reset\n");
>>  
>> -- 
>> 2.25.1
> 




More information about the Linux-rockchip mailing list