]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-small_fixes.patch
forcedeth vlan fixes
[packages/kernel.git] / kernel-small_fixes.patch
1 --- linux-2.6.32/drivers/infiniband/Kconfig~    2009-12-05 00:26:03.663774916 +0100
2 +++ linux-2.6.32/drivers/infiniband/Kconfig     2009-12-05 00:26:05.914179759 +0100
3 @@ -37,7 +37,6 @@
4  config INFINIBAND_ADDR_TRANS
5         bool
6         depends on INET
7 -       depends on !(INFINIBAND = y && IPV6 = m)
8         default y
9  
10  source "drivers/infiniband/hw/mthca/Kconfig"
11 --- linux-2.6.33/scripts/mod/modpost.c~ 2010-02-24 19:52:17.000000000 +0100
12 +++ linux-2.6.33/scripts/mod/modpost.c  2010-03-07 14:26:47.242168558 +0100
13 @@ -15,7 +15,8 @@
14  #include <stdio.h>
15  #include <ctype.h>
16  #include "modpost.h"
17 -#include "../../include/generated/autoconf.h"
18 +// PLD architectures don't use CONFIG_SYMBOL_PREFIX
19 +//#include "../../include/generated/autoconf.h"
20  #include "../../include/linux/license.h"
21  
22  /* Some toolchains use a `_' prefix for all user symbols. */
23
24 commit 87b09f1f25cd1e01d7c50bf423c7fe33027d7511
25 Author: stephen hemminger <shemminger@vyatta.com>
26 Date:   Fri Feb 12 06:58:00 2010 +0000
27
28     sky2: dont enable PME legacy mode
29     
30     This bit is not changed by vendor driver, and should be left alone.
31     The documentation implies this a debug bit.
32       0 = WAKE# only asserted when VMAIN not available
33       1 = WAKE# is depend on wake events and independent of VMAIN.
34     
35     Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
36     Signed-off-by: David S. Miller <davem@davemloft.net>
37
38 diff --git b/drivers/net/sky2.c a/drivers/net/sky2.c
39 index 2494842..edf37aa 100644
40 --- b/drivers/net/sky2.c
41 +++ a/drivers/net/sky2.c
42 @@ -733,6 +733,7 @@ static void sky2_wol_init(struct sky2_port *sky2)
43         unsigned port = sky2->port;
44         enum flow_control save_mode;
45         u16 ctrl;
46 +       u32 reg1;
47  
48         /* Bring hardware out of reset */
49         sky2_write16(hw, B0_CTST, CS_RST_CLR);
50 @@ -786,6 +787,11 @@ static void sky2_wol_init(struct sky2_port *sky2)
51         /* Disable PiG firmware */
52         sky2_write16(hw, B0_CTST, Y2_HW_WOL_OFF);
53  
54 +       /* Turn on legacy PCI-Express PME mode */
55 +       reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
56 +       reg1 |= PCI_Y2_PME_LEGACY;
57 +       sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
58 +
59         /* block receiver */
60         sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
61  }
62 Date: Mon, 11 Jul 2011 09:59:57 -0400
63 From: Christoph Hellwig <hch@infradead.org>
64 To: xfs@oss.sgi.com
65 Cc: arekm@maven.pl
66 Subject: [PATCH] xfs: start periodic workers later
67 Message-ID: <20110711135957.GA23737@infradead.org>
68 MIME-Version: 1.0
69 Content-Type: text/plain;
70   charset=us-ascii
71 Content-Disposition: inline
72 User-Agent: Mutt/1.5.21 (2010-09-15)
73
74 Start the periodic sync workers only after we have finished xfs_mountfs
75 and thus fully set up the filesystem structures.  Without this we can
76 call into xfs_qm_sync before the quotainfo strucute is set up if the
77 mount takes unusually long, and probably hit other incomplete states
78 as well.
79
80 Also clean up the xfs_fs_fill_super error path by using consistent
81 label names, and removing an impossible to reach case.
82
83 Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
84 Signed-off-by: Christoph Hellwig <hch@lst.de>
85
86 Index: xfs/fs/xfs/linux-2.6/xfs_super.c
87 ===================================================================
88 --- xfs.orig/fs/xfs/linux-2.6/xfs_super.c       2011-07-11 12:02:56.762758869 +0200
89 +++ xfs/fs/xfs/linux-2.6/xfs_super.c    2011-07-11 12:09:20.817344934 +0200
90 @@ -1411,37 +1411,35 @@ xfs_fs_fill_super(
91         sb->s_time_gran = 1;
92         set_posix_acl_flag(sb);
93  
94 -       error = xfs_syncd_init(mp);
95 -       if (error)
96 -               goto out_filestream_unmount;
97 -
98         xfs_inode_shrinker_register(mp);
99  
100         error = xfs_mountfs(mp);
101         if (error)
102 -               goto out_syncd_stop;
103 +               goto out_filestream_unmount;
104 +
105 +       error = xfs_syncd_init(mp);
106 +       if (error)
107 +               goto out_unmount;
108  
109         root = igrab(VFS_I(mp->m_rootip));
110         if (!root) {
111                 error = ENOENT;
112 -               goto fail_unmount;
113 +               goto out_syncd_stop;
114         }
115         if (is_bad_inode(root)) {
116                 error = EINVAL;
117 -               goto fail_vnrele;
118 +               goto out_syncd_stop;
119         }
120         sb->s_root = d_alloc_root(root);
121         if (!sb->s_root) {
122                 error = ENOMEM;
123 -               goto fail_vnrele;
124 +               goto out_iput;
125         }
126  
127         return 0;
128  
129 - out_syncd_stop:
130 -       xfs_inode_shrinker_unregister(mp);
131 -       xfs_syncd_stop(mp);
132   out_filestream_unmount:
133 +       xfs_inode_shrinker_unregister(mp);
134         xfs_filestream_unmount(mp);
135   out_free_sb:
136         xfs_freesb(mp);
137 @@ -1455,17 +1453,12 @@ xfs_fs_fill_super(
138   out:
139         return -error;
140  
141 - fail_vnrele:
142 -       if (sb->s_root) {
143 -               dput(sb->s_root);
144 -               sb->s_root = NULL;
145 -       } else {
146 -               iput(root);
147 -       }
148 -
149 - fail_unmount:
150 -       xfs_inode_shrinker_unregister(mp);
151 + out_iput:
152 +       iput(root);
153 + out_syncd_stop:
154         xfs_syncd_stop(mp);
155 + out_unmount:
156 +       xfs_inode_shrinker_unregister(mp);
157  
158         /*
159          * Blow away any referenced inode in the filestreams cache.
160 On Sat, 2 Jul 2011, Andi Kleen wrote:
161
162 > > The problem is that blk_peek_request() calls scsi_prep_fn(), which 
163 > > does this:
164 > > 
165 > >     struct scsi_device *sdev = q->queuedata;
166 > >     int ret = BLKPREP_KILL;
167 > > 
168 > >     if (req->cmd_type == REQ_TYPE_BLOCK_PC)
169 > >             ret = scsi_setup_blk_pc_cmnd(sdev, req);
170 > >     return scsi_prep_return(q, req, ret);
171 > > 
172 > > It doesn't check to see if sdev is NULL, nor does 
173 > > scsi_setup_blk_pc_cmnd().  That accounts for this error:
174
175 > I actually added a NULL check in scsi_setup_blk_pc_cmnd early on,
176 > but that just caused RCU CPU stalls afterwards and then eventually
177 > a hung system.
178
179 The RCU problem is likely to be a separate issue.  It might even be a 
180 result of the use-after-free problem with the elevator.
181
182 At any rate, it's clear that the crash in the refcounting log you
183 posted occurred because scsi_setup_blk_pc_cmnd() called
184 scsi_prep_state_check(), which tried to dereference the NULL pointer.
185
186 Would you like to try this patch to see if it fixes the problem?  As I 
187 said before, I'm not certain it's the best thing to do, but it worked 
188 on my system.
189
190 Alan Stern
191
192
193
194
195 Index: usb-3.0/drivers/scsi/scsi_lib.c
196 ===================================================================
197 --- usb-3.0.orig/drivers/scsi/scsi_lib.c
198 +++ usb-3.0/drivers/scsi/scsi_lib.c
199 @@ -1247,6 +1247,8 @@ int scsi_prep_fn(struct request_queue *q
200         struct scsi_device *sdev = q->queuedata;
201         int ret = BLKPREP_KILL;
202  
203 +       if (!sdev)
204 +               return ret;
205         if (req->cmd_type == REQ_TYPE_BLOCK_PC)
206                 ret = scsi_setup_blk_pc_cmnd(sdev, req);
207         return scsi_prep_return(q, req, ret);
208 Index: usb-3.0/drivers/scsi/scsi_sysfs.c
209 ===================================================================
210 --- usb-3.0.orig/drivers/scsi/scsi_sysfs.c
211 +++ usb-3.0/drivers/scsi/scsi_sysfs.c
212 @@ -322,6 +322,8 @@ static void scsi_device_dev_release_user
213                 kfree(evt);
214         }
215  
216 +       /* Freeing the queue signals to block that we're done */
217 +       scsi_free_queue(sdev->request_queue);
218         blk_put_queue(sdev->request_queue);
219         /* NULL queue means the device can't be used */
220         sdev->request_queue = NULL;
221 @@ -936,8 +938,6 @@ void __scsi_remove_device(struct scsi_de
222         /* cause the request function to reject all I/O requests */
223         sdev->request_queue->queuedata = NULL;
224  
225 -       /* Freeing the queue signals to block that we're done */
226 -       scsi_free_queue(sdev->request_queue);
227         put_device(dev);
228  }
229  
230
231
232 --
233 To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
234 the body of a message to majordomo@vger.kernel.org
235 More majordomo info at  http://vger.kernel.org/majordomo-info.html
236 Please read the FAQ at  http://www.tux.org/lkml/
237 As reported by Ben Greer and Froncois Romieu. The code path in 
238 the netif_carrier code leads it to try and disable
239 a late workqueue to reenable it immediately
240 netif_carrier_on
241 -> linkwatch_fire_event
242    -> linkwatch_schedule_work
243       -> cancel_delayed_work
244          -> del_timer_sync  
245
246 If __cancel_delayed_work is used instead then there is no
247 problem of waiting for running linkwatch_event.
248
249 There is a race between linkwatch_event running re-scheduling
250 but it is harmless to schedule an extra scan of the linkwatch queue.
251
252 Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
253
254
255 --- a/net/core/link_watch.c     2011-07-22 15:25:31.027533604 -0700
256 +++ b/net/core/link_watch.c     2011-07-22 15:31:27.531520028 -0700
257 @@ -126,7 +126,7 @@ static void linkwatch_schedule_work(int
258                 return;
259  
260         /* It's already running which is good enough. */
261 -       if (!cancel_delayed_work(&linkwatch_work))
262 +       if (!__cancel_delayed_work(&linkwatch_work))
263                 return;
264  
265         /* Otherwise we reschedule it again for immediate execution. */
266
267 --
268 To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
269 the body of a message to majordomo@vger.kernel.org
270 More majordomo info at  http://vger.kernel.org/majordomo-info.html
271 Please read the FAQ at  http://www.tux.org/lkml/
272 commit 3326c784c9f492e988617d93f647ae0cfd4c8d09
273 Author: Jiri Pirko <jpirko@redhat.com>
274 Date:   Wed Jul 20 04:54:38 2011 +0000
275
276     forcedeth: do vlan cleanup
277     
278     - unify vlan and nonvlan rx path
279     - kill np->vlangrp and nv_vlan_rx_register
280     - allow to turn on/off rx vlan accel via ethtool (set_features)
281     
282     Signed-off-by: Jiri Pirko <jpirko@redhat.com>
283     Signed-off-by: David S. Miller <davem@davemloft.net>
284
285 diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
286 index 537b695..e64cd9c 100644
287 --- a/drivers/net/forcedeth.c
288 +++ b/drivers/net/forcedeth.c
289 @@ -820,9 +820,6 @@ struct fe_priv {
290         struct nv_skb_map *tx_end_flip;
291         int tx_stop;
292  
293 -       /* vlan fields */
294 -       struct vlan_group *vlangrp;
295 -
296         /* msi/msi-x fields */
297         u32 msi_flags;
298         struct msix_entry msi_x_entry[NV_MSI_X_MAX_VECTORS];
299 @@ -2766,17 +2763,13 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
300                         skb->protocol = eth_type_trans(skb, dev);
301                         prefetch(skb->data);
302  
303 -                       if (likely(!np->vlangrp)) {
304 -                               napi_gro_receive(&np->napi, skb);
305 -                       } else {
306 -                               vlanflags = le32_to_cpu(np->get_rx.ex->buflow);
307 -                               if (vlanflags & NV_RX3_VLAN_TAG_PRESENT) {
308 -                                       vlan_gro_receive(&np->napi, np->vlangrp,
309 -                                                        vlanflags & NV_RX3_VLAN_TAG_MASK, skb);
310 -                               } else {
311 -                                       napi_gro_receive(&np->napi, skb);
312 -                               }
313 +                       vlanflags = le32_to_cpu(np->get_rx.ex->buflow);
314 +                       if (vlanflags & NV_RX3_VLAN_TAG_PRESENT) {
315 +                               u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK;
316 +
317 +                               __vlan_hwaccel_put_tag(skb, vid);
318                         }
319 +                       napi_gro_receive(&np->napi, skb);
320  
321                         dev->stats.rx_packets++;
322                         dev->stats.rx_bytes += len;
323 @@ -4484,6 +4477,27 @@ static u32 nv_fix_features(struct net_device *dev, u32 features)
324         return features;
325  }
326  
327 +static void nv_vlan_mode(struct net_device *dev, u32 features)
328 +{
329 +       struct fe_priv *np = get_nvpriv(dev);
330 +
331 +       spin_lock_irq(&np->lock);
332 +
333 +       if (features & NETIF_F_HW_VLAN_RX)
334 +               np->txrxctl_bits |= NVREG_TXRXCTL_VLANSTRIP;
335 +       else
336 +               np->txrxctl_bits &= ~NVREG_TXRXCTL_VLANSTRIP;
337 +
338 +       if (features & NETIF_F_HW_VLAN_TX)
339 +               np->txrxctl_bits |= NVREG_TXRXCTL_VLANINS;
340 +       else
341 +               np->txrxctl_bits &= ~NVREG_TXRXCTL_VLANINS;
342 +
343 +       writel(np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
344 +
345 +       spin_unlock_irq(&np->lock);
346 +}
347 +
348  static int nv_set_features(struct net_device *dev, u32 features)
349  {
350         struct fe_priv *np = netdev_priv(dev);
351 @@ -4504,6 +4518,9 @@ static int nv_set_features(struct net_device *dev, u32 features)
352                 spin_unlock_irq(&np->lock);
353         }
354  
355 +       if (changed & (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX))
356 +               nv_vlan_mode(dev, features);
357 +
358         return 0;
359  }
360  
361 @@ -4879,29 +4896,6 @@ static const struct ethtool_ops ops = {
362         .self_test = nv_self_test,
363  };
364  
365 -static void nv_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
366 -{
367 -       struct fe_priv *np = get_nvpriv(dev);
368 -
369 -       spin_lock_irq(&np->lock);
370 -
371 -       /* save vlan group */
372 -       np->vlangrp = grp;
373 -
374 -       if (grp) {
375 -               /* enable vlan on MAC */
376 -               np->txrxctl_bits |= NVREG_TXRXCTL_VLANSTRIP | NVREG_TXRXCTL_VLANINS;
377 -       } else {
378 -               /* disable vlan on MAC */
379 -               np->txrxctl_bits &= ~NVREG_TXRXCTL_VLANSTRIP;
380 -               np->txrxctl_bits &= ~NVREG_TXRXCTL_VLANINS;
381 -       }
382 -
383 -       writel(np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
384 -
385 -       spin_unlock_irq(&np->lock);
386 -}
387 -
388  /* The mgmt unit and driver use a semaphore to access the phy during init */
389  static int nv_mgmt_acquire_sema(struct net_device *dev)
390  {
391 @@ -5208,7 +5202,6 @@ static const struct net_device_ops nv_netdev_ops = {
392         .ndo_validate_addr      = eth_validate_addr,
393         .ndo_set_mac_address    = nv_set_mac_address,
394         .ndo_set_multicast_list = nv_set_multicast,
395 -       .ndo_vlan_rx_register   = nv_vlan_rx_register,
396  #ifdef CONFIG_NET_POLL_CONTROLLER
397         .ndo_poll_controller    = nv_poll_controller,
398  #endif
399 @@ -5226,7 +5219,6 @@ static const struct net_device_ops nv_netdev_ops_optimized = {
400         .ndo_validate_addr      = eth_validate_addr,
401         .ndo_set_mac_address    = nv_set_mac_address,
402         .ndo_set_multicast_list = nv_set_multicast,
403 -       .ndo_vlan_rx_register   = nv_vlan_rx_register,
404  #ifdef CONFIG_NET_POLL_CONTROLLER
405         .ndo_poll_controller    = nv_poll_controller,
406  #endif
407 commit 0891b0e08937aaec2c4734acb94c5ff8042313bb
408 Author: Jiri Pirko <jpirko@redhat.com>
409 Date:   Tue Jul 26 10:19:28 2011 +0000
410
411     forcedeth: fix vlans
412     
413     For some reason, when rxaccel is disabled, NV_RX3_VLAN_TAG_PRESENT is
414     still set and some pseudorandom vids appear. So check for
415     NETIF_F_HW_VLAN_RX as well. Also set correctly hw_features and set vlan
416     mode on probe.
417     
418     Signed-off-by: Jiri Pirko <jpirko@redhat.com>
419     Signed-off-by: David S. Miller <davem@davemloft.net>
420
421 diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
422 index e64cd9c..e55df30 100644
423 --- a/drivers/net/forcedeth.c
424 +++ b/drivers/net/forcedeth.c
425 @@ -2764,7 +2764,14 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
426                         prefetch(skb->data);
427  
428                         vlanflags = le32_to_cpu(np->get_rx.ex->buflow);
429 -                       if (vlanflags & NV_RX3_VLAN_TAG_PRESENT) {
430 +
431 +                       /*
432 +                        * There's need to check for NETIF_F_HW_VLAN_RX here.
433 +                        * Even if vlan rx accel is disabled,
434 +                        * NV_RX3_VLAN_TAG_PRESENT is pseudo randomly set.
435 +                        */
436 +                       if (dev->features & NETIF_F_HW_VLAN_RX &&
437 +                           vlanflags & NV_RX3_VLAN_TAG_PRESENT) {
438                                 u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK;
439  
440                                 __vlan_hwaccel_put_tag(skb, vid);
441 @@ -5331,15 +5338,16 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
442                 np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK;
443                 dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_SG |
444                         NETIF_F_TSO | NETIF_F_RXCSUM;
445 -               dev->features |= dev->hw_features;
446         }
447  
448         np->vlanctl_bits = 0;
449         if (id->driver_data & DEV_HAS_VLAN) {
450                 np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE;
451 -               dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX;
452 +               dev->hw_features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX;
453         }
454  
455 +       dev->features |= dev->hw_features;
456 +
457         np->pause_flags = NV_PAUSEFRAME_RX_CAPABLE | NV_PAUSEFRAME_RX_REQ | NV_PAUSEFRAME_AUTONEG;
458         if ((id->driver_data & DEV_HAS_PAUSEFRAME_TX_V1) ||
459             (id->driver_data & DEV_HAS_PAUSEFRAME_TX_V2) ||
460 @@ -5607,6 +5615,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
461                 goto out_error;
462         }
463  
464 +       nv_vlan_mode(dev, dev->features);
465 +
466         netif_carrier_off(dev);
467  
468         dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n",
This page took 0.060951 seconds and 4 git commands to generate.