1. 08 9月, 2010 3 次提交
    • 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
    • J
      bonding: Fix jiffies overflow problems (again) · cb32f2a0
      Jiri Bohac 提交于
      The time_before_eq()/time_after_eq() functions operate on unsigned
      long and only work if the difference between the two compared values
      is smaller than half the range of unsigned long (31 bits on i386).
      
      Some of the variables (slave->jiffies, dev->trans_start, dev->last_rx)
      used by bonding store a copy of jiffies and may not be updated for a
      long time. With HZ=1000, time_before_eq()/time_after_eq() will start
      giving bad results after ~25 days.
      
      jiffies will never be before slave->jiffies, dev->trans_start,
      dev->last_rx by more than possibly a couple ticks caused by preemption
      of this code. This allows us to detect/prevent these overflows by
      replacing time_before_eq()/time_after_eq() with time_in_range().
      Signed-off-by: NJiri Bohac <jbohac@suse.cz>
      Signed-off-by: NJean Delvare <jdelvare@suse.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cb32f2a0
    • G
      stmmac: fix sleep inside atomic · c4433be6
      Giuseppe Cavallaro 提交于
      We cannot use spinlock when kmalloc is invoked with
      GFP_KERNEL flag because it can sleep.
      So this patch reviews the usage of spinlock within the
      stmmac_resume function avoing this bug.
      Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Reported-by: NJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4433be6
  2. 04 9月, 2010 3 次提交
  3. 03 9月, 2010 1 次提交
  4. 02 9月, 2010 4 次提交
  5. 01 9月, 2010 2 次提交
  6. 31 8月, 2010 2 次提交
  7. 29 8月, 2010 1 次提交
  8. 28 8月, 2010 1 次提交
  9. 27 8月, 2010 1 次提交
  10. 25 8月, 2010 6 次提交
    • D
      pxa168_eth: silence gcc warnings · b2bc8563
      Dan Carpenter 提交于
      Casting "pep->tx_desc_dma" to to a struct tx_desc pointer makes gcc
      complain:
      
      drivers/net/pxa168_eth.c:657: warning:
      	cast to pointer from integer of different size
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b2bc8563
    • D
      pxa168_eth: update call to phy_mii_ioctl() · 4f2c8510
      Dan Carpenter 提交于
      The phy_mii_ioctl() function changed recently.  It now takes a struct
      ifreq pointer directly.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f2c8510
    • D
      pxa168_eth: fix error handling in prope · 945c7c73
      Dan Carpenter 提交于
      A couple issues here:
      * Some resources weren't released.
      * If alloc_etherdev() failed it would have caused a NULL dereference
        because "pep" would be null when we checked "if (pep->clk)".
      * Also it's better to propagate the error codes from mdiobus_register()
        instead of just returning -ENOMEM.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      945c7c73
    • D
      pxa168_eth: remove unneeded null check · 4169591f
      Dan Carpenter 提交于
      "pep->pd" isn't checked consistently in this function.  For example it's
      dereferenced unconditionally on the next line after the end of the if
      condition.  This function is only called from pxa168_eth_probe() and
      pep->pd is always non-NULL so I removed the check.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4169591f
    • A
      phylib: Fix race between returning phydev and calling adjust_link · ef24b16b
      Anton Vorontsov 提交于
      It is possible that phylib will call adjust_link before returning
      from {,of_}phy_connect(), which may cause the following [very rare,
      though] oops upon reopening the device:
      
        Unable to handle kernel paging request for data at address 0x0000024c
        Oops: Kernel access of bad area, sig: 11 [#1]
        PREEMPT SMP NR_CPUS=2 LTT NESTING LEVEL : 0
        P1021 RDB
        Modules linked in:
        NIP: c0345dac LR: c0345dac CTR: c0345d84
        TASK = dffab6b0[30] 'events/0' THREAD: c0d24000 CPU: 0
        [...]
        NIP [c0345dac] adjust_link+0x28/0x19c
        LR [c0345dac] adjust_link+0x28/0x19c
        Call Trace:
        [c0d25f00] [000045e1] 0x45e1 (unreliable)
        [c0d25f30] [c036c158] phy_state_machine+0x3ac/0x554
        [...]
      
      Here is why. Drivers store phydev in their private structures, e.g.
      gianfar driver:
      
      static int init_phy(struct net_device *dev)
      {
      	...
      	priv->phydev = of_phy_connect(...);
      	...
      }
      
      So that adjust_link could retrieve it back:
      
      static void adjust_link(struct net_device *dev)
      {
      	...
      	struct phy_device *phydev = priv->phydev;
      	...
      }
      
      If the device has been opened before, then phydev->state is set to
      PHY_HALTED (or undefined if the driver didn't call phy_stop()).
      
      Now, phy_connect starts the PHY state machine before returning phydev to
      the driver:
      
      	phy_start_machine(phydev, NULL);
      
      	if (phydev->irq > 0)
      		phy_start_interrupts(phydev);
      
      	return phydev;
      
      The time between 'phy_start_machine()' and 'return phydev' is undefined.
      The start machine routine delays execution for 1 second, which is enough
      for most cases. But under heavy load, or if you're unlucky, it is quite
      possible that PHY state machine will execute before phy_connect()
      returns, and so adjust_link callback will try to dereference phydev,
      which is not yet ready.
      
      To fix the issue, simply initialize the PHY's state to PHY_READY during
      phy_attach(). This will ensure that phylib won't call adjust_link before
      phy_start().
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef24b16b
    • H
      caif-driver: add HAS_DMA dependency · 9dc002d8
      Heiko Carstens 提交于
      Fix this error on an s390 allyesconfig build:
      
      linux-2.6/drivers/net/caif/caif_spi.c:98:
          undefined reference to `dma_free_coherent'
      
      Cc: Sjur Braendeland <sjur.brandeland@stericsson.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9dc002d8
  11. 24 8月, 2010 3 次提交
  12. 23 8月, 2010 1 次提交
    • R
      isdn/avm: fix build when PCMCIA is not enabled · 6a6d01d3
      Randy Dunlap 提交于
      Why wouldn't kconfig symbol ISDN_DRV_AVMB1_B1PCMCIA also depend on
      PCMCIA?
      
      Fix build for PCMCIA not enabled:
      
      ERROR: "b1_free_card" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1ctl_proc_fops" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_reset_ctr" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_load_firmware" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_send_message" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_release_appl" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_register_appl" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_getrevision" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_detect" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_interrupt" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_alloc_card" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Carsten Paeth <calle@calle.de>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a6d01d3
  13. 20 8月, 2010 2 次提交
  14. 19 8月, 2010 10 次提交