linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe()
@ 2025-04-10 13:33 Anand Moon
  2025-04-10 13:33 ` [PATCH v1 1/6] phy: amlogic: phy-meson-gxl-usb2: " Anand Moon
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Anand Moon @ 2025-04-10 13:33 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list
  Cc: Anand Moon

Hi All,

Use dev_err_probe() for phy resources to indicate the deferral
reason when waiting for the resource to come up.

Note: The following patch for RTC:

phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe

has not been tested as I do not have access to the Amlogic AGX hardware.
However, I have made improvements to this change based on my understanding
of other code.

Thanks
-Anand

Anand Moon (6):
  phy: amlogic: phy-meson-gxl-usb2: Simplify error handling with
    dev_err_probe()
  phy: amlogic: phy-meson-g12a-usb2: Simplify error handling with
    dev_err_probe()
  phy: amlogic: phy-meson-axg-mipi-pcie-analog: Simplify error handling
    with dev_err_probe()
  phy: amlogic: phy-meson-axg-mipi-dphy: Simplify error handling with
    dev_err_probe()
  phy: amlogic: phy-meson-axg-pcie: Simplify error handling with
    dev_err_probe()
  phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie
    probe

 drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c      | 10 +++-------
 .../phy/amlogic/phy-meson-axg-mipi-pcie-analog.c   | 10 +++-------
 drivers/phy/amlogic/phy-meson-axg-pcie.c           | 14 +++++---------
 drivers/phy/amlogic/phy-meson-g12a-usb2.c          | 10 +++-------
 drivers/phy/amlogic/phy-meson-gxl-usb2.c           | 11 +++--------
 5 files changed, 17 insertions(+), 38 deletions(-)


base-commit: 3b07108ada81a8ebcebf1fe61367b4e436c895bd
-- 
2.49.0



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v1 1/6] phy: amlogic: phy-meson-gxl-usb2: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
@ 2025-04-10 13:33 ` Anand Moon
  2025-04-11  8:32   ` Neil Armstrong
  2025-04-10 13:33 ` [PATCH v1 2/6] phy: amlogic: phy-meson-g12a-usb2: " Anand Moon
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Anand Moon @ 2025-04-10 13:33 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list
  Cc: Anand Moon

Use dev_err_probe() for phy resources to indicate the deferral
reason when waiting for the resource to come up.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/phy/amlogic/phy-meson-gxl-usb2.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
index 14ea89927ab14..6b390304f723c 100644
--- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c
+++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
@@ -237,7 +237,6 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
 	struct phy_meson_gxl_usb2_priv *priv;
 	struct phy *phy;
 	void __iomem *base;
-	int ret;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
@@ -266,13 +265,9 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->reset);
 
 	phy = devm_phy_create(dev, NULL, &phy_meson_gxl_usb2_ops);
-	if (IS_ERR(phy)) {
-		ret = PTR_ERR(phy);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to create PHY\n");
-
-		return ret;
-	}
+	if (IS_ERR(phy))
+		return dev_err_probe(dev, PTR_ERR(phy),
+				     "failed to create PHY\n");
 
 	phy_set_drvdata(phy, priv);
 
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 2/6] phy: amlogic: phy-meson-g12a-usb2: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
  2025-04-10 13:33 ` [PATCH v1 1/6] phy: amlogic: phy-meson-gxl-usb2: " Anand Moon
@ 2025-04-10 13:33 ` Anand Moon
  2025-04-11  8:32   ` Neil Armstrong
  2025-04-10 13:33 ` [PATCH v1 3/6] phy: amlogic: phy-meson-axg-mipi-pcie-analog: " Anand Moon
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Anand Moon @ 2025-04-10 13:33 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list
  Cc: Anand Moon

