]>
Commit | Line | Data |
---|---|---|
f894442a DM |
1 | From patchwork Wed Feb 26 12:23:50 2014 |
2 | Content-Type: text/plain; charset="utf-8" | |
3 | MIME-Version: 1.0 | |
4 | Content-Transfer-Encoding: 7bit | |
5 | Subject: [3.11.y.z, extended, | |
6 | stable] Patch "tg3: Fix deadlock in tg3_change_mtu()" has been added | |
7 | to staging queue | |
8 | From: Luis Henriques <luis.henriques@canonical.com> | |
9 | Date: Wed, 26 Feb 2014 12:23:50 +0000 | |
10 | ||
11 | This 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 | ||
15 | to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree | |
16 | which 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 | ||
20 | If you, or anyone else, feels it should not be added to this tree, please | |
21 | reply to this email. | |
22 | ||
23 | For more information about the 3.11.y.z tree, see | |
24 | https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable | |
25 | ||
26 | Thanks. | |
27 | -Luis | |
28 | ||
29 | ------ | |
30 | ||
31 | >From e4075c63a28b56215afce0dee915a036a14baeab Mon Sep 17 00:00:00 2001 | |
32 | From: Nithin Sujir <nsujir@broadcom.com> | |
33 | Date: Thu, 6 Feb 2014 14:13:05 -0800 | |
34 | Subject: tg3: Fix deadlock in tg3_change_mtu() | |
35 | ||
36 | commit c6993dfd7db9b0c6b7ca7503a56fda9236a4710f upstream. | |
37 | ||
38 | Quoting David Vrabel - | |
39 | "5780 cards cannot have jumbo frames and TSO enabled together. When | |
40 | jumbo frames are enabled by setting the MTU, the TSO feature must be | |
41 | cleared. This is done indirectly by calling netdev_update_features() | |
42 | which will call tg3_fix_features() to actually clear the flags. | |
43 | ||
44 | netdev_update_features() will also trigger a new netlink message for the | |
45 | feature change event which will result in a call to tg3_get_stats64() | |
46 | which deadlocks on the tg3 lock." | |
47 | ||
48 | tg3_set_mtu() does not need to be under the tg3 lock since converting | |
49 | the flags to use set_bit(). Move it out to after tg3_netif_stop(). | |
50 | ||
51 | Reported-by: David Vrabel <david.vrabel@citrix.com> | |
52 | Tested-by: David Vrabel <david.vrabel@citrix.com> | |
53 | Signed-off-by: Michael Chan <mchan@broadcom.com> | |
54 | Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> | |
55 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
56 | Signed-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 | -- | |
62 | 1.9.0 | |
63 | ||
64 | diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c | |
65 | index 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 | */ |