diff mbox series

[v2,5/7] usb: host: xhci-plat: add wakeup entry at sysfs

Message ID 20200817094440.23202-6-peter.chen@nxp.com (mailing list archive)
State Accepted
Commit 4bb4fc0dbfa23acab9b762949b91ffd52106fe4b
Headers show
Series usb: host: xhci: some changes for xhci-plat.c | expand

Commit Message

Peter Chen Aug. 17, 2020, 9:44 a.m. UTC
With this change, there will be a wakeup entry at /sys/../power/wakeup,
and the user could use this entry to choose whether enable xhci wakeup
features (wake up system from suspend) or not.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mathias Nyman Aug. 21, 2020, 9:37 a.m. UTC | #1
On 17.8.2020 12.44, Peter Chen wrote:
> With this change, there will be a wakeup entry at /sys/../power/wakeup,
> and the user could use this entry to choose whether enable xhci wakeup
> features (wake up system from suspend) or not.
> 
> Signed-off-by: Peter Chen <peter.chen@nxp.com>
> ---
>  drivers/usb/host/xhci-plat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 14ff65a387e8..cfca6fc8947c 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -287,7 +287,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
>  		*priv = *priv_match;
>  	}
>  
> -	device_wakeup_enable(hcd->self.controller);
> +	device_set_wakeup_capable(&pdev->dev, true);

All other patches seem pretty straight forward, but with this one I have to some
more digging.
I saw you had a discussion with Alan about this topic about a month ago, but I'm
not sure if there was any conclusion about this.

-Mathias
Peter Chen Aug. 21, 2020, 9:57 a.m. UTC | #2
> >
> > Signed-off-by: Peter Chen <peter.chen@nxp.com>
> > ---
> >  drivers/usb/host/xhci-plat.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/host/xhci-plat.c
> > b/drivers/usb/host/xhci-plat.c index 14ff65a387e8..cfca6fc8947c 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -287,7 +287,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> >  		*priv = *priv_match;
> >  	}
> >
> > -	device_wakeup_enable(hcd->self.controller);
> > +	device_set_wakeup_capable(&pdev->dev, true);
> 
> All other patches seem pretty straight forward, but with this one I have to some
> more digging.
> I saw you had a discussion with Alan about this topic about a month ago, but I'm
> not sure if there was any conclusion about this.
> 

Alan suggested set power/wakeup as default enabled before, but it will cause the power domain of
this device (and parent) will not be off during the system suspend/resume since the power management
code thinks that the power should not be off if the device needs to respond the wakeup during
the system suspends. We have agreed to set power/wakeup as default disabled.

https://www.spinics.net/lists/linux-usb/msg199316.html

Peter
Mathias Nyman Aug. 21, 2020, 10:35 a.m. UTC | #3
On 21.8.2020 12.57, Peter Chen wrote:
>  
>>>
>>> Signed-off-by: Peter Chen <peter.chen@nxp.com>
>>> ---
>>>  drivers/usb/host/xhci-plat.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/usb/host/xhci-plat.c
>>> b/drivers/usb/host/xhci-plat.c index 14ff65a387e8..cfca6fc8947c 100644
>>> --- a/drivers/usb/host/xhci-plat.c
>>> +++ b/drivers/usb/host/xhci-plat.c
>>> @@ -287,7 +287,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
>>>  		*priv = *priv_match;
>>>  	}
>>>
>>> -	device_wakeup_enable(hcd->self.controller);
>>> +	device_set_wakeup_capable(&pdev->dev, true);
>>
>> All other patches seem pretty straight forward, but with this one I have to some
>> more digging.
>> I saw you had a discussion with Alan about this topic about a month ago, but I'm
>> not sure if there was any conclusion about this.
>>
> 
> Alan suggested set power/wakeup as default enabled before, but it will cause the power domain of
> this device (and parent) will not be off during the system suspend/resume since the power management
> code thinks that the power should not be off if the device needs to respond the wakeup during
> the system suspends. We have agreed to set power/wakeup as default disabled.
> 
> https://www.spinics.net/lists/linux-usb/msg199316.html
> 
> Peter
> 

Ok, thanks, got it.

-Mathias
Matthias Kaehlcke Sept. 17, 2020, 5:49 p.m. UTC | #4
On Mon, Aug 17, 2020 at 05:44:38PM +0800, Peter Chen wrote:
> With this change, there will be a wakeup entry at /sys/../power/wakeup,
> and the user could use this entry to choose whether enable xhci wakeup
> features (wake up system from suspend) or not.
> 
> Signed-off-by: Peter Chen <peter.chen@nxp.com>

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 14ff65a387e8..cfca6fc8947c 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -287,7 +287,7 @@  static int xhci_plat_probe(struct platform_device *pdev)
 		*priv = *priv_match;
 	}
 
-	device_wakeup_enable(hcd->self.controller);
+	device_set_wakeup_capable(&pdev->dev, true);
 
 	xhci->main_hcd = hcd;
 	xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,