From: Heiner Kallweit <hkallweit1@gmail.com>
To: David Miller <davem@davemloft.net>,
Realtek linux nic maintainers <nic_swsd@realtek.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next 6/8] r8169: reset chip synchronously in __rtl8169_resume
Date: Sat, 19 Jan 2019 21:50:32 +0100 [thread overview]
Message-ID: <7f0baef9-9070-b8a7-e3a2-52faec4eeb54@gmail.com> (raw)
In-Reply-To: <87f4c590-49ff-c3c8-9b64-4cd146e18ac6@gmail.com>
Triggering an asynchronous reset is problematic for the following
reasons, therefore reset the chip synchronously.
- The reset routine resets registers and parameters behind our back
what may collide with code executed after triggering the reset.
- __rtl8169_resume() is called as part of pm_runtime_get_sync() and
callers expect that the chip is fully resumed afterwards.
In context of this driver triggering an asynchronous reset should be
considered an emergency procedure.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/ethernet/realtek/r8169.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 48b5d7051..82042449d 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6787,9 +6787,8 @@ static void __rtl8169_resume(struct net_device *dev)
rtl_lock_work(tp);
napi_enable(&tp->napi);
set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
+ rtl_reset_work(tp);
rtl_unlock_work(tp);
-
- rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
}
static int rtl8169_resume(struct device *device)
--
2.20.1
next prev parent reply other threads:[~2019-01-19 20:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-19 20:46 [PATCH net-next 0/8] r8169: series with smaller improvements Heiner Kallweit
2019-01-19 20:47 ` [PATCH net-next 1/8] r8169: remove rtl_get_events Heiner Kallweit
2019-01-19 20:48 ` [PATCH net-next 2/8] r8169: remove unneeded call in pcierr Heiner Kallweit
2019-01-19 20:48 ` [PATCH net-next 3/8] r8169: initialize task workqueue only once Heiner Kallweit
2019-01-19 20:49 ` [PATCH net-next 4/8] r8169: improve rtl_pcie_state_l2l3_enable Heiner Kallweit
2019-01-21 14:25 ` kbuild test robot
2019-01-19 20:49 ` [PATCH net-next 5/8] r8169: add helpers for locking / unlocking the config registers Heiner Kallweit
2019-01-19 20:50 ` Heiner Kallweit [this message]
2019-01-19 20:51 ` [PATCH net-next 7/8] r8169: replace mii_bus member with phy_device member in struct rtl8169_private Heiner Kallweit
2019-01-19 20:52 ` [PATCH net-next 8/8] r8169: factor out getting ether_clk Heiner Kallweit
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=7f0baef9-9070-b8a7-e3a2-52faec4eeb54@gmail.com \
--to=hkallweit1@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
/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;
as well as URLs for NNTP newsgroup(s).