usb_hub: Set DM_FLAG_DEFAULT_PD_CTRL_OFF to usb_hub driver
PATCH 1/1 usb_hub: Set DM_FLAG_DEFAULT_PD_CTRL_OFF to usb_hub driver
Because usb_hub uses same device tree node with USB controller device, when probe and remove usb_hub, it will call the power domain control of USB controller device.
This is not expected, because power domain control implmentation may not have count when the power domain is dedicated for USB controller. So once removed usb_hub, the power domain is power off before removing USB controller.
--- common/usb_hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/usb_hub.c +1 -1
@@ -950,7 +950,7 @@ U_BOOT_DRIVER(usb_generic_hub) = { .name = "usb_hub", .id = UCLASS_USB_HUB, .of_match = usb_hub_ids, - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_DEFAULT_PD_CTRL_OFF, };UCLASS_DRIVER (usb_hub) = {
Signature · 1 line
2.7.4
Quoted 17 lines · Ye Li
Because
usb_hubuses same device tree node with USB controller device, when probe and removeusb_hub, it will call the power domain control of USB controller device.
This is not expected, because power domain control implmentation may not have count when the power domain is dedicated for USB controller. So once removedusb_hub, the power domain is power off before removing USB controller.Signed-off-by Ye Li <[email protected]>--- common/usb_hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/usb_hub.c +0
-0
common/usb_hub.c U_BOOT_DRIVER(usb_generic_hub) = { · line 954
Quoted 6 lines
common/usb_hub.c +1
-1@@ -950,7 +950,7 @@ U_BOOT_DRIVER(usb_generic_hub) = { .name = "usb_hub", .id = UCLASS_USB_HUB, .of_match = usb_hub_ids, - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_DEFAULT_PD_CTRL_OFF, };
+CC Simon.
Which device does trigger this behavior ?
Do you have a test case you can share ?