]> git.proxmox.com Git - pve-kernel-3.10.0.git/blame - tg3-fix-deadlock_in_tg3_change_mtu.patch
bump version to 3.10.0-27
[pve-kernel-3.10.0.git] / tg3-fix-deadlock_in_tg3_change_mtu.patch
CommitLineData
f894442a
DM
1From patchwork Wed Feb 26 12:23:50 2014
2Content-Type: text/plain; charset="utf-8"
3MIME-Version: 1.0
4Content-Transfer-Encoding: 7bit
5Subject: [3.11.y.z, extended,
6 stable] Patch "tg3: Fix deadlock in tg3_change_mtu()" has been added
7 to staging queue
8From: Luis Henriques <luis.henriques@canonical.com>
9Date: Wed, 26 Feb 2014 12:23:50 +0000
10
11This is a note to let you know that I have just added a patch titled
12
13 tg3: Fix deadlock in tg3_change_mtu()
14
15to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree
16which can be found at:
17
18 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue
19
20If you, or anyone else, feels it should not be added to this tree, please
21reply to this email.
22
23For more information about the 3.11.y.z tree, see
24https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
25
26Thanks.
27-Luis
28
29------
30
31>From e4075c63a28b56215afce0dee915a036a14baeab Mon Sep 17 00:00:00 2001
32From: Nithin Sujir <nsujir@broadcom.com>
33Date: Thu, 6 Feb 2014 14:13:05 -0800
34Subject: tg3: Fix deadlock in tg3_change_mtu()
35
36commit c6993dfd7db9b0c6b7ca7503a56fda9236a4710f upstream.
37
38Quoting David Vrabel -
39"5780 cards cannot have jumbo frames and TSO enabled together. When
40jumbo frames are enabled by setting the MTU, the TSO feature must be
41cleared. This is done indirectly by calling netdev_update_features()
42which will call tg3_fix_features() to actually clear the flags.
43
44netdev_update_features() will also trigger a new netlink message for the
45feature change event which will result in a call to tg3_get_stats64()
46which deadlocks on the tg3 lock."
47
48tg3_set_mtu() does not need to be under the tg3 lock since converting
49the flags to use set_bit(). Move it out to after tg3_netif_stop().
50
51Reported-by: David Vrabel <david.vrabel@citrix.com>
52Tested-by: David Vrabel <david.vrabel@citrix.com>
53Signed-off-by: Michael Chan <mchan@broadcom.com>
54Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
55Signed-off-by: David S. Miller <davem@davemloft.net>
56Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
57---
58 drivers/net/ethernet/broadcom/tg3.c | 4 ++--
59 1 file changed, 2 insertions(+), 2 deletions(-)
60
61--
621.9.0
63
64diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
65index f9aec90..849b141 100644
66--- a/drivers/net/ethernet/broadcom/tg3.c
67+++ b/drivers/net/ethernet/broadcom/tg3.c
68@@ -13907,12 +13907,12 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
69
70 tg3_netif_stop(tp);
71
72+ tg3_set_mtu(dev, tp, new_mtu);
73+
74 tg3_full_lock(tp, 1);
75
76 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
77
78- tg3_set_mtu(dev, tp, new_mtu);
79-
80 /* Reset PHY, otherwise the read DMA engine will be in a mode that
81 * breaks all requests to 256 bytes.
82 */