Skip to contentSkip to conversation

Revert "dm: core: device: switch off power domain after device removal"

PATCH New Neil Armstrong 2 participants 5 messages Feb 17, 2020 – Mar 2, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "dm: core: device: switch off power domain after device removal"

This commit breaks Linux boot on Amlogic libretech-cc, libretech-ac, sei510, sei610 board by automatically disabling the power domain after device removal. This because the power domain associated to the video driver must be kept enabled for linux to boot.

The only way is to use the introduced flag DM_FLAG_DEFAULT_PD_CTRL_OFF, which removes automatic handling of power domain.
This flag is not a complete solution since it will force reverting to manually enable the power domain from the driver probe.

Instead a flag to keep the power domain enabled after removal should be introduced.

In the meantime revert this commit until a proper solution is found.

This reverts commit 52edfed65de967a86983a55c51ba0727090efc43.

---
Hi Simon, Tom,

This revert is the simplest fix to make the boards boot again on v2020.04, the goal is to make this behavior happen again with a proper flag to keep the power domain enabled on specific drivers.

I can push it on my next PR on my branch, is it ok ?

Neil

 drivers/core/device-remove.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/core/device-remove.c +0 -5
index 444e34b492..5540053d3c 100644
@@ -16,7 +16,6 @@
 #include <dm/uclass.h>
 #include <dm/uclass-internal.h>
 #include <dm/util.h>
-#include <power-domain.h>
 
 int device_chld_unbind(struct udevice *dev, struct driver *drv)
 {
@@ -194,10 +193,6 @@ int device_remove(struct udevice *dev, uint flags)
 		}
 	}
 
