1. 19 4月, 2011 1 次提交
  2. 31 3月, 2011 1 次提交
  3. 19 11月, 2010 1 次提交
    • N
      3c59x: fix build failure on !CONFIG_PCI · d530db0d
      Namhyung Kim 提交于
      VORTEX_PCI() could return NULL so it needs to be casted before
      accessing any member of struct pci_dev. This fixes following
      build failure. Likewise VORTEX_EISA() was changed also.
      
        CC [M]  drivers/net/3c59x.o
      drivers/net/3c59x.c: In function 'acpi_set_WOL':
      drivers/net/3c59x.c:3211:39: warning: dereferencing 'void *' pointer
      drivers/net/3c59x.c:3211:39: error: request for member 'current_state' in something not a structure or union
      make[3]: *** [drivers/net/3c59x.o] Error 1
      make[2]: *** [drivers/net/3c59x.o] Error 2
      make[1]: *** [sub-make] Error 2
      make: *** [all] Error 2
      Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d530db0d
  4. 28 9月, 2010 1 次提交
    • J
      3c59x: fix regression from patch "Add ethtool WOL support" · 3fd6c88e
      Jan Beulich 提交于
      This patch (commit 690a1f20) added a
      new call site for acpi_set_WOL() without checking that the function is
      actually suitable to be called via
      
       vortex_set_wol+0xcd/0xe0 [3c59x]
       dev_ethtool+0xa5a/0xb70
       dev_ioctl+0x2e0/0x4b0
       T.961+0x49/0x50
       sock_ioctl+0x47/0x290
       do_vfs_ioctl+0x7f/0x340
       sys_ioctl+0x80/0xa0
       system_call_fastpath+0x16/0x1b
      
      i.e. outside of code paths run when the device is not yet enabled or
      already disabled. In particular, putting the device into D3hot is a
      pretty bad idea when it was already brought up.
      
      Furthermore, all prior callers of the function made sure they're
      actually dealing with a PCI device, while the newly added one didn't.
      
      In the same spirit, the .get_wol handler shouldn't indicate support
      for WOL for non-PCI devices.
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3fd6c88e
  5. 16 9月, 2010 1 次提交
    • D
      3c59x: Remove atomic context inside vortex_{set|get}_wol · 84176b7b
      Denis Kirjanov 提交于
      There is no need to use spinlocks in vortex_{set|get}_wol.
      This also fixes a bug:
      [  254.214993] 3c59x 0000:00:0d.0: PME# enabled
      [  254.215021] BUG: sleeping function called from invalid context at kernel/mutex.c:94
      [  254.215030] in_atomic(): 0, irqs_disabled(): 1, pid: 4875, name: ethtool
      [  254.215042] Pid: 4875, comm: ethtool Tainted: G        W   2.6.36-rc3+ #7
      [  254.215049] Call Trace:
      [  254.215050]  [] __might_sleep+0xb1/0xb6
      [  254.215050]  [] mutex_lock+0x17/0x30
      [  254.215050]  [] acpi_enable_wakeup_device_power+0x2b/0xb1
      [  254.215050]  [] acpi_pm_device_sleep_wake+0x42/0x7f
      [  254.215050]  [] acpi_pci_sleep_wake+0x5d/0x63
      [  254.215050]  [] platform_pci_sleep_wake+0x1d/0x20
      [  254.215050]  [] __pci_enable_wake+0x90/0xd0
      [  254.215050]  [] acpi_set_WOL+0x8e/0xf5 [3c59x]
      [  254.215050]  [] vortex_set_wol+0x4e/0x5e [3c59x]
      [  254.215050]  [] dev_ethtool+0x1cf/0xb61
      [  254.215050]  [] ? debug_mutex_free_waiter+0x45/0x4a
      [  254.215050]  [] ? __mutex_lock_common+0x204/0x20e
      [  254.215050]  [] ? __mutex_lock_slowpath+0x12/0x15
      [  254.215050]  [] ? mutex_lock+0x23/0x30
      [  254.215050]  [] dev_ioctl+0x42c/0x533
      [  254.215050]  [] ? _cond_resched+0x8/0x1c
      [  254.215050]  [] ? lock_page+0x1c/0x30
      [  254.215050]  [] ? page_address+0x15/0x7c
      [  254.215050]  [] ? filemap_fault+0x187/0x2c4
      [  254.215050]  [] sock_ioctl+0x1d4/0x1e0
      [  254.215050]  [] ? sock_ioctl+0x0/0x1e0
      [  254.215050]  [] vfs_ioctl+0x19/0x33
      [  254.215050]  [] do_vfs_ioctl+0x424/0x46f
      [  254.215050]  [] ? selinux_file_ioctl+0x3c/0x40
      [  254.215050]  [] sys_ioctl+0x40/0x5a
      [  254.215050]  [] sysenter_do_call+0x12/0x22
      
      vortex_set_wol protected with a spinlock, but nested  acpi_set_WOL acquires a mutex inside atomic context.
      Ethtool operations are already serialized by RTNL mutex, so it is safe to drop the locks.
      Signed-off-by: NDenis Kirjanov <dkirjanov@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84176b7b
  6. 08 9月, 2010 1 次提交
    • B
      3c59x: Fix deadlock in vortex_error() · 89b12fab
      Ben Hutchings 提交于
      This fixes a bug introduced in commit
      de847272
      "3c59x: Use fine-grained locks for MII and windowed register access".
      
      vortex_interrupt() holds vp->window_lock over multiple register
      accesses to reduce locking overhead.  However it also needs to call
      vortex_error() sometimes, and that uses the regular functions for
      access to windowed registers, which will try to acquire window_lock
      again.
      
      Therefore, drop window_lock around the call to vortex_error() and set
      the window afterward reacquiring the lock.  Since vortex_error() may
      call vortex_rx(), which *does* require its caller to hold window_lock,
      lift that call up into vortex_interrupt().  This also removes the
      potential for calling vortex_rx() on a later-generation NIC.
      
      Reported-and-tested-by: Jens Schüßler <jgs@trash.net> [in Debian's 2.6.32]
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      89b12fab
  7. 02 9月, 2010 1 次提交
    • B
      3c59x: Remove incorrect locking; correct documented lock hierarchy · 24cd804d
      Ben Hutchings 提交于
      vortex_ioctl() was grabbing vortex_private::lock around its call to
      generic_mii_ioctl().  This is no longer necessary since there are more
      specific locks which the mdio_{read,write}() functions will obtain.
      Worse, those functions do not save and restore IRQ flags when locking
      the MII state, so interrupts will be enabled when generic_mii_ioctl()
      returns.
      
      Since there is currently no need for any function to call
      mdio_{read,write}() while holding another spinlock, do not change them
      to save and restore IRQ flags but remove the specification of ordering
      between vortex_private::lock and vortex_private::mii_lock.
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24cd804d
  8. 26 8月, 2010 1 次提交
  9. 24 8月, 2010 1 次提交
    • N
      3c59x: Fix deadlock between boomerang_interrupt and boomerang_start_tx · aa25ab7d
      Neil Horman 提交于
      If netconsole is in use, there is a possibility for deadlock in 3c59x between
      boomerang_interrupt and boomerang_start_xmit.  Both routines take the vp->lock,
      and if netconsole is in use, a pr_* call from the boomerang_interrupt routine
      will result in the netconsole code attempting to trnasmit an skb, which can try
      to take the same spin lock, resulting in deadlock.
      
      The fix is pretty straightforward.  This patch allocats a bit in the 3c59x
      private structure to indicate that its handling an interrupt.  If we get into
      the transmit routine and that bit is set, we can be sure that we have recursed
      and will deadlock if we continue, so instead we just return NETDEV_TX_BUSY, so
      the stack requeues the skb to try again later.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa25ab7d
  10. 26 7月, 2010 1 次提交
  11. 24 7月, 2010 2 次提交
  12. 23 7月, 2010 1 次提交
  13. 30 6月, 2010 1 次提交
  14. 29 6月, 2010 1 次提交
    • B
      3c59x: Specify window explicitly for access to windowed registers · a095cfc4
      Ben Hutchings 提交于
      Currently much of the code assumes that a specific window has been
      selected, while a few functions save and restore the window.  This
      makes it impossible to introduce fine-grained locking.
      
      Make those assumptions explicit by introducing wrapper functions
      to set the window and read/write a register.  Use these everywhere
      except vortex_interrupt(), vortex_start_xmit() and vortex_rx().
      These set the window just once, or not at all in the case of
      vortex_rx() as it should always be called from vortex_interrupt().
      
      Cache the current window in struct vortex_private to avoid
      unnecessary hardware writes.
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Tested-by: Arne Nordmark <nordmark@mech.kth.se> [against 2.6.32]
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a095cfc4
  15. 14 5月, 2010 1 次提交
    • J
      drivers/net: Remove unnecessary returns from void function()s · a4b77097
      Joe Perches 提交于
      This patch removes from drivers/net/ all the unnecessary
      return; statements that precede the last closing brace of
      void functions.
      
      It does not remove the returns that are immediately
      preceded by a label as gcc doesn't like that.
      
      It also does not remove null void functions with return.
      
      Done via:
      $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
        xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'
      
      with some cleanups by hand.
      
      Compile tested x86 allmodconfig only.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a4b77097
  16. 10 5月, 2010 1 次提交
  17. 15 4月, 2010 1 次提交
  18. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  19. 19 2月, 2010 1 次提交
  20. 08 1月, 2010 1 次提交
  21. 16 12月, 2009 1 次提交
  22. 04 12月, 2009 1 次提交
  23. 14 10月, 2009 1 次提交
  24. 01 10月, 2009 1 次提交
  25. 25 9月, 2009 1 次提交
    • A
      3c59x: Get rid of "Trying to free already-free IRQ" · 704cc92e
      Anton Vorontsov 提交于
      Following trace pops up if we try to suspend with 3c59x ethernet NIC
      brought down:
      
        root@b1:~# ifconfig eth16 down
        root@b1:~# echo mem > /sys/power/state
        ...
        3c59x 0000:00:10.0: suspend
        3c59x 0000:00:10.0: PME# disabled
        Trying to free already-free IRQ 48
        ------------[ cut here ]------------
        Badness at c00554e4 [verbose debug info unavailable]
        NIP: c00554e4 LR: c00554e4 CTR: c019a098
        REGS: c7975c60 TRAP: 0700   Not tainted  (2.6.31-rc4)
        MSR: 00021032 <ME,CE,IR,DR>  CR: 28242422  XER: 20000000
        TASK = c79cb0c0[1746] 'bash' THREAD: c7974000
        ...
        NIP [c00554e4] __free_irq+0x108/0x1b0
        LR [c00554e4] __free_irq+0x108/0x1b0
        Call Trace:
        [c7975d10] [c00554e4] __free_irq+0x108/0x1b0 (unreliable)
        [c7975d30] [c005559c] free_irq+0x10/0x24
        [c7975d40] [c01e21ec] vortex_suspend+0x70/0xc4
        [c7975d60] [c017e584] pci_legacy_suspend+0x58/0x100
      
      This is because the driver manages interrupts without checking for
      netif_running().
      
      Though, there are few other issues with suspend/resume in this driver.
      The intention of calling free_irq() in suspend() was to avoid any
      possible spurious interrupts (see commit 5b039e68
      "3c59x PM fixes"). But,
      
      - On resume, the driver was requesting IRQ just after pci_set_master(),
        but before vortex_up() (which actually resets 3c59x chips).
      
      - Issuing free_irq() on a shared IRQ doesn't guarantee that a buggy
        HW won't trigger spurious interrupts in another driver that
        requested the same interrupt. So, if we want to protect from
        unexpected interrupts, then on suspend we should issue disable_irq(),
        not free_irq().
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      704cc92e
  26. 01 9月, 2009 1 次提交
  27. 06 8月, 2009 1 次提交
  28. 04 8月, 2009 1 次提交
    • J
      3c59x: Fix build failure with gcc 3.2 · 0cb13536
      Jean Delvare 提交于
      Fix the following build failure with gcc 3.2:
      
        CC [M]  drivers/net/3c59x.o
      drivers/net/3c59x.c:2726:1: directives may not be used inside a macro argument
      drivers/net/3c59x.c:2725:59: unterminated argument list invoking macro "pr_err"
      drivers/net/3c59x.c: In function `dump_tx_ring':
      drivers/net/3c59x.c:2727: implicit declaration of function `pr_err'
      drivers/net/3c59x.c:2731: syntax error before ')' token
      
      Apparently gcc 3.2 doesn't like #if interleaved with a macro call.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0cb13536
  29. 06 7月, 2009 1 次提交
  30. 13 6月, 2009 1 次提交
  31. 27 5月, 2009 1 次提交
  32. 27 2月, 2009 1 次提交
  33. 22 1月, 2009 1 次提交
  34. 11 1月, 2009 1 次提交
  35. 13 11月, 2008 1 次提交
    • W
      netdevice: safe convert to netdev_priv() #part-1 · 454d7c9b
      Wang Chen 提交于
      We have some reasons to kill netdev->priv:
      1. netdev->priv is equal to netdev_priv().
      2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
         netdev_priv() is more flexible than netdev->priv.
      But we cann't kill netdev->priv, because so many drivers reference to it
      directly.
      
      This patch is a safe convert for netdev->priv to netdev_priv(netdev).
      Since all of the netdev->priv is only for read.
      But it is too big to be sent in one mail.
      I split it to 4 parts and make every part smaller than 100,000 bytes,
      which is max size allowed by vger.
      Signed-off-by: NWang Chen <wangchen@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      454d7c9b
  36. 11 11月, 2008 1 次提交
  37. 04 11月, 2008 1 次提交
  38. 28 10月, 2008 1 次提交
  39. 16 10月, 2008 1 次提交