[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240520134108.net-next.2.Ic039534f7590752a2c403de4ac452e3cb72072f4@changeid>
Date: Mon, 20 May 2024 13:41:12 -0700
From: Douglas Anderson <dianders@...omium.org>
To: "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Hayes Wang <hayeswang@...ltek.com>
Cc: danielgeorgem@...gle.com,
Douglas Anderson <dianders@...omium.org>,
Andrew Lunn <andrew@...n.ch>,
Grant Grundler <grundler@...omium.org>,
Heiner Kallweit <hkallweit1@...il.com>,
linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH net-next 2/2] r8152: Wake up the system if the we need a reset
If we get to the end of the r8152's suspend() routine and we find that
the USB device is INACCESSIBLE then it means that some of our
preparation for suspend didn't take place. We need a USB reset to get
ourselves back in a consistent state so we can try again and that
can't happen during system suspend. Call pm_wakeup_event() to wake the
system up in this case.
Signed-off-by: Douglas Anderson <dianders@...omium.org>
---
drivers/net/usb/r8152.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 6a3f4b2114ee..09fe70bc45d4 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -8647,6 +8647,13 @@ static int rtl8152_system_suspend(struct r8152 *tp)
tasklet_enable(&tp->tx_tl);
}
+ /* If we're inaccessible here then some of the work that we did to
+ * get the adapter ready for suspend didn't work. Queue up a wakeup
+ * event so we can try again.
+ */
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
+ pm_wakeup_event(&tp->udev->dev, 0);
+
return 0;
}
--
2.45.0.rc1.225.g2a3ae87e7f-goog
Powered by blists - more mailing lists