diff mbox series

usb_hub: Set DM_FLAG_DEFAULT_PD_CTRL_OFF to usb_hub driver

Message ID 1648458571-127415-1-git-send-email-ye.li@nxp.com
State Deferred
Delegated to: Tom Rini
Headers show
Series usb_hub: Set DM_FLAG_DEFAULT_PD_CTRL_OFF to usb_hub driver | expand

Commit Message

Ye Li March 28, 2022, 9:09 a.m. UTC
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.

Signed-off-by: Ye Li <ye.li@nxp.com>
---
 common/usb_hub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Vasut March 28, 2022, 4:53 p.m. UTC | #1
On 3/28/22 11:09, Ye Li wrote:
> 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.
> 
> Signed-off-by: Ye Li <ye.li@nxp.com>
> ---
>   common/usb_hub.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/usb_hub.c b/common/usb_hub.c
> index ba11a18..990993a 100644
> --- a/common/usb_hub.c
> +++ b/common/usb_hub.c
> @@ -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 ?
diff mbox series

Patch

diff --git a/common/usb_hub.c b/common/usb_hub.c
index ba11a18..990993a 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -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) = {