From: Greg Kroah-Hartman Date: Fri, 12 Mar 2021 13:03:55 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.4.262~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66096a260ad3f95dad35eb15def65b77c9b71580;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: net-davicom-fix-regulator-not-turned-off-on-driver-removal.patch net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch net-lapbether-remove-netif_start_queue-netif_stop_queue.patch net-sched-avoid-duplicates-in-classes-dump.patch --- diff --git a/queue-4.9/net-davicom-fix-regulator-not-turned-off-on-driver-removal.patch b/queue-4.9/net-davicom-fix-regulator-not-turned-off-on-driver-removal.patch new file mode 100644 index 00000000000..564b2b6bed7 --- /dev/null +++ b/queue-4.9/net-davicom-fix-regulator-not-turned-off-on-driver-removal.patch @@ -0,0 +1,54 @@ +From cf9e60aa69ae6c40d3e3e4c94dd6c8de31674e9b Mon Sep 17 00:00:00 2001 +From: Paul Cercueil +Date: Sun, 7 Mar 2021 13:17:48 +0000 +Subject: net: davicom: Fix regulator not turned off on driver removal + +From: Paul Cercueil + +commit cf9e60aa69ae6c40d3e3e4c94dd6c8de31674e9b upstream. + +We must disable the regulator that was enabled in the probe function. + +Fixes: 7994fe55a4a2 ("dm9000: Add regulator and reset support to dm9000") +Signed-off-by: Paul Cercueil +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/davicom/dm9000.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/davicom/dm9000.c ++++ b/drivers/net/ethernet/davicom/dm9000.c +@@ -143,6 +143,8 @@ struct board_info { + u32 wake_state; + + int ip_summed; ++ ++ struct regulator *power_supply; + }; + + /* debug code */ +@@ -1491,6 +1493,8 @@ dm9000_probe(struct platform_device *pde + + db->dev = &pdev->dev; + db->ndev = ndev; ++ if (!IS_ERR(power)) ++ db->power_supply = power; + + spin_lock_init(&db->lock); + mutex_init(&db->addr_lock); +@@ -1780,10 +1784,13 @@ static int + dm9000_drv_remove(struct platform_device *pdev) + { + struct net_device *ndev = platform_get_drvdata(pdev); ++ struct board_info *dm = to_dm9000_board(ndev); + + unregister_netdev(ndev); +- dm9000_release_board(pdev, netdev_priv(ndev)); ++ dm9000_release_board(pdev, dm); + free_netdev(ndev); /* free device structure */ ++ if (dm->power_supply) ++ regulator_disable(dm->power_supply); + + dev_dbg(&pdev->dev, "released and freed device\n"); + return 0; diff --git a/queue-4.9/net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch b/queue-4.9/net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch new file mode 100644 index 00000000000..67666d23d50 --- /dev/null +++ b/queue-4.9/net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch @@ -0,0 +1,55 @@ +From ac88c531a5b38877eba2365a3f28f0c8b513dc33 Mon Sep 17 00:00:00 2001 +From: Paul Cercueil +Date: Sun, 7 Mar 2021 13:17:47 +0000 +Subject: net: davicom: Fix regulator not turned off on failed probe + +From: Paul Cercueil + +commit ac88c531a5b38877eba2365a3f28f0c8b513dc33 upstream. + +When the probe fails or requests to be defered, we must disable the +regulator that was previously enabled. + +Fixes: 7994fe55a4a2 ("dm9000: Add regulator and reset support to dm9000") +Signed-off-by: Paul Cercueil +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/davicom/dm9000.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/davicom/dm9000.c ++++ b/drivers/net/ethernet/davicom/dm9000.c +@@ -1459,7 +1459,7 @@ dm9000_probe(struct platform_device *pde + if (ret) { + dev_err(dev, "failed to request reset gpio %d: %d\n", + reset_gpios, ret); +- return -ENODEV; ++ goto out_regulator_disable; + } + + /* According to manual PWRST# Low Period Min 1ms */ +@@ -1471,8 +1471,10 @@ dm9000_probe(struct platform_device *pde + + if (!pdata) { + pdata = dm9000_parse_dt(&pdev->dev); +- if (IS_ERR(pdata)) +- return PTR_ERR(pdata); ++ if (IS_ERR(pdata)) { ++ ret = PTR_ERR(pdata); ++ goto out_regulator_disable; ++ } + } + + /* Init network device */ +@@ -1715,6 +1717,10 @@ out: + dm9000_release_board(pdev, db); + free_netdev(ndev); + ++out_regulator_disable: ++ if (!IS_ERR(power)) ++ regulator_disable(power); ++ + return ret; + } + diff --git a/queue-4.9/net-lapbether-remove-netif_start_queue-netif_stop_queue.patch b/queue-4.9/net-lapbether-remove-netif_start_queue-netif_stop_queue.patch new file mode 100644 index 00000000000..384255d33ee --- /dev/null +++ b/queue-4.9/net-lapbether-remove-netif_start_queue-netif_stop_queue.patch @@ -0,0 +1,61 @@ +From f7d9d4854519fdf4d45c70a4d953438cd88e7e58 Mon Sep 17 00:00:00 2001 +From: Xie He +Date: Sun, 7 Mar 2021 03:33:07 -0800 +Subject: net: lapbether: Remove netif_start_queue / netif_stop_queue + +From: Xie He + +commit f7d9d4854519fdf4d45c70a4d953438cd88e7e58 upstream. + +For the devices in this driver, the default qdisc is "noqueue", +because their "tx_queue_len" is 0. + +In function "__dev_queue_xmit" in "net/core/dev.c", devices with the +"noqueue" qdisc are specially handled. Packets are transmitted without +being queued after a "dev->flags & IFF_UP" check. However, it's possible +that even if this check succeeds, "ops->ndo_stop" may still have already +been called. This is because in "__dev_close_many", "ops->ndo_stop" is +called before clearing the "IFF_UP" flag. + +If we call "netif_stop_queue" in "ops->ndo_stop", then it's possible in +"__dev_queue_xmit", it sees the "IFF_UP" flag is present, and then it +checks "netif_xmit_stopped" and finds that the queue is already stopped. +In this case, it will complain that: +"Virtual device ... asks to queue packet!" + +To prevent "__dev_queue_xmit" from generating this complaint, we should +not call "netif_stop_queue" in "ops->ndo_stop". + +We also don't need to call "netif_start_queue" in "ops->ndo_open", +because after a netdev is allocated and registered, the +"__QUEUE_STATE_DRV_XOFF" flag is initially not set, so there is no need +to call "netif_start_queue" to clear it. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Xie He +Acked-by: Martin Schiller +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wan/lapbether.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/net/wan/lapbether.c ++++ b/drivers/net/wan/lapbether.c +@@ -286,7 +286,6 @@ static int lapbeth_open(struct net_devic + return -ENODEV; + } + +- netif_start_queue(dev); + return 0; + } + +@@ -294,8 +293,6 @@ static int lapbeth_close(struct net_devi + { + int err; + +- netif_stop_queue(dev); +- + if ((err = lapb_unregister(dev)) != LAPB_OK) + pr_err("lapb_unregister error: %d\n", err); + diff --git a/queue-4.9/net-sched-avoid-duplicates-in-classes-dump.patch b/queue-4.9/net-sched-avoid-duplicates-in-classes-dump.patch new file mode 100644 index 00000000000..451e69fc4e4 --- /dev/null +++ b/queue-4.9/net-sched-avoid-duplicates-in-classes-dump.patch @@ -0,0 +1,60 @@ +From bfc2560563586372212b0a8aeca7428975fa91fe Mon Sep 17 00:00:00 2001 +From: Maximilian Heyne +Date: Thu, 4 Mar 2021 14:43:17 +0000 +Subject: net: sched: avoid duplicates in classes dump + +From: Maximilian Heyne + +commit bfc2560563586372212b0a8aeca7428975fa91fe upstream. + +This is a follow up of commit ea3274695353 ("net: sched: avoid +duplicates in qdisc dump") which has fixed the issue only for the qdisc +dump. + +The duplicate printing also occurs when dumping the classes via + tc class show dev eth0 + +Fixes: 59cc1f61f09c ("net: sched: convert qdisc linked list to hashtable") +Signed-off-by: Maximilian Heyne +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/sched/sch_api.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/net/sched/sch_api.c ++++ b/net/sched/sch_api.c +@@ -1789,7 +1789,7 @@ static int tc_dump_tclass_qdisc(struct Q + + static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb, + struct tcmsg *tcm, struct netlink_callback *cb, +- int *t_p, int s_t) ++ int *t_p, int s_t, bool recur) + { + struct Qdisc *q; + int b; +@@ -1800,7 +1800,7 @@ static int tc_dump_tclass_root(struct Qd + if (tc_dump_tclass_qdisc(root, skb, tcm, cb, t_p, s_t) < 0) + return -1; + +- if (!qdisc_dev(root)) ++ if (!qdisc_dev(root) || !recur) + return 0; + + hash_for_each(qdisc_dev(root)->qdisc_hash, b, q, hash) { +@@ -1828,13 +1828,13 @@ static int tc_dump_tclass(struct sk_buff + s_t = cb->args[0]; + t = 0; + +- if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t) < 0) ++ if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t, true) < 0) + goto done; + + dev_queue = dev_ingress_queue(dev); + if (dev_queue && + tc_dump_tclass_root(dev_queue->qdisc_sleeping, skb, tcm, cb, +- &t, s_t) < 0) ++ &t, s_t, false) < 0) + goto done; + + done: diff --git a/queue-4.9/series b/queue-4.9/series index 4fa25ba52b4..7457cf1e58f 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -10,3 +10,7 @@ netfilter-x_tables-gpf-inside-xt_find_revision.patch cifs-return-proper-error-code-in-statfs-2.patch revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch net-mlx4_en-update-moderation-when-config-reset.patch +net-sched-avoid-duplicates-in-classes-dump.patch +net-lapbether-remove-netif_start_queue-netif_stop_queue.patch +net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch +net-davicom-fix-regulator-not-turned-off-on-driver-removal.patch