Use dev_err_probe() for phy resources to indicate the deferral
reason when waiting for the resource to come up.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/phy/amlogic/phy-meson-g12a-usb2.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
index 0e0b5c00b676f..66bf0b7ef8ed3 100644
--- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
+++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
@@ -339,13 +339,9 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev)
 		return ret;
 
 	phy = devm_phy_create(dev, NULL, &phy_meson_g12a_usb2_ops);
-	if (IS_ERR(phy)) {
-		ret = PTR_ERR(phy);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to create PHY\n");
-
-		return ret;
-	}
+	if (IS_ERR(phy))
+		return dev_err_probe(dev, PTR_ERR(phy),
+				     "failed to create PHY\n");
 
 	phy_set_bus_width(phy, 8);
 	phy_set_drvdata(phy, priv);
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 3/6] phy: amlogic: phy-meson-axg-mipi-pcie-analog: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
  2025-04-10 13:33 ` [PATCH v1 1/6] phy: amlogic: phy-meson-gxl-usb2: " Anand Moon
  2025-04-10 13:33 ` [PATCH v1 2/6] phy: amlogic: phy-meson-g12a-usb2: " Anand Moon
@ 2025-04-10 13:33 ` Anand Moon
  2025-04-11  8:32   ` Neil Armstrong
  2025-04-10 13:33 ` [PATCH v1 4/6] phy: amlogic: phy-meson-axg-mipi-dphy: " Anand Moon
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Anand Moon @ 2025-04-10 13:33 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list
  Cc: Anand Moon

Use dev_err_probe() for phy resources to indicate the deferral
reason when waiting for the resource to come up.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c
index ae898f93f97b2..c0ba2852dbb8e 100644
--- a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c
+++ b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c
@@ -200,7 +200,6 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev)
 	struct phy_axg_mipi_pcie_analog_priv *priv;
 	struct device_node *np = dev->of_node, *parent_np;
 	struct regmap *map;
-	int ret;
 
 	priv = devm_kmalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
@@ -219,12 +218,9 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev)
 	priv->regmap = map;
 
 	priv->phy = devm_phy_create(dev, np, &phy_axg_mipi_pcie_analog_ops);
-	if (IS_ERR(priv->phy)) {
-		ret = PTR_ERR(priv->phy);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to create PHY\n");
-		return ret;
-	}
+	if (IS_ERR(priv->phy))
+		return dev_err_probe(dev, PTR_ERR(priv->phy),
+				     "failed to create PHY\n");
 
 	phy_set_drvdata(priv->phy, priv);
 	dev_set_drvdata(dev, priv);
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 4/6] phy: amlogic: phy-meson-axg-mipi-dphy: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
                   ` (2 preceding siblings ...)
  2025-04-10 13:33 ` [PATCH v1 3/6] phy: amlogic: phy-meson-axg-mipi-pcie-analog: " Anand Moon
@ 2025-04-10 13:33 ` Anand Moon
  2025-04-11  8:32   ` Neil Armstrong
  2025-04-10 13:33 ` [PATCH v1 5/6] phy: amlogic: phy-meson-axg-pcie: " Anand Moon
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Anand Moon @ 2025-04-10 13:33 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list
  Cc: Anand Moon

Use dev_err_probe() for phy resources to indicate the deferral
reason when waiting for the resource to come up.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c b/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c
index 08a86962d9492..c4a56b9d32897 100644
--- a/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c
+++ b/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c
@@ -377,13 +377,9 @@ static int phy_meson_axg_mipi_dphy_probe(struct platform_device *pdev)
 		return ret;
 
 	phy = devm_phy_create(dev, NULL, &phy_meson_axg_mipi_dphy_ops);
-	if (IS_ERR(phy)) {
-		ret = PTR_ERR(phy);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to create PHY\n");
-
-		return ret;
-	}
+	if (IS_ERR(phy))
+		return dev_err_probe(dev, PTR_ERR(phy),
+				     "failed to create PHY\n");
 
 	phy_set_drvdata(phy, priv);
 
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 5/6] phy: amlogic: phy-meson-axg-pcie: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
                   ` (3 preceding siblings ...)
  2025-04-10 13:33 ` [PATCH v1 4/6] phy: amlogic: phy-meson-axg-mipi-dphy: " Anand Moon