-	if (!(drv->flags & DM_FLAG_DEFAULT_PD_CTRL_OFF) &&
-	    (dev != gd->cur_serial_dev))
-		dev_power_domain_off(dev);
-
 	if (flags_remove(flags, drv->flags)) {
 		device_free(dev);
 
Signature · 1 line
2.22.0
#1 lore raw

PATCH 1/1 Revert "dm: core: device: switch off power domain after device removal"

Quoted 18 lines · On Mon, 17 Feb 2020 10:10:36 +0100 Neil Armstrong narmstrong at baylibre.com…

This commit breaks Linux boot on Amlogic libretech-cc, libretech-ac, sei510, sei610 board by automatically disabling the power domain after device removal. This because the power domain associated to the video driver must be kept enabled for linux to boot.

The only way is to use the introduced flag DM_FLAG_DEFAULT_PD_CTRL_OFF, which removes automatic handling of power domain.
This flag is not a complete solution since it will force reverting to manually enable the power domain from the driver probe.

Instead a flag to keep the power domain enabled after removal should be introduced.

In the meantime revert this commit until a proper solution is found.

This reverts commit 52edfed65de967a86983a55c51ba0727090efc43.

Quoted 8 lines

---
Hi Simon, Tom,

This revert is the simplest fix to make the boards boot again on v2020.04, the goal is to make this behavior happen again with a proper flag to keep the power domain enabled on specific drivers.

I can push it on my next PR on my branch, is it ok ?

Please test if these two patches fix the problem:
http://patchwork.ozlabs.org/patch/1239143
http://patchwork.ozlabs.org/patch/1239144

--
Anatolij

#2 lore raw

PATCH 1/1 Revert "dm: core: device: switch off power domain after device removal"

Hi Anatolij,

Quoted 24 lines · Anatolij Gustschin
Quoted 21 lines · On Mon, 17 Feb 2020 10:10:36 +0100 Neil Armstrong narmstrong at baylibre.com…

This commit breaks Linux boot on Amlogic libretech-cc, libretech-ac, sei510, sei610 board by automatically disabling the power domain after device removal. This because the power domain associated to the video driver must be kept enabled for linux to boot.

The only way is to use the introduced flag DM_FLAG_DEFAULT_PD_CTRL_OFF, which removes automatic handling of power domain.
This flag is not a complete solution since it will force reverting to manually enable the power domain from the driver probe.

Instead a flag to keep the power domain enabled after removal should be introduced.

In the meantime revert this commit until a proper solution is found.

This reverts commit 52edfed65de967a86983a55c51ba0727090efc43.

---
Hi Simon, Tom,

Quoted 6 lines
Quoted 5 lines

This revert is the simplest fix to make the boards boot again on v2020.04, the goal is to make this behavior happen again with a proper flag to keep the power domain enabled on specific drivers.

I can push it on my next PR on my branch, is it ok ?

Thanks for pushing these, they should do the trick.

Let me test them and ack them.

Neil

Quoted 7 lines

Please test if these two patches fix the problem:
http://patchwork.ozlabs.org/patch/1239143
http://patchwork.ozlabs.org/patch/1239144

--
Anatolij

#3 lore raw

PATCH 1/1 Revert "dm: core: device: switch off power domain after device removal"

In reply to Anatolij Gustschin

Hi Analolij,

Quoted 28 lines · Anatolij Gustschin
Quoted 25 lines · On Mon, 17 Feb 2020 10:10:36 +0100 Neil Armstrong narmstrong at baylibre.com…

This commit breaks Linux boot on Amlogic libretech-cc, libretech-ac, sei510, sei610 board by automatically disabling the power domain after device removal. This because the power domain associated to the video driver must be kept enabled for linux to boot.

The only way is to use the introduced flag DM_FLAG_DEFAULT_PD_CTRL_OFF, which removes automatic handling of power domain.
This flag is not a complete solution since it will force reverting to manually enable the power domain from the driver probe.

Instead a flag to keep the power domain enabled after removal should be introduced.

In the meantime revert this commit until a proper solution is found.

This reverts commit 52edfed65de967a86983a55c51ba0727090efc43.

---
Hi Simon, Tom,

This revert is the simplest fix to make the boards boot again on v2020.04, the goal is to make this behavior happen again with a proper flag to keep the power domain enabled on specific drivers.

Quoted 5 lines
Quoted 1 line

I can push it on my next PR on my branch, is it ok ?

Please test if these two patches fix the problem:
http://patchwork.ozlabs.org/patch/1239143
http://patchwork.ozlabs.org/patch/1239144

Should I apply these through my tree or you plan to push these yourself ?

Thanks,
Neil

Quoted 4 lines

--
Anatolij

#4 lore raw

PATCH 1/1 Revert "dm: core: device: switch off power domain after device removal"

Hi Neil,

Quoted 31 lines · On Mon, 2 Mar 2020 10:30:31 +0100 Neil Armstrong narmstrong at baylibre.com…

Hi Analolij,

Quoted 28 lines · Anatolij Gustschin
Quoted 25 lines · On Mon, 17 Feb 2020 10:10:36 +0100 Neil Armstrong narmstrong at baylibre.com…

This commit breaks Linux boot on Amlogic libretech-cc, libretech-ac, sei510, sei610 board by automatically disabling the power domain after device removal. This because the power domain associated to the video driver must be kept enabled for linux to boot.

The only way is to use the introduced flag DM_FLAG_DEFAULT_PD_CTRL_OFF, which removes automatic handling of power domain.
This flag is not a complete solution since it will force reverting to manually enable the power domain from the driver probe.

Instead a flag to keep the power domain enabled after removal should be introduced.

In the meantime revert this commit until a proper solution is found.

This reverts commit 52edfed65de967a86983a55c51ba0727090efc43.

---
Hi Simon, Tom,

This revert is the simplest fix to make the boards boot again on v2020.04, the goal is to make this behavior happen again with a proper flag to keep the power domain enabled on specific drivers.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

I can push it on my next PR on my branch, is it ok ?

Please test if these two patches fix the problem:
http://patchwork.ozlabs.org/patch/1239143
http://patchwork.ozlabs.org/patch/1239144

Should I apply these through my tree or you plan to push these yourself ?

These patches are assigned to Simon in patchwork, and are in his tree under build-testing I think.

--
Anatolij