The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.14.y
git checkout FETCH_HEAD
git cherry-pick -x 868c3b95afef4883bfb66c9397482da6840b5baf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112430-trowel-thee-5ced@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^..
Possible dependencies:
868c3b95afef ("r8169: fix network lost after resume on DASH systems")
f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is enabled")
7257c977c811 ("r8169: clean up rtl_pll_power_down/up functions")
128735a1530e ("r8169: improve handling D3 PLL power-down")
9224d97183d9 ("r8169: enable PLL power-down for chip versions 34, 35, 36, 42")
acb58657c869 ("r8169: improve RTL8168g PHY suspend quirk")
e80bd76fbf56 ("r8169: work around power-saving bug on some chip versions")
bb13a800620c ("r8169: fix handling ether_clk")
0439297be951 ("r8169: add support for RTL8125B")
4640338c36af ("r8169: rename RTL8125 to RTL8125A")
288302dab34e ("r8169: improve rtl8169_runtime_resume")
06a14ab852fb ("r8169: remove driver-specific mutex")
abe5fc42f9ce ("r8169: use RTNL to protect critical sections")
567ca57faa62 ("r8169: add rtl8169_up")
ec2f204bddb5 ("r8169: remove no longer needed checks for device being runtime-active")
476c4f5de368 ("r8169: mark device as not present when in PCI D3")
9f0b54cd1672 ("r8169: move switching optional clock on/off to pll power functions")
a2ee847242b3 ("r8169: move updating counters to rtl8169_down")
0c28a63a47bf ("r8169: move napi_disable call and rename rtl8169_hw_reset")
e9882208ae98 ("r8169: improve setting WoL on runtime-resume")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 868c3b95afef4883bfb66c9397482da6840b5baf Mon Sep 17 00:00:00 2001
From: ChunHao Lin <hau(a)realtek.com>
Date: Fri, 10 Nov 2023 01:34:00 +0800
Subject: [PATCH] r8169: fix network lost after resume on DASH systems
Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.
Fixes: b646d90053f8 ("r8169: magic.")
Cc: stable(a)vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: ChunHao Lin <hau(a)realtek.com>
Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index cfcb40d90920..b9bb1d2f0237 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4661,10 +4661,16 @@ static void rtl8169_down(struct rtl8169_private *tp)
rtl8169_cleanup(tp);
rtl_disable_exit_l1(tp);
rtl_prepare_power_down(tp);
+
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_stop(tp);
}
static void rtl8169_up(struct rtl8169_private *tp)
{
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_start(tp);
+
pci_set_master(tp->pci_dev);
phy_init_hw(tp->phydev);
phy_resume(tp->phydev);
The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 868c3b95afef4883bfb66c9397482da6840b5baf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112429-echo-designer-9fef@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..
Possible dependencies:
868c3b95afef ("r8169: fix network lost after resume on DASH systems")
f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is enabled")
7257c977c811 ("r8169: clean up rtl_pll_power_down/up functions")
128735a1530e ("r8169: improve handling D3 PLL power-down")
9224d97183d9 ("r8169: enable PLL power-down for chip versions 34, 35, 36, 42")
acb58657c869 ("r8169: improve RTL8168g PHY suspend quirk")
e80bd76fbf56 ("r8169: work around power-saving bug on some chip versions")
bb13a800620c ("r8169: fix handling ether_clk")
0439297be951 ("r8169: add support for RTL8125B")
4640338c36af ("r8169: rename RTL8125 to RTL8125A")
288302dab34e ("r8169: improve rtl8169_runtime_resume")
06a14ab852fb ("r8169: remove driver-specific mutex")
abe5fc42f9ce ("r8169: use RTNL to protect critical sections")
567ca57faa62 ("r8169: add rtl8169_up")
ec2f204bddb5 ("r8169: remove no longer needed checks for device being runtime-active")
476c4f5de368 ("r8169: mark device as not present when in PCI D3")
9f0b54cd1672 ("r8169: move switching optional clock on/off to pll power functions")
a2ee847242b3 ("r8169: move updating counters to rtl8169_down")
0c28a63a47bf ("r8169: move napi_disable call and rename rtl8169_hw_reset")
e9882208ae98 ("r8169: improve setting WoL on runtime-resume")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 868c3b95afef4883bfb66c9397482da6840b5baf Mon Sep 17 00:00:00 2001
From: ChunHao Lin <hau(a)realtek.com>
Date: Fri, 10 Nov 2023 01:34:00 +0800
Subject: [PATCH] r8169: fix network lost after resume on DASH systems
Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.
Fixes: b646d90053f8 ("r8169: magic.")
Cc: stable(a)vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: ChunHao Lin <hau(a)realtek.com>
Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index cfcb40d90920..b9bb1d2f0237 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4661,10 +4661,16 @@ static void rtl8169_down(struct rtl8169_private *tp)
rtl8169_cleanup(tp);
rtl_disable_exit_l1(tp);
rtl_prepare_power_down(tp);
+
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_stop(tp);
}
static void rtl8169_up(struct rtl8169_private *tp)
{
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_start(tp);
+
pci_set_master(tp->pci_dev);
phy_init_hw(tp->phydev);
phy_resume(tp->phydev);
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x 868c3b95afef4883bfb66c9397482da6840b5baf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112428-seclusion-running-5a62@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
868c3b95afef ("r8169: fix network lost after resume on DASH systems")
f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is enabled")
7257c977c811 ("r8169: clean up rtl_pll_power_down/up functions")
128735a1530e ("r8169: improve handling D3 PLL power-down")
9224d97183d9 ("r8169: enable PLL power-down for chip versions 34, 35, 36, 42")
acb58657c869 ("r8169: improve RTL8168g PHY suspend quirk")
e80bd76fbf56 ("r8169: work around power-saving bug on some chip versions")
bb13a800620c ("r8169: fix handling ether_clk")
0439297be951 ("r8169: add support for RTL8125B")
4640338c36af ("r8169: rename RTL8125 to RTL8125A")
288302dab34e ("r8169: improve rtl8169_runtime_resume")
06a14ab852fb ("r8169: remove driver-specific mutex")
abe5fc42f9ce ("r8169: use RTNL to protect critical sections")
567ca57faa62 ("r8169: add rtl8169_up")
ec2f204bddb5 ("r8169: remove no longer needed checks for device being runtime-active")
476c4f5de368 ("r8169: mark device as not present when in PCI D3")
9f0b54cd1672 ("r8169: move switching optional clock on/off to pll power functions")
a2ee847242b3 ("r8169: move updating counters to rtl8169_down")
0c28a63a47bf ("r8169: move napi_disable call and rename rtl8169_hw_reset")
e9882208ae98 ("r8169: improve setting WoL on runtime-resume")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 868c3b95afef4883bfb66c9397482da6840b5baf Mon Sep 17 00:00:00 2001
From: ChunHao Lin <hau(a)realtek.com>
Date: Fri, 10 Nov 2023 01:34:00 +0800
Subject: [PATCH] r8169: fix network lost after resume on DASH systems
Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.
Fixes: b646d90053f8 ("r8169: magic.")
Cc: stable(a)vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: ChunHao Lin <hau(a)realtek.com>
Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index cfcb40d90920..b9bb1d2f0237 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4661,10 +4661,16 @@ static void rtl8169_down(struct rtl8169_private *tp)
rtl8169_cleanup(tp);
rtl_disable_exit_l1(tp);
rtl_prepare_power_down(tp);
+
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_stop(tp);
}
static void rtl8169_up(struct rtl8169_private *tp)
{
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_start(tp);
+
pci_set_master(tp->pci_dev);
phy_init_hw(tp->phydev);
phy_resume(tp->phydev);
The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 868c3b95afef4883bfb66c9397482da6840b5baf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112427-rubbing-storage-3833@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
868c3b95afef ("r8169: fix network lost after resume on DASH systems")
f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is enabled")
7257c977c811 ("r8169: clean up rtl_pll_power_down/up functions")
128735a1530e ("r8169: improve handling D3 PLL power-down")
9224d97183d9 ("r8169: enable PLL power-down for chip versions 34, 35, 36, 42")
acb58657c869 ("r8169: improve RTL8168g PHY suspend quirk")
e80bd76fbf56 ("r8169: work around power-saving bug on some chip versions")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 868c3b95afef4883bfb66c9397482da6840b5baf Mon Sep 17 00:00:00 2001
From: ChunHao Lin <hau(a)realtek.com>
Date: Fri, 10 Nov 2023 01:34:00 +0800
Subject: [PATCH] r8169: fix network lost after resume on DASH systems
Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.
Fixes: b646d90053f8 ("r8169: magic.")
Cc: stable(a)vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: ChunHao Lin <hau(a)realtek.com>
Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index cfcb40d90920..b9bb1d2f0237 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4661,10 +4661,16 @@ static void rtl8169_down(struct rtl8169_private *tp)
rtl8169_cleanup(tp);
rtl_disable_exit_l1(tp);
rtl_prepare_power_down(tp);
+
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_stop(tp);
}
static void rtl8169_up(struct rtl8169_private *tp)
{
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_start(tp);
+
pci_set_master(tp->pci_dev);
phy_init_hw(tp->phydev);
phy_resume(tp->phydev);
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 7cefbe5e1dacc7236caa77e9d072423f21422fe2
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112420-stillness-tanned-cbca@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
7cefbe5e1dac ("selftests: mptcp: fix fastclose with csum failure")
595ef566a2ef ("selftests: mptcp: drop addr_nr_ns1/2 parameters")
0c93af1f8907 ("selftests: mptcp: drop test_linkfail parameter")
be7e9786c915 ("selftests: mptcp: set FAILING_LINKS in run_tests")
4369c198e599 ("selftests: mptcp: test userspace pm out of transfer")
ae947bb2c253 ("selftests: mptcp: join: skip Fastclose tests if not supported")
d4c81bbb8600 ("selftests: mptcp: join: support local endpoint being tracked or not")
4a0b866a3f7d ("selftests: mptcp: join: skip test if iptables/tc cmds fail")
0c4cd3f86a40 ("selftests: mptcp: join: use 'iptables-legacy' if available")
6c160b636c91 ("selftests: mptcp: update userspace pm subflow tests")
48d73f609dcc ("selftests: mptcp: update userspace pm addr tests")
8697a258ae24 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7cefbe5e1dacc7236caa77e9d072423f21422fe2 Mon Sep 17 00:00:00 2001
From: Paolo Abeni <pabeni(a)redhat.com>
Date: Tue, 14 Nov 2023 00:16:17 +0100
Subject: [PATCH] selftests: mptcp: fix fastclose with csum failure
Running the mp_join selftest manually with the following command line:
./mptcp_join.sh -z -C
leads to some failures:
002 fastclose server test
# ...
rtx [fail] got 1 MP_RST[s] TX expected 0
# ...
rstrx [fail] got 1 MP_RST[s] RX expected 0
The problem is really in the wrong expectations for the RST checks
implied by the csum validation. Note that the same check is repeated
explicitly in the same test-case, with the correct expectation and
pass successfully.
Address the issue explicitly setting the correct expectation for
the failing checks.
Reported-by: Xiumei Mu <xmu(a)redhat.com>
Fixes: 6bf41020b72b ("selftests: mptcp: update and extend fastclose test-cases")
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
Reviewed-by: Matthieu Baerts <matttbe(a)kernel.org>
Signed-off-by: Matthieu Baerts <matttbe(a)kernel.org>
Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6…
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 75a2438efdf3..3c94f2f194d6 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3240,7 +3240,7 @@ fastclose_tests()
if reset_check_counter "fastclose server test" "MPTcpExtMPFastcloseRx"; then
test_linkfail=1024 fastclose=server \
run_tests $ns1 $ns2 10.0.1.1
- chk_join_nr 0 0 0
+ chk_join_nr 0 0 0 0 0 0 1
chk_fclose_nr 1 1 invert
chk_rst_nr 1 1
fi
Hello.
Since v6.6.2 kernel release I'm experiencing a regression with regard to USB ports behaviour after a suspend/resume cycle.
If a USB port is empty before suspending, after resuming the machine the port doesn't work. After a device insertion there's no reaction in the kernel log whatsoever, although I do see that the device gets powered up physically. If the machine is suspended with a device inserted into the USB port, the port works fine after resume.
This is an AMD-based machine with hci version 0x110 reported. As per the changelog between v6.6.1 and v6.6.2, 603 commits were backported into v6.6.2, and one of the commits was as follows:
$ git log --oneline v6.6.1..v6.6.2 -- drivers/usb/host/xhci-pci.c
14a51fa544225 xhci: Loosen RPM as default policy to cover for AMD xHC 1.1
It seems that this commit explicitly enables runtime PM specifically for my platform. As per dmesg:
v6.6.1: quirks 0x0000000000000410
v6.6.2: quirks 0x0000000200000410
Here, bit 33 gets set, which, as expected, corresponds to:
drivers/usb/host/xhci.h
1895:#define XHCI_DEFAULT_PM_RUNTIME_ALLOW BIT_ULL(33)
This commit is backported from the upstream commit 4baf12181509, which is one of 16 commits of the following series named "xhci features":
https://lore.kernel.org/all/20231019102924.2797346-1-mathias.nyman@linux.in…
It appears that there was another commit in this series, also from Basavaraj (in Cc), a5d6264b638e, which was not picked for v6.6.2, but which stated the following:
Use the low-power states of the underlying platform to enable runtime PM.
If the platform doesn't support runtime D3, then enabling default RPM will
result in the controller malfunctioning, as in the case of hotplug devices
not being detected because of a failed interrupt generation.
It felt like this was exactly my case. So, I've conducted two tests:
1. Reverted 14a51fa544225 from v6.6.2. With this revert the USB ports started to work fine, just as they did in v6.6.1.
2. Left 14a51fa544225 in place, but also applied upstream a5d6264b638e on top of v6.6.2. With this patch added the USB ports also work after a suspend/resume cycle.
This runtime PM enablement did also impact my AX200 Bluetooth device, resulting in long delays before headphones/speaker can connect, but I've solved this with btusb.enable_autosuspend=N. I think this has nothing to do with the original issue, and I'm OK with this workaround unless someone has got a different idea.
With that, please consider either reverting 14a51fa544225 from the stable kernel, or applying a5d6264b638e in addition to it. Given the mainline kernel has got both of them, I'm in favour of applying additional commit to the stable kernel.
I'm also Cc'ing all the people from our Mastodon discussion where I initially complained about the issue as well as about stable kernel branch stability:
https://activitypub.natalenko.name/@oleksandr/statuses/01HFRXBYWMXF9G4KYPE3…
I'm not going to expand more on that in this email, especially given Greg indicated he read the conversation, but I'm open to continuing this discussion as I still think that current workflow brings visible issues to ordinary users, and hence some adjustments should be made.
Thank you.
--
Oleksandr Natalenko (post-factum)