2022-10-05 21:44:01

by Justin Chen

[permalink] [raw]
Subject: [PATCH 2/6] phy: usb: s2 WoL wakeup_count not incremented for USB->Eth devices

From: Al Cooper <[email protected]>

The PHY's "wakeup_count" is not incrementing when waking from
WoL. The wakeup count can be found in sysfs at:
/sys/bus/platform/devices/rdb/*.usb-phy/power/wakeup_count.
The problem is that the system wakup event handler was being passed
the wrong "device" by the PHY driver.

Fixes: f1c0db40a3ad ("usb: Add "wake on" functionality")
Signed-off-by: Al Cooper <[email protected]>
Signed-off-by: Justin Chen <[email protected]>
---
drivers/phy/broadcom/phy-brcm-usb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/broadcom/phy-brcm-usb.c b/drivers/phy/broadcom/phy-brcm-usb.c
index 99d4dea..d97fa58 100644
--- a/drivers/phy/broadcom/phy-brcm-usb.c
+++ b/drivers/phy/broadcom/phy-brcm-usb.c
@@ -102,9 +102,9 @@ static int brcm_pm_notifier(struct notifier_block *notifier,

static irqreturn_t brcm_usb_phy_wake_isr(int irq, void *dev_id)
{
- struct phy *gphy = dev_id;
+ struct device *dev = dev_id;

- pm_wakeup_event(&gphy->dev, 0);
+ pm_wakeup_event(dev, 0);

return IRQ_HANDLED;
}
@@ -452,7 +452,7 @@ static int brcm_usb_phy_dvr_init(struct platform_device *pdev,
if (priv->wake_irq >= 0) {
err = devm_request_irq(dev, priv->wake_irq,
brcm_usb_phy_wake_isr, 0,
- dev_name(dev), gphy);
+ dev_name(dev), dev);
if (err < 0)
return err;
device_set_wakeup_capable(dev, 1);
--
2.7.4


2022-10-06 22:34:24

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 2/6] phy: usb: s2 WoL wakeup_count not incremented for USB->Eth devices



On 10/5/2022 2:30 PM, [email protected] wrote:
> From: Al Cooper <[email protected]>
>
> The PHY's "wakeup_count" is not incrementing when waking from
> WoL. The wakeup count can be found in sysfs at:
> /sys/bus/platform/devices/rdb/*.usb-phy/power/wakeup_count.
> The problem is that the system wakup event handler was being passed
> the wrong "device" by the PHY driver.
>
> Fixes: f1c0db40a3ad ("usb: Add "wake on" functionality")
> Signed-off-by: Al Cooper <[email protected]>
> Signed-off-by: Justin Chen <[email protected]>

Acked-by: Florian Fainelli <[email protected]>
--
Florian


Attachments:
smime.p7s (4.12 kB)
S/MIME Cryptographic Signature