Skip to contentSkip to conversation

usb: host: xhci-plat: add wakeup entry at sysfs

PATCH New Florian Fainelli 2 participants 7 messages Feb 1, 2023 – Feb 3, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: host: xhci-plat: add wakeup entry at sysfs

From: Peter Chen <[email protected]>

commit 4bb4fc0dbfa23acab9b762949b91ffd52106fe4b upstream

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.

---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
index 2a73592908e1..3d20fe9c415f 100644
@@ -252,7 +252,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->clk = clk;
 	xhci->main_hcd = hcd;
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 usb: host: xhci-plat: add wakeup entry at sysfs

From: Peter Chen <[email protected]>

commit 4bb4fc0dbfa23acab9b762949b91ffd52106fe4b upstream

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.

---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
index adc437ca83b8..cb3ba2adae64 100644
@@ -261,7 +261,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->clk = clk;
 	xhci->reg_clk = reg_clk;
Signature · 1 line
2.34.1
#2 lore raw

PATCH 1/1 usb: host: xhci-plat: add wakeup entry at sysfs

In reply to Florian Fainelli

From: Peter Chen <[email protected]>

commit 4bb4fc0dbfa23acab9b762949b91ffd52106fe4b upstream

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.

---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-plat.c +1 -1
index 84cfa8544285..fa320006b04d 100644
@@ -276,7 +276,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,
Signature · 1 line
2.34.1
#3 lore raw
Quoted 15 lines · Florian Fainelli

From: Peter Chen <[email protected]>

commit 4bb4fc0dbfa23acab9b762949b91ffd52106fe4b upstream

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.

Quoted 3 lines
---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Why is this new feature needed on these older kernels? What does it fix that is broken?

And why not just use a newer kernel release if you want to use this feature?

thanks,

greg k-h

#4 lore raw
Quoted 20 lines · Greg Kroah-Hartman
Quoted 15 lines · Florian Fainelli

From: Peter Chen <[email protected]>

commit 4bb4fc0dbfa23acab9b762949b91ffd52106fe4b upstream

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.

Quoted 3 lines
---
  drivers/usb/host/xhci-plat.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 2 lines

Why is this new feature needed on these older kernels? What does it fix that is broken?

It fixes the inability to make the XHCI controller a wake-up device since there is no /sys/*/*xhci/power/wakeup sysfs entry to manipulate unless this patch is applied.

Quoted 3 lines

And why not just use a newer kernel release if you want to use this feature?

Because I maintain multiple version streams so I have always have a way to compare an older with a newer kernel and ensure they all behave properly.

This should have been flagged with a Fixes: tag IMHO in the first place.

Signature · 1 line
Florian
#5 lore raw
Quoted 21 lines · Florian Fainelli
Quoted 20 lines · Greg Kroah-Hartman
Quoted 18 lines · Florian Fainelli

From: Peter Chen <[email protected]>

commit 4bb4fc0dbfa23acab9b762949b91ffd52106fe4b upstream

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.

---
  drivers/usb/host/xhci-plat.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 6 lines
Quoted 2 lines

Why is this new feature needed on these older kernels? What does it fix that is broken?

It fixes the inability to make the XHCI controller a wake-up device since there is no /sys/*/*xhci/power/wakeup sysfs entry to manipulate unless this patch is applied.

But that is a new feature, not a bugfix.

What systems need this for these older kernels that will actually update to them in order to pick up this change?

thanks,

greg k-h

#6 lore raw
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Florian Fainelli
Quoted 20 lines · Greg Kroah-Hartman
Quoted 18 lines · Florian Fainelli

From: Peter Chen <[email protected]>

commit 4bb4fc0dbfa23acab9b762949b91ffd52106fe4b upstream

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.

---
   drivers/usb/host/xhci-plat.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Why is this new feature needed on these older kernels? What does it fix that is broken?

It fixes the inability to make the XHCI controller a wake-up device since there is no /sys/*/*xhci/power/wakeup sysfs entry to manipulate unless this patch is applied.

But that is a new feature, not a bugfix.

Support for wake-up was already there in the xhci driver, just there was no way to activate it from user-space, that seems like a fix to me.

Quoted 3 lines

What systems need this for these older kernels that will actually update to them in order to pick up this change?

Some NXP systems required that, and all of our ARCH_BRCMSTB SoCs also have that capability, I see you applied those patches, thanks!

Signature · 1 line
Florian