diff mbox series

[5/9] phy: cadence: Sierra: Fix PHY power_on sequence

Message ID 20201103035556.21260-6-kishon@ti.com
State Superseded
Headers show
Series PHY: Enhance Sierra SERDES | expand

Commit Message

Kishon Vijay Abraham I Nov. 3, 2020, 3:55 a.m. UTC
Commit 44d30d622821d ("phy: cadence: Add driver for Sierra PHY")
de-asserts PHY_RESET even before the configurations are loaded in
phy_init(). However PHY_RESET should be de-asserted only after
all the configurations has been initialized, instead of de-asserting
in probe. Fix it here.

Fixes: 44d30d622821d ("phy: cadence: Add driver for Sierra PHY")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

---
 drivers/phy/cadence/phy-cadence-sierra.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.17.1

Comments

Vinod Koul Nov. 16, 2020, 7:32 a.m. UTC | #1
On 03-11-20, 09:25, Kishon Vijay Abraham I wrote:
> Commit 44d30d622821d ("phy: cadence: Add driver for Sierra PHY")

> de-asserts PHY_RESET even before the configurations are loaded in

> phy_init(). However PHY_RESET should be de-asserted only after

> all the configurations has been initialized, instead of de-asserting

> in probe. Fix it here.


Move this up in series..? Also I think we should apply this to fixes and
perhaps cc stable..?

> 

> Fixes: 44d30d622821d ("phy: cadence: Add driver for Sierra PHY")

> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

> ---

>  drivers/phy/cadence/phy-cadence-sierra.c | 7 ++++++-

>  1 file changed, 6 insertions(+), 1 deletion(-)

> 

> diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c

> index 4429f41a8f58..e08548417bce 100644

> --- a/drivers/phy/cadence/phy-cadence-sierra.c

> +++ b/drivers/phy/cadence/phy-cadence-sierra.c

> @@ -319,6 +319,12 @@ static int cdns_sierra_phy_on(struct phy *gphy)

>  	u32 val;

>  	int ret;

>  

> +	ret = reset_control_deassert(sp->phy_rst);

> +	if (ret) {

> +		dev_err(dev, "Failed to take the PHY out of reset\n");

> +		return ret;

> +	}

> +

>  	/* Take the PHY lane group out of reset */

>  	ret = reset_control_deassert(ins->lnk_rst);

>  	if (ret) {

> @@ -621,7 +627,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)

>  

>  	pm_runtime_enable(dev);

>  	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);

> -	reset_control_deassert(sp->phy_rst);

>  	return PTR_ERR_OR_ZERO(phy_provider);

>  

>  put_child:

> -- 

> 2.17.1


-- 
~Vinod
diff mbox series

Patch

diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c
index 4429f41a8f58..e08548417bce 100644
--- a/drivers/phy/cadence/phy-cadence-sierra.c
+++ b/drivers/phy/cadence/phy-cadence-sierra.c
@@ -319,6 +319,12 @@  static int cdns_sierra_phy_on(struct phy *gphy)
 	u32 val;
 	int ret;
 
+	ret = reset_control_deassert(sp->phy_rst);
+	if (ret) {
+		dev_err(dev, "Failed to take the PHY out of reset\n");
+		return ret;
+	}
+
 	/* Take the PHY lane group out of reset */
 	ret = reset_control_deassert(ins->lnk_rst);
 	if (ret) {
@@ -621,7 +627,6 @@  static int cdns_sierra_phy_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(dev);
 	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
-	reset_control_deassert(sp->phy_rst);
 	return PTR_ERR_OR_ZERO(phy_provider);
 
 put_child: