Allow autosuspend to be used by xhci plat device. For Qualcomm SoCs,
when in host mode, it is intended that the controller goes to suspend
state to save power and wait for interrupts from connected peripheral
to wake it up. This is particularly used in cases where a HID or Audio
device is connected. In such scenarios, the usb controller can enter
auto suspend and resume action after getting interrupts from the
connected device.
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
drivers/usb/host/xhci-plat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 5eb51797de32..dd57ffedcaa2 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -171,6 +171,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
return ret;
pm_runtime_set_active(&pdev->dev);
+ pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_enable(&pdev->dev);
pm_runtime_get_noresume(&pdev->dev);
--
2.34.1
On 8/12/2025 11:25 AM, Krishna Kurapati wrote: > Allow autosuspend to be used by xhci plat device. For Qualcomm SoCs, > when in host mode, it is intended that the controller goes to suspend > state to save power and wait for interrupts from connected peripheral > to wake it up. This is particularly used in cases where a HID or Audio > device is connected. In such scenarios, the usb controller can enter > auto suspend and resume action after getting interrupts from the > connected device. > > Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> > --- > drivers/usb/host/xhci-plat.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > index 5eb51797de32..dd57ffedcaa2 100644 > --- a/drivers/usb/host/xhci-plat.c > +++ b/drivers/usb/host/xhci-plat.c > @@ -171,6 +171,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s > return ret; > > pm_runtime_set_active(&pdev->dev); > + pm_runtime_use_autosuspend(&pdev->dev); > pm_runtime_enable(&pdev->dev); > pm_runtime_get_noresume(&pdev->dev); > Hi Mathias, Can you help provide your review on this patch. Regards, Krishna,
On Mon, Aug 25, 2025 at 11:10 AM Krishna Kurapati PSSNV <krishna.kurapati@oss.qualcomm.com> wrote: > > > > On 8/12/2025 11:25 AM, Krishna Kurapati wrote: > > Allow autosuspend to be used by xhci plat device. For Qualcomm SoCs, > > when in host mode, it is intended that the controller goes to suspend > > state to save power and wait for interrupts from connected peripheral > > to wake it up. This is particularly used in cases where a HID or Audio > > device is connected. In such scenarios, the usb controller can enter > > auto suspend and resume action after getting interrupts from the > > connected device. > > > > Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> > > --- > > drivers/usb/host/xhci-plat.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > > index 5eb51797de32..dd57ffedcaa2 100644 > > --- a/drivers/usb/host/xhci-plat.c > > +++ b/drivers/usb/host/xhci-plat.c > > @@ -171,6 +171,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s > > return ret; > > > > pm_runtime_set_active(&pdev->dev); > > + pm_runtime_use_autosuspend(&pdev->dev); > > pm_runtime_enable(&pdev->dev); > > pm_runtime_get_noresume(&pdev->dev); > > > > Hi Mathias, > > Can you help provide your review on this patch. > Hi Krishna, I think the email added for Mathias isn't correct. Adding the correct one. Thanks, -Udipto
On Tue, Aug 12, 2025 at 1:58 PM Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> wrote: > > Allow autosuspend to be used by xhci plat device. For Qualcomm SoCs, > when in host mode, it is intended that the controller goes to suspend > state to save power and wait for interrupts from connected peripheral > to wake it up. This is particularly used in cases where a HID or Audio > device is connected. In such scenarios, the usb controller can enter > auto suspend and resume action after getting interrupts from the > connected device. > > Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> > --- > drivers/usb/host/xhci-plat.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > index 5eb51797de32..dd57ffedcaa2 100644 > --- a/drivers/usb/host/xhci-plat.c > +++ b/drivers/usb/host/xhci-plat.c > @@ -171,6 +171,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s > return ret; > > pm_runtime_set_active(&pdev->dev); > + pm_runtime_use_autosuspend(&pdev->dev); > pm_runtime_enable(&pdev->dev); > pm_runtime_get_noresume(&pdev->dev); > There is an xhci quirk XHCI_DEFAULT_PM_RUNTIME_ALLOW for it, try to use it. Peter
On 8/13/2025 11:46 AM, Peter Chen wrote: > On Tue, Aug 12, 2025 at 1:58 PM Krishna Kurapati > <krishna.kurapati@oss.qualcomm.com> wrote: >> >> Allow autosuspend to be used by xhci plat device. For Qualcomm SoCs, >> when in host mode, it is intended that the controller goes to suspend >> state to save power and wait for interrupts from connected peripheral >> to wake it up. This is particularly used in cases where a HID or Audio >> device is connected. In such scenarios, the usb controller can enter >> auto suspend and resume action after getting interrupts from the >> connected device. >> >> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> >> --- >> drivers/usb/host/xhci-plat.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c >> index 5eb51797de32..dd57ffedcaa2 100644 >> --- a/drivers/usb/host/xhci-plat.c >> +++ b/drivers/usb/host/xhci-plat.c >> @@ -171,6 +171,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s >> return ret; >> >> pm_runtime_set_active(&pdev->dev); >> + pm_runtime_use_autosuspend(&pdev->dev); >> pm_runtime_enable(&pdev->dev); >> pm_runtime_get_noresume(&pdev->dev); >> > > There is an xhci quirk XHCI_DEFAULT_PM_RUNTIME_ALLOW for it, try to use it. > Hi Peter, I see it being used only in xhci-pci.c. In xhci-plat, I intended to only allow usage of autosuspend and let userspace decide whether to use it or not (echo (auto or on) > control). Hence I only did use_autosuspend() instead of doing runtime_allow. Regards, Krishna,
© 2016 - 2025 Red Hat, Inc.