Skip to contentSkip to conversation

ARM: imx6: gpc: don't register power domain if DT data is missing

PATCH New Lucas Stach 2 participants 2 messages May 27, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx6: gpc: don't register power domain if DT data is missing

If the devicetree is too old and does not provide the regulator and clocks for the power domain, we need to avoid registering the power domain. Otherwise runtime PM will try to control the domain, which will lead to machine hangs without the proper DT configuration data.

This restores functionality to the kernel 4.0 level if an old DT is detected, where the power domain is constantly powered on.

---
 arch/arm/mach-imx/gpc.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/gpc.c +4 -0
index bbf015056221..6d0893a3828e 100644
@@ -449,6 +449,10 @@ static int imx_gpc_probe(struct platform_device *pdev)
 	struct regulator *pu_reg;
 	int ret;
 
+	/* bail out if DT too old and doesn't provide the necessary info */
+	if (!of_property_read_bool(pdev->dev.of_node, "#power-domain-cells"))
+		return 0;
+
 	pu_reg = devm_regulator_get_optional(&pdev->dev, "pu");
 	if (PTR_ERR(pu_reg) == -ENODEV)
 		pu_reg = NULL;
Signature · 1 line
2.1.4
Applied
#1 lore raw

PATCH 1/1 ARM: imx6: gpc: don't register power domain if DT data is missing

Quoted 9 lines · Lucas Stach

If the devicetree is too old and does not provide the regulator and clocks for the power domain, we need to avoid registering the power domain. Otherwise runtime PM will try to control the domain, which will lead to machine hangs without the proper DT configuration data.

This restores functionality to the kernel 4.0 level if an old DT is detected, where the power domain is constantly powered on.

Applied, thanks.

Quoted 22 lines
---
 arch/arm/mach-imx/gpc.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/gpc.c +4 -0
index bbf015056221..6d0893a3828e 100644
@@ -449,6 +449,10 @@ static int imx_gpc_probe(struct platform_device *pdev)
 	struct regulator *pu_reg;
 	int ret;
 
+	/* bail out if DT too old and doesn't provide the necessary info */
+	if (!of_property_read_bool(pdev->dev.of_node, "#power-domain-cells"))
+		return 0;
+
 	pu_reg = devm_regulator_get_optional(&pdev->dev, "pu");
 	if (PTR_ERR(pu_reg) == -ENODEV)
 		pu_reg = NULL;
Signature · 1 line
2.1.4