mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: justinpopo6@gmail.com
To: alcooperx@gmail.com, kishon@ti.com, vkoul@kernel.org,
	f.fainelli@gmail.com, linux-kernel@vger.kernel.org,
	linux-phy@lists.infradead.org
Cc: bcm-kernel-feedback-list@broadcom.com,
	Justin Chen <justinpopo6@gmail.com>
Subject: [PATCH 2/6] phy: usb: s2 WoL wakeup_count not incremented for USB->Eth devices
Date: Wed,  5 Oct 2022 14:30:14 -0700	[thread overview]
Message-ID: <1665005418-15807-3-git-send-email-justinpopo6@gmail.com> (raw)
In-Reply-To: <1665005418-15807-1-git-send-email-justinpopo6@gmail.com>

From: Al Cooper <alcooperx@gmail.com>

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 <alcooperx@gmail.com>
Signed-off-by: Justin Chen <justinpopo6@gmail.com>
---
 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


  parent reply	other threads:[~2022-10-05 21:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 21:30 [PATCH 0/6] Various bug fixes/improvements for phy-brcm-usb driver justinpopo6
2022-10-05 21:30 ` [PATCH 1/6] phy: usb: Improve port mode selection justinpopo6
2022-10-06 22:05   ` Florian Fainelli
2022-10-05 21:30 ` justinpopo6 [this message]
2022-10-06 22:05   ` [PATCH 2/6] phy: usb: s2 WoL wakeup_count not incremented for USB->Eth devices Florian Fainelli
2022-10-05 21:30 ` [PATCH 3/6] phy: usb: Migrate to BIT and BITMASK macros justinpopo6
2022-10-06 22:07   ` Florian Fainelli
2022-10-05 21:30 ` [PATCH 4/6] phy: usb: Disable phy auto-suspend justinpopo6
2022-10-06 22:07   ` Florian Fainelli
2022-10-05 21:30 ` [PATCH 5/6] phy: usb: Use slow clock for wake enabled suspend justinpopo6
2022-10-06 22:07   ` Florian Fainelli
2022-10-05 21:30 ` [PATCH 6/6] phy: usb: Fix clock imbalance for suspend/resume justinpopo6
2022-10-06 22:08   ` Florian Fainelli
2022-11-01 17:40 ` [PATCH 0/6] Various bug fixes/improvements for phy-brcm-usb driver Justin Chen
2022-11-05  7:43 ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1665005418-15807-3-git-send-email-justinpopo6@gmail.com \
    --to=justinpopo6@gmail.com \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®