@ 2025-04-10 13:33 ` Anand Moon
  2025-04-11  8:32   ` Neil Armstrong
  2025-04-10 13:33 ` [PATCH v1 6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe Anand Moon
  2025-04-11 12:11 ` [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Vinod Koul
  6 siblings, 1 reply; 14+ messages in thread
From: Anand Moon @ 2025-04-10 13:33 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list
  Cc: Anand Moon

Use dev_err_probe() for phy resources to indicate the deferral
reason when waiting for the resource to come up.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/phy/amlogic/phy-meson-axg-pcie.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson-axg-pcie.c b/drivers/phy/amlogic/phy-meson-axg-pcie.c
index 60be5cdc600b3..54baf7b8930e1 100644
--- a/drivers/phy/amlogic/phy-meson-axg-pcie.c
+++ b/drivers/phy/amlogic/phy-meson-axg-pcie.c
@@ -131,19 +131,15 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
 	struct phy_axg_pcie_priv *priv;
 	struct device_node *np = dev->of_node;
 	void __iomem *base;
-	int ret;
 
 	priv = devm_kmalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
 	priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
-	if (IS_ERR(priv->phy)) {
-		ret = PTR_ERR(priv->phy);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to create PHY\n");
-		return ret;
-	}
+	if (IS_ERR(priv->phy))
+		return dev_err_probe(dev, PTR_ERR(priv->phy),
+				     "failed to create PHY\n");
 
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe
  2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
                   ` (4 preceding siblings ...)
  2025-04-10 13:33 ` [PATCH v1 5/6] phy: amlogic: phy-meson-axg-pcie: " Anand Moon
@ 2025-04-10 13:33 ` Anand Moon
  2025-04-11  8:33   ` Neil Armstrong
  2025-04-11 12:11 ` [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Vinod Koul
  6 siblings, 1 reply; 14+ messages in thread
From: Anand Moon @ 2025-04-10 13:33 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list
  Cc: Anand Moon

Reorder the PHY creation in the axg-pcie probe function to ensure all
the resource is mapped before creating the PHY. This change addresses
the issue where the PHY creation was attempted before
mapping the necessary resources, potentially causing failures.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/phy/amlogic/phy-meson-axg-pcie.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson-axg-pcie.c b/drivers/phy/amlogic/phy-meson-axg-pcie.c
index 54baf7b8930e1..14dee73f9cb57 100644
--- a/drivers/phy/amlogic/phy-meson-axg-pcie.c
+++ b/drivers/phy/amlogic/phy-meson-axg-pcie.c
@@ -136,11 +136,6 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
-	if (IS_ERR(priv->phy))
-		return dev_err_probe(dev, PTR_ERR(priv->phy),
-				     "failed to create PHY\n");
-
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
@@ -158,6 +153,11 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->analog))
 		return PTR_ERR(priv->analog);
 
+	priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
+	if (IS_ERR(priv->phy))
+		return dev_err_probe(dev, PTR_ERR(priv->phy),
+				     "failed to create PHY\n");
+
 	phy_set_drvdata(priv->phy, priv);
 	dev_set_drvdata(dev, priv);
 	pphy = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v1 1/6] phy: amlogic: phy-meson-gxl-usb2: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 ` [PATCH v1 1/6] phy: amlogic: phy-meson-gxl-usb2: " Anand Moon
@ 2025-04-11  8:32   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2025-04-11  8:32 UTC (permalink / raw)
  To: Anand Moon, Vinod Koul, Kishon Vijay Abraham I, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list

On 10/04/2025 15:33, Anand Moon wrote:
> Use dev_err_probe() for phy resources to indicate the deferral
> reason when waiting for the resource to come up.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>   drivers/phy/amlogic/phy-meson-gxl-usb2.c | 11 +++--------
>   1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
> index 14ea89927ab14..6b390304f723c 100644
> --- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c
> +++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
> @@ -237,7 +237,6 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
>   	struct phy_meson_gxl_usb2_priv *priv;
>   	struct phy *phy;
>   	void __iomem *base;
> -	int ret;
>   
>   	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>   	if (!priv)
> @@ -266,13 +265,9 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
>   		return PTR_ERR(priv->reset);
>   
>   	phy = devm_phy_create(dev, NULL, &phy_meson_gxl_usb2_ops);
> -	if (IS_ERR(phy)) {
> -		ret = PTR_ERR(phy);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "failed to create PHY\n");
> -
> -		return ret;
> -	}
> +	if (IS_ERR(phy))
> +		return dev_err_probe(dev, PTR_ERR(phy),
> +				     "failed to create PHY\n");
>   
>   	phy_set_drvdata(phy, priv);
>   

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v1 2/6] phy: amlogic: phy-meson-g12a-usb2: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 ` [PATCH v1 2/6] phy: amlogic: phy-meson-g12a-usb2: " Anand Moon
@ 2025-04-11  8:32   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2025-04-11  8:32 UTC (permalink / raw)
  To: Anand Moon, Vinod Koul, Kishon Vijay Abraham I, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list

On 10/04/2025 15:33, Anand Moon wrote:
> Use dev_err_probe() for phy resources to indicate the deferral
> reason when waiting for the resource to come up.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>   drivers/phy/amlogic/phy-meson-g12a-usb2.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> index 0e0b5c00b676f..66bf0b7ef8ed3 100644
> --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> @@ -339,13 +339,9 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev)
>   		return ret;
>   
>   	phy = devm_phy_create(dev, NULL, &phy_meson_g12a_usb2_ops);
> -	if (IS_ERR(phy)) {
> -		ret = PTR_ERR(phy);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "failed to create PHY\n");
> -
> -		return ret;
> -	}
> +	if (IS_ERR(phy))
> +		return dev_err_probe(dev, PTR_ERR(phy),
> +				     "failed to create PHY\n");
>   
>   	phy_set_bus_width(phy, 8);
>   	phy_set_drvdata(phy, priv);

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v1 3/6] phy: amlogic: phy-meson-axg-mipi-pcie-analog: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 ` [PATCH v1 3/6] phy: amlogic: phy-meson-axg-mipi-pcie-analog: " Anand Moon
@ 2025-04-11  8:32   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2025-04-11  8:32 UTC (permalink / raw)
  To: Anand Moon, Vinod Koul, Kishon Vijay Abraham I, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list

On 10/04/2025 15:33, Anand Moon wrote:
> Use dev_err_probe() for phy resources to indicate the deferral
> reason when waiting for the resource to come up.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>   drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c
> index ae898f93f97b2..c0ba2852dbb8e 100644
> --- a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c
> +++ b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c
> @@ -200,7 +200,6 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev)
>   	struct phy_axg_mipi_pcie_analog_priv *priv;
>   	struct device_node *np = dev->of_node, *parent_np;
>   	struct regmap *map;
> -	int ret;
>   
>   	priv = devm_kmalloc(dev, sizeof(*priv), GFP_KERNEL);
>   	if (!priv)
> @@ -219,12 +218,9 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev)
>   	priv->regmap = map;
>   
>   	priv->phy = devm_phy_create(dev, np, &phy_axg_mipi_pcie_analog_ops);
> -	if (IS_ERR(priv->phy)) {
> -		ret = PTR_ERR(priv->phy);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "failed to create PHY\n");
> -		return ret;
> -	}
> +	if (IS_ERR(priv->phy))
> +		return dev_err_probe(dev, PTR_ERR(priv->phy),
> +				     "failed to create PHY\n");
>   
>   	phy_set_drvdata(priv->phy, priv);
>   	dev_set_drvdata(dev, priv);

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v1 4/6] phy: amlogic: phy-meson-axg-mipi-dphy: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 ` [PATCH v1 4/6] phy: amlogic: phy-meson-axg-mipi-dphy: " Anand Moon
@ 2025-04-11  8:32   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2025-04-11  8:32 UTC (permalink / raw)
  To: Anand Moon, Vinod Koul, Kishon Vijay Abraham I, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list

On 10/04/2025 15:33, Anand Moon wrote:
> Use dev_err_probe() for phy resources to indicate the deferral
> reason when waiting for the resource to come up.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>   drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c b/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c
> index 08a86962d9492..c4a56b9d32897 100644
> --- a/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c
> +++ b/drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c
> @@ -377,13 +377,9 @@ static int phy_meson_axg_mipi_dphy_probe(struct platform_device *pdev)
>   		return ret;
>   
>   	phy = devm_phy_create(dev, NULL, &phy_meson_axg_mipi_dphy_ops);
> -	if (IS_ERR(phy)) {
> -		ret = PTR_ERR(phy);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "failed to create PHY\n");
> -
> -		return ret;
> -	}
> +	if (IS_ERR(phy))
> +		return dev_err_probe(dev, PTR_ERR(phy),
> +				     "failed to create PHY\n");
>   
>   	phy_set_drvdata(phy, priv);
>   

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v1 5/6] phy: amlogic: phy-meson-axg-pcie: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 ` [PATCH v1 5/6] phy: amlogic: phy-meson-axg-pcie: " Anand Moon
@ 2025-04-11  8:32   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2025-04-11  8:32 UTC (permalink / raw)
  To: Anand Moon, Vinod Koul, Kishon Vijay Abraham I, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list

On 10/04/2025 15:33, Anand Moon wrote:
> Use dev_err_probe() for phy resources to indicate the deferral
> reason when waiting for the resource to come up.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>   drivers/phy/amlogic/phy-meson-axg-pcie.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-axg-pcie.c b/drivers/phy/amlogic/phy-meson-axg-pcie.c
> index 60be5cdc600b3..54baf7b8930e1 100644
> --- a/drivers/phy/amlogic/phy-meson-axg-pcie.c
> +++ b/drivers/phy/amlogic/phy-meson-axg-pcie.c
> @@ -131,19 +131,15 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
>   	struct phy_axg_pcie_priv *priv;
>   	struct device_node *np = dev->of_node;
>   	void __iomem *base;
> -	int ret;
>   
>   	priv = devm_kmalloc(dev, sizeof(*priv), GFP_KERNEL);
>   	if (!priv)
>   		return -ENOMEM;
>   
>   	priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
> -	if (IS_ERR(priv->phy)) {
> -		ret = PTR_ERR(priv->phy);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "failed to create PHY\n");
> -		return ret;
> -	}
> +	if (IS_ERR(priv->phy))
> +		return dev_err_probe(dev, PTR_ERR(priv->phy),
> +				     "failed to create PHY\n");
>   
>   	base = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(base))

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v1 6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe
  2025-04-10 13:33 ` [PATCH v1 6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe Anand Moon
@ 2025-04-11  8:33   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2025-04-11  8:33 UTC (permalink / raw)
  To: Anand Moon, Vinod Koul, Kishon Vijay Abraham I, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl,
	open list:GENERIC PHY FRAMEWORK,
	moderated list:ARM/Amlogic Meson SoC support,
	open list:ARM/Amlogic Meson SoC support, open list

On 10/04/2025 15:33, Anand Moon wrote:
> Reorder the PHY creation in the axg-pcie probe function to ensure all
> the resource is mapped before creating the PHY. This change addresses
> the issue where the PHY creation was attempted before
> mapping the necessary resources, potentially causing failures.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>   drivers/phy/amlogic/phy-meson-axg-pcie.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-axg-pcie.c b/drivers/phy/amlogic/phy-meson-axg-pcie.c
> index 54baf7b8930e1..14dee73f9cb57 100644
> --- a/drivers/phy/amlogic/phy-meson-axg-pcie.c
> +++ b/drivers/phy/amlogic/phy-meson-axg-pcie.c
> @@ -136,11 +136,6 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
>   	if (!priv)
>   		return -ENOMEM;
>   
> -	priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
> -	if (IS_ERR(priv->phy))
> -		return dev_err_probe(dev, PTR_ERR(priv->phy),
> -				     "failed to create PHY\n");
> -
>   	base = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(base))
>   		return PTR_ERR(base);
> @@ -158,6 +153,11 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
>   	if (IS_ERR(priv->analog))
>   		return PTR_ERR(priv->analog);
>   
> +	priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
> +	if (IS_ERR(priv->phy))
> +		return dev_err_probe(dev, PTR_ERR(priv->phy),
> +				     "failed to create PHY\n");
> +
>   	phy_set_drvdata(priv->phy, priv);
>   	dev_set_drvdata(dev, priv);
>   	pphy = devm_of_phy_provider_register(dev, of_phy_simple_xlate);

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe()
  2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
                   ` (5 preceding siblings ...)
  2025-04-10 13:33 ` [PATCH v1 6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe Anand Moon
@ 2025-04-11 12:11 ` Vinod Koul
  6 siblings, 0 replies; 14+ messages in thread
From: Vinod Koul @ 2025-04-11 12:11 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-phy, linux-arm-kernel,
	linux-amlogic, linux-kernel, Anand Moon


On Thu, 10 Apr 2025 19:03:15 +0530, Anand Moon wrote:
> Use dev_err_probe() for phy resources to indicate the deferral
> reason when waiting for the resource to come up.
> 
> Note: The following patch for RTC:
> 
> phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe
> 
> [...]

Applied, thanks!

[1/6] phy: amlogic: phy-meson-gxl-usb2: Simplify error handling with dev_err_probe()
      commit: 05457917e50c3d6bf75d2e3b99c7e6709a4a6844
[2/6] phy: amlogic: phy-meson-g12a-usb2: Simplify error handling with dev_err_probe()
      commit: 9bff4ef29a6409850c27df705da54277a8e836f2
[3/6] phy: amlogic: phy-meson-axg-mipi-pcie-analog: Simplify error handling with dev_err_probe()
      commit: de39730f9258e9984892c0af68a3e884ad19acea
[4/6] phy: amlogic: phy-meson-axg-mipi-dphy: Simplify error handling with dev_err_probe()
      commit: a77e2e899841937798bff0924c03d4d0e4963aa3
[5/6] phy: amlogic: phy-meson-axg-pcie: Simplify error handling with dev_err_probe()
      commit: fef364bd4c9cf712c91e0013f5f304f4e7f09198
[6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe
      commit: bdeff6d8a211c832f5ce1a65aff17f4a5e6de00f

Best regards,
-- 
~Vinod




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-04-11 12:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10 13:33 [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Anand Moon
2025-04-10 13:33 ` [PATCH v1 1/6] phy: amlogic: phy-meson-gxl-usb2: " Anand Moon
2025-04-11  8:32   ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 2/6] phy: amlogic: phy-meson-g12a-usb2: " Anand Moon
2025-04-11  8:32   ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 3/6] phy: amlogic: phy-meson-axg-mipi-pcie-analog: " Anand Moon
2025-04-11  8:32   ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 4/6] phy: amlogic: phy-meson-axg-mipi-dphy: " Anand Moon
2025-04-11  8:32   ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 5/6] phy: amlogic: phy-meson-axg-pcie: " Anand Moon
2025-04-11  8:32   ` Neil Armstrong
2025-04-10 13:33 ` [PATCH v1 6/6] phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe Anand Moon
2025-04-11  8:33   ` Neil Armstrong
2025-04-11 12:11 ` [PATCH v1 0/6] Messon: Simplify error handling with dev_err_probe() Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).