1. 24 Aug, 2010 6 commits
    • Anton Vorontsov's avatar
      phylib: Fix race between returning phydev and calling adjust_link · ef24b16b
      Anton Vorontsov authored
      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: default avatarAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef24b16b
    • Heiko Carstens's avatar
      caif-driver: add HAS_DMA dependency · 9dc002d8
      Heiko Carstens authored
      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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9dc002d8
    • Neil Horman's avatar
      3c59x: Fix deadlock between boomerang_interrupt and boomerang_start_tx · aa25ab7d
      Neil Horman authored
      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: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa25ab7d
    • Yinglin Luan's avatar
      qlcnic: fix poll implementation · bf82791e
      Yinglin Luan authored
      Function qlcnic_intr has pointer to qlcnic_host_sds_ring
      as second parameter not pointer to qlcnic_adapter.
      Signed-off-by: default avatarYinglin Luan <synmyth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf82791e
    • Yinglin Luan's avatar
      netxen: fix poll implementation · 7b589a35
      Yinglin Luan authored
      Function netxen_intr has pointer to nx_host_sds_ring
      as second parameter not pointer to netxen_adapter.
      Signed-off-by: default avatarYinglin Luan <synmyth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b589a35
    • Changli Gao's avatar
      bridge: netfilter: fix a memory leak · 4c3a76ab
      Changli Gao authored
      nf_bridge_alloc() always reset the skb->nf_bridge, so we should always
      put the old one.
      Signed-off-by: default avatarChangli Gao <xiaosuo@gmail.com>
      Signed-off-by: default avatarBart De Schuymer <bdschuym@pandora.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c3a76ab
  2. 23 Aug, 2010 3 commits
  3. 19 Aug, 2010 19 commits
  4. 18 Aug, 2010 3 commits
  5. 17 Aug, 2010 4 commits
    • Eric Dumazet's avatar
      net sched: fix some kernel memory leaks · 1c40be12
      Eric Dumazet authored
      We leak at least 32bits of kernel memory to user land in tc dump,
      because we dont init all fields (capab ?) of the dumped structure.
      
      Use C99 initializers so that holes and non explicit fields are zeroed.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c40be12
    • Eric Dumazet's avatar
      netfilter: {ip,ip6,arp}_tables: avoid lockdep false positive · 001389b9
      Eric Dumazet authored
      After commit 24b36f01 (netfilter: {ip,ip6,arp}_tables: dont block
      bottom half more than necessary), lockdep can raise a warning
      because we attempt to lock a spinlock with BH enabled, while
      the same lock is usually locked by another cpu in a softirq context.
      
      Disable again BH to avoid these lockdep warnings.
      Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Diagnosed-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      001389b9
    • Johannes Berg's avatar
      iwlwifi: fix 3945 filter flags · 8b8ab9d5
      Johannes Berg authored
      Applying the filter flags directly as done since
      
      commit 3474ad63
      Author: Johannes Berg <johannes.berg@intel.com>
      Date:   Thu Apr 29 04:43:05 2010 -0700
      
          iwlwifi: apply filter flags directly
      
      broke 3945 under some unknown circumstances, as
      reported by Alex.
      
      Since I want to keep the direct application of
      filter flags on iwlagn, duplicate the code into
      both 3945 and agn and remove committing the
      RXON that broke things from the 3945 version.
      
      Cc: stable@kernel.org [2.6.35]
      Reported-by: default avatarAlex Romosan <romosan@sycorax.lbl.gov>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      8b8ab9d5
    • John W. Linville's avatar
      ipw2100: don't sync status queue entries · c206a04f
      John W. Linville authored
      These are allocated with pci_alloc_consistent, so calling
      pci_dma_sync_single_for_cpu is incorrect usage of the API.  Remove this
      misuse and consequently avoid the following backtrace:
      
      WARNING: at lib/dma-debug.c:902 check_sync+0xce/0x43a()
      Hardware name: 2373HU6
      ipw2100 0000:02:02.0: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x0000000034e88008] [size=8 bytes]
      Modules linked in: microcode ipw2100(+) snd_seq_device ppdev libipw nsc_ircc snd_pcm lib80211 video output irda parport_pc cfg80211 parport thinkpad_acpi e1000 iTCO_wdt crc_ccitt snd_timer iTCO_vendor_support snd i2c_i801 pcspkr rfkill soundcore joydev snd_page_alloc yenta_socket radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
      Pid: 0, comm: swapper Tainted: G        W   2.6.35-wl+ #8
      Call Trace:
       [<c043aa42>] warn_slowpath_common+0x6a/0x7f
       [<c05d252a>] ? check_sync+0xce/0x43a
       [<c043aaca>] warn_slowpath_fmt+0x2b/0x2f
       [<c05d252a>] check_sync+0xce/0x43a
       [<c046189a>] ? print_lock_contention_bug+0x11/0xb2
       [<c05d2b6f>] debug_dma_sync_single_for_cpu+0x47/0x49
       [<c06cbd3c>] ? ehci_irq+0x31/0x331
       [<f82a224a>] ? ipw2100_irq_tasklet+0x24/0x5e9 [ipw2100]
       [<f82a224a>] ? ipw2100_irq_tasklet+0x24/0x5e9 [ipw2100]
       [<f82a221d>] pci_dma_sync_single_for_cpu.clone.1+0x42/0x4b [ipw2100]
       [<f82a23a2>] ipw2100_irq_tasklet+0x17c/0x5e9 [ipw2100]
       [<c043fd87>] tasklet_action+0x78/0xcb
       [<c0440293>] __do_softirq+0xc4/0x183
       [<c044038d>] do_softirq+0x3b/0x5f
       [<c04404d0>] irq_exit+0x3a/0x6d
       [<c0404423>] do_IRQ+0x8b/0x9f
       [<c04038b5>] common_interrupt+0x35/0x3c
       [<c062ecfa>] ? acpi_idle_enter_simple+0xfe/0x13c
       [<c045007b>] ? exit_itimers+0x2d/0x73
       [<c062ecfc>] ? acpi_idle_enter_simple+0x100/0x13c
       [<c070bf10>] cpuidle_idle_call+0x78/0xdc
       [<c040251c>] cpu_idle+0x9b/0xb7
       [<c07b1dd2>] rest_init+0xa6/0xab
       [<c0a4b96d>] start_kernel+0x389/0x38e
       [<c0a4b0c9>] i386_start_kernel+0xc9/0xd0
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      c206a04f
  6. 16 Aug, 2010 2 commits
  7. 15 Aug, 2010 2 commits
  8. 14 Aug, 2010 1 commit
    • Wey-Yi Guy's avatar
      iwlwifi: use long monitor timer to avoid un-necessary reload · 3198c68c
      Wey-Yi Guy authored
      For 5000 and 6000g2b series of devices, use long monitor timer to check
      stuck tx queues.
      
      .6000g2b series device, it is WiFi/BT combo device, there are some cases,
      tx queues are not move for a period of time because the WiFi/BT coex.
      
      .5000 series device, it is being reported firmware got reload more
      often than necessary, so extend the timer to avoid un-necessary reload.
      Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
      3198c68c