Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-06-19 15:12:17 +0200
committerTakashi Iwai <tiwai@suse.de>2019-06-19 15:12:37 +0200
commit6b4f9aab7165ae2480adf18e14fd0d5249a9bc6d (patch)
treed0c896f960c447dcd295ab839b424b2a85cf588f
parente4cee37d493758e35dfe520980ddf9e9e8b98106 (diff)
qmi_wwan: avoid RCU stalls on device disconnect when in QMAP
mode (bsc#1051510).
-rw-r--r--patches.drivers/qmi_wwan-avoid-RCU-stalls-on-device-disconnect-when-.patch76
-rw-r--r--series.conf1
2 files changed, 77 insertions, 0 deletions
diff --git a/patches.drivers/qmi_wwan-avoid-RCU-stalls-on-device-disconnect-when-.patch b/patches.drivers/qmi_wwan-avoid-RCU-stalls-on-device-disconnect-when-.patch
new file mode 100644
index 0000000000..b2c402d76c
--- /dev/null
+++ b/patches.drivers/qmi_wwan-avoid-RCU-stalls-on-device-disconnect-when-.patch
@@ -0,0 +1,76 @@
+From a8fdde1cb830e560208af42b6c10750137f53eb3 Mon Sep 17 00:00:00 2001
+From: Reinhard Speyerer <rspmn@arcor.de>
+Date: Wed, 12 Jun 2019 19:03:15 +0200
+Subject: [PATCH] qmi_wwan: avoid RCU stalls on device disconnect when in QMAP mode
+Git-commit: a8fdde1cb830e560208af42b6c10750137f53eb3
+Patch-mainline: v5.2-rc6
+References: bsc#1051510
+
+Switch qmimux_unregister_device() and qmi_wwan_disconnect() to
+use unregister_netdevice_queue() and unregister_netdevice_many()
+instead of unregister_netdevice(). This avoids RCU stalls which
+have been observed on device disconnect in certain setups otherwise.
+
+Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support")
+Cc: Daniele Palmas <dnlplm@gmail.com>
+Signed-off-by: Reinhard Speyerer <rspmn@arcor.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/net/usb/qmi_wwan.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
+index b0a96459621f..c6fbc2a2a785 100644
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -312,14 +312,15 @@ static int qmimux_register_device(struct net_device *real_dev, u8 mux_id)
+ return err;
+ }
+
+-static void qmimux_unregister_device(struct net_device *dev)
++static void qmimux_unregister_device(struct net_device *dev,
++ struct list_head *head)
+ {
+ struct qmimux_priv *priv = netdev_priv(dev);
+ struct net_device *real_dev = priv->real_dev;
+
+ free_percpu(priv->stats64);
+ netdev_upper_dev_unlink(real_dev, dev);
+- unregister_netdevice(dev);
++ unregister_netdevice_queue(dev, head);
+
+ /* Get rid of the reference to real_dev */
+ dev_put(real_dev);
+@@ -490,7 +491,7 @@ static ssize_t del_mux_store(struct device *d, struct device_attribute *attr, c
+ ret = -EINVAL;
+ goto err;
+ }
+- qmimux_unregister_device(del_dev);
++ qmimux_unregister_device(del_dev, NULL);
+
+ if (!qmimux_has_slaves(dev))
+ info->flags &= ~QMI_WWAN_FLAG_MUX;
+@@ -1500,6 +1501,7 @@ static void qmi_wwan_disconnect(struct usb_interface *intf)
+ struct qmi_wwan_state *info;
+ struct list_head *iter;
+ struct net_device *ldev;
++ LIST_HEAD(list);
+
+ /* called twice if separate control and data intf */
+ if (!dev)
+@@ -1512,8 +1514,9 @@ static void qmi_wwan_disconnect(struct usb_interface *intf)
+ }
+ rcu_read_lock();
+ netdev_for_each_upper_dev_rcu(dev->net, ldev, iter)
+- qmimux_unregister_device(ldev);
++ qmimux_unregister_device(ldev, &list);
+ rcu_read_unlock();
++ unregister_netdevice_many(&list);
+ rtnl_unlock();
+ info->flags &= ~QMI_WWAN_FLAG_MUX;
+ }
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index c69b960488..3885bde217 100644
--- a/series.conf
+++ b/series.conf
@@ -22581,6 +22581,7 @@
patches.fixes/cfg80211-fix-memory-leak-of-wiphy-device-name.patch
patches.drivers/qmi_wwan-add-support-for-QMAP-padding-in-the-RX-path.patch
patches.drivers/qmi_wwan-add-network-device-usage-statistics-for-qmi.patch
+ patches.drivers/qmi_wwan-avoid-RCU-stalls-on-device-disconnect-when-.patch
patches.fixes/tcp-limit-payload-size-of-sacked-skbs.patch
patches.fixes/tcp-tcp_fragment-should-apply-sane-memory-limits.patch
patches.fixes/tcp-add-tcp_min_snd_mss-sysctl.patch