1. 13 2月, 2013 2 次提交
    • P
      gianfar: convert u64 status counters to atomic64_t · 212079df
      Paul Gortmaker 提交于
      While looking at some asm dump for an unrelated change, Eric
      noticed in the following stats count increment code:
      
          50b8:       81 3c 01 f8     lwz     r9,504(r28)
          50bc:       81 5c 01 fc     lwz     r10,508(r28)
          50c0:       31 4a 00 01     addic   r10,r10,1
          50c4:       7d 29 01 94     addze   r9,r9
          50c8:       91 3c 01 f8     stw     r9,504(r28)
          50cc:       91 5c 01 fc     stw     r10,508(r28)
      
      that a 64 bit counter was used on ppc-32 without sync
      and hence the "ethtool -S" output was racy.
      
      Here we convert all the values to use atomic64_t so that
      the output will always be consistent.
      Reported-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      212079df
    • P
      gianfar: remove largely unused gfar_stats struct · 68719786
      Paul Gortmaker 提交于
      The gfar_stats struct is only used in copying out data
      via ethtool.  It is declared as the extra stats, followed
      by the rmon stats.  However, the rmon stats are never
      actually ever used in the driver; instead the rmon data
      is a u32 register read that is cast directly into the
      ethtool buf.
      
      It seems the only reason rmon is in the struct at all is
      to give the offset(s) at which it should be exported into
      the ethtool buffer.  But note gfar_stats doesn't contain
      a gfar_extra_stats as a substruct -- instead it contains
      a u64 array of equal element count.  This implicitly means
      we have two independent declarations of what gfar_extra_stats
      really is.  Rather than have this duality, we already have
      defines which give us the offset directly, and hence do not
      need the struct at all.
      
      Further, since we know the extra_stats is unconditionally
      always present, we can write it out to the ethtool buf
      1st, and then optionally write out the rmon data.  There
      is no need for two independent loops, both of which are
      simply copying out the extra_stats to buf offset zero.
      
      This also helps pave the way towards allowing the extra
      stats fields to be converted to atomic64_t values, without
      having their types directly influencing the ethtool stats
      export code (gfar_fill_stats) that expects to deal with u64.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      68719786
  2. 12 2月, 2013 1 次提交
    • N
      netpoll: Fix __netpoll_rcu_free so that it can hold the rtnl lock · 2cde6acd
      Neil Horman 提交于
      __netpoll_rcu_free is used to free netpoll structures when the rtnl_lock is
      already held.  The mechanism is used to asynchronously call __netpoll_cleanup
      outside of the holding of the rtnl_lock, so as to avoid deadlock.
      Unfortunately, __netpoll_cleanup modifies pointers (dev->np), which means the
      rtnl_lock must be held while calling it.  Further, it cannot be held, because
      rcu callbacks may be issued in softirq contexts, which cannot sleep.
      
      Fix this by converting the rcu callback to a work queue that is guaranteed to
      get scheduled in process context, so that we can hold the rtnl properly while
      calling __netpoll_cleanup
      
      Tested successfully by myself.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Cong Wang <amwang@redhat.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2cde6acd
  3. 11 2月, 2013 9 次提交
  4. 09 2月, 2013 7 次提交
  5. 08 2月, 2013 19 次提交
  6. 07 2月, 2013 2 次提交
    • S
      virtio_console: Don't access uninitialized data. · aded024a
      Sjur Brændeland 提交于
      Don't access uninitialized work-queue when removing device.
      The work queue is initialized only if the device multi-queue.
      So don't call cancel_work unless this is a multi-queue device.
      
      This fixes the following panic:
      
      Kernel panic - not syncing: BUG!
      Call Trace:
      62031b28:  [<6026085d>] panic+0x16b/0x2d3
      62031b30:  [<6004ef5e>] flush_work+0x0/0x1d7
      62031b60:  [<602606f2>] panic+0x0/0x2d3
      62031b68:  [<600333b0>] memcpy+0x0/0x140
      62031b80:  [<6002d58a>] unblock_signals+0x0/0x84
      62031ba0:  [<602609c5>] printk+0x0/0xa0
      62031bd8:  [<60264e51>] __mutex_unlock_slowpath+0x13d/0x148
      62031c10:  [<6004ef5e>] flush_work+0x0/0x1d7
      62031c18:  [<60050234>] try_to_grab_pending+0x0/0x17e
      62031c38:  [<6004e984>] get_work_gcwq+0x71/0x8f
      62031c48:  [<60050539>] __cancel_work_timer+0x5b/0x115
      62031c78:  [<628acc85>] unplug_port+0x0/0x191 [virtio_console]
      62031c98:  [<6005061c>] cancel_work_sync+0x12/0x14
      62031ca8:  [<628ace96>] virtcons_remove+0x80/0x15c [virtio_console]
      62031ce8:  [<628191de>] virtio_dev_remove+0x1e/0x7e [virtio]
      62031d08:  [<601cf242>] __device_release_driver+0x75/0xe4
      62031d28:  [<601cf2dd>] device_release_driver+0x2c/0x40
      62031d48:  [<601ce0dd>] driver_unbind+0x7d/0xc6
      62031d88:  [<601cd5d9>] drv_attr_store+0x27/0x29
      62031d98:  [<60115f61>] sysfs_write_file+0x100/0x14d
      62031df8:  [<600b737d>] vfs_write+0xcb/0x184
      62031e08:  [<600b58b8>] filp_close+0x88/0x94
      62031e38:  [<600b7686>] sys_write+0x59/0x88
      62031e88:  [<6001ced1>] handle_syscall+0x5d/0x80
      62031ea8:  [<60030a74>] userspace+0x405/0x531
      62031f08:  [<600d32cc>] sys_dup+0x0/0x5e
      62031f28:  [<601b11d6>] strcpy+0x0/0x18
      62031f38:  [<600be46c>] do_execve+0x10/0x12
      62031f48:  [<600184c7>] run_init_process+0x43/0x45
      62031fd8:  [<60019a91>] new_thread_handler+0xba/0xbc
      Signed-off-by: NSjur Brændeland <sjur.brandeland@stericsson.com>
      Cc: stable@kernel.org
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      aded024a
    • B
      net: qmi_wwan: add more Huawei devices, including E320 · e21b9d03
      Bjørn Mork 提交于
      Adding new class/subclass/protocol combinations based on the GPLed
      out-of-tree Huawei driver. One of these has already appeared on a
      device labelled as "E320".
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e21b9d03