diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0057-atl1-fix-oops-when-changing-tx-rx-ring-params.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap/linus/0057-atl1-fix-oops-when-changing-tx-rx-ring-params.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0057-atl1-fix-oops-when-changing-tx-rx-ring-params.patch b/extras/recipes-kernel/linux/linux-omap/linus/0057-atl1-fix-oops-when-changing-tx-rx-ring-params.patch new file mode 100644 index 00000000..9db691b1 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/linus/0057-atl1-fix-oops-when-changing-tx-rx-ring-params.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | From f14284bb4ad057377b4944bb3985352fe1079c60 Mon Sep 17 00:00:00 2001 | ||
2 | From: J. K. Cliburn <jcliburn@gmail.com> | ||
3 | Date: Sat, 1 Jan 2011 05:02:12 +0000 | ||
4 | Subject: [PATCH 57/65] atl1: fix oops when changing tx/rx ring params | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Commit 3f5a2a713aad28480d86b0add00c68484b54febc zeroes out the statistics | ||
10 | message block (SMB) and coalescing message block (CMB) when adapter ring | ||
11 | resources are freed. This is desirable behavior, but, as a side effect, | ||
12 | the commit leads to an oops when atl1_set_ringparam() attempts to alter | ||
13 | the number of rx or tx elements in the ring buffer (by using ethtool | ||
14 | -G, for example). We don't want SMB or CMB to change during this | ||
15 | operation. | ||
16 | |||
17 | Modify atl1_set_ringparam() to preserve SMB and CMB when changing ring | ||
18 | parameters. | ||
19 | |||
20 | Cc: stable@kernel.org | ||
21 | Signed-off-by: Jay Cliburn <jcliburn@gmail.com> | ||
22 | Reported-by: Tõnu Raitviir <jussuf@linux.ee> | ||
23 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
24 | --- | ||
25 | drivers/net/atlx/atl1.c | 10 ++++++++++ | ||
26 | 1 files changed, 10 insertions(+), 0 deletions(-) | ||
27 | |||
28 | diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c | ||
29 | index 5336310..3acf512 100644 | ||
30 | --- a/drivers/net/atlx/atl1.c | ||
31 | +++ b/drivers/net/atlx/atl1.c | ||
32 | @@ -3504,6 +3504,8 @@ static int atl1_set_ringparam(struct net_device *netdev, | ||
33 | struct atl1_rfd_ring rfd_old, rfd_new; | ||
34 | struct atl1_rrd_ring rrd_old, rrd_new; | ||
35 | struct atl1_ring_header rhdr_old, rhdr_new; | ||
36 | + struct atl1_smb smb; | ||
37 | + struct atl1_cmb cmb; | ||
38 | int err; | ||
39 | |||
40 | tpd_old = adapter->tpd_ring; | ||
41 | @@ -3544,11 +3546,19 @@ static int atl1_set_ringparam(struct net_device *netdev, | ||
42 | adapter->rrd_ring = rrd_old; | ||
43 | adapter->tpd_ring = tpd_old; | ||
44 | adapter->ring_header = rhdr_old; | ||
45 | + /* | ||
46 | + * Save SMB and CMB, since atl1_free_ring_resources | ||
47 | + * will clear them. | ||
48 | + */ | ||
49 | + smb = adapter->smb; | ||
50 | + cmb = adapter->cmb; | ||
51 | atl1_free_ring_resources(adapter); | ||
52 | adapter->rfd_ring = rfd_new; | ||
53 | adapter->rrd_ring = rrd_new; | ||
54 | adapter->tpd_ring = tpd_new; | ||
55 | adapter->ring_header = rhdr_new; | ||
56 | + adapter->smb = smb; | ||
57 | + adapter->cmb = cmb; | ||
58 | |||
59 | err = atl1_up(adapter); | ||
60 | if (err) | ||
61 | -- | ||
62 | 1.6.6.1 | ||
63 | |||