1. 02 Sep, 2010 3 commits
    • Eric Dumazet's avatar
      gro: fix different skb headrooms · 3d3be433
      Eric Dumazet authored
      Packets entering GRO might have different headrooms, even for a given
      flow (because of implementation details in drivers, like copybreak).
      We cant force drivers to deliver packets with a fixed headroom.
      
      1) fix skb_segment()
      
      skb_segment() makes the false assumption headrooms of fragments are same
      than the head. When CHECKSUM_PARTIAL is used, this can give csum_start
      errors, and crash later in skb_copy_and_csum_dev()
      
      2) allocate a minimal skb for head of frag_list
      
      skb_gro_receive() uses netdev_alloc_skb(headroom + skb_gro_offset(p)) to
      allocate a fresh skb. This adds NET_SKB_PAD to a padding already
      provided by netdevice, depending on various things, like copybreak.
      
      Use alloc_skb() to allocate an exact padding, to reduce cache line
      needs:
      NET_SKB_PAD + NET_IP_ALIGN
      
      bugzilla : https://bugzilla.kernel.org/show_bug.cgi?id=16626
      
      Many thanks to Plamen Petrov, testing many debugging patches !
      With help of Jarek Poplawski.
      Reported-by: default avatarPlamen Petrov <pvp-lsts@fs.uni-ruse.bg>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: Jarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d3be433
    • David S. Miller's avatar
      bridge: Clear INET control block of SKBs passed into ip_fragment(). · 87f94b4e
      David S. Miller authored
      In a similar vain to commit 17762060
      ("bridge: Clear IPCB before possible entry into IP stack")
      
      Any time we call into the IP stack we have to make sure the state
      there is as expected by the ipv4 code.
      
      With help from Eric Dumazet and Herbert Xu.
      Reported-by: default avatarBandan Das <bandan.das@stratus.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      87f94b4e
    • Ben Hutchings's avatar
      3c59x: Remove incorrect locking; correct documented lock hierarchy · 24cd804d
      Ben Hutchings authored
      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: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      24cd804d
  2. 01 Sep, 2010 9 commits
  3. 31 Aug, 2010 5 commits
    • Luis R. Rodriguez's avatar
      ath9k_hw: fix parsing of HT40 5 GHz CTLs · 90487974
      Luis R. Rodriguez authored
      The 5 GHz CTL indexes were not being read for all hardware
      devices due to the masking out through the CTL_MODE_M mask
      being one bit too short. Without this the calibrated regulatory
      maximum values were not being picked up when devices operate
      on 5 GHz in HT40 mode. The final output power used for Atheros
      devices is the minimum between the calibrated CTL values and
      what CRDA provides.
      
      Cc: stable@kernel.org [2.6.27+]
      Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      90487974
    • Luis R. Rodriguez's avatar
      ath9k_hw: Fix EEPROM uncompress block reading on AR9003 · 803288e6
      Luis R. Rodriguez authored
      The EEPROM is compressed on AR9003, upon decompression
      the wrong upper limit was being used for the block which
      prevented the 5 GHz CTL indexes from being used, which are
      stored towards the end of the EEPROM block. This fix allows
      the actual intended regulatory limits to be used on AR9003
      hardware.
      
      Cc: stable@kernel.org [2.6.36+]
      Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      803288e6
    • John W. Linville's avatar
      wireless: register wiphy rfkill w/o holding cfg80211_mutex · c3d34d5d
      John W. Linville authored
      Otherwise lockdep complains...
      
      https://bugzilla.kernel.org/show_bug.cgi?id=17311
      
      [ INFO: possible circular locking dependency detected ]
      2.6.36-rc2-git4 #12
      -------------------------------------------------------
      kworker/0:3/3630 is trying to acquire lock:
       (rtnl_mutex){+.+.+.}, at: [<ffffffff813396c7>] rtnl_lock+0x12/0x14
      
      but task is already holding lock:
       (rfkill_global_mutex){+.+.+.}, at: [<ffffffffa014b129>]
      rfkill_switch_all+0x24/0x49 [rfkill]
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #2 (rfkill_global_mutex){+.+.+.}:
             [<ffffffff81079ad7>] lock_acquire+0x120/0x15b
             [<ffffffff813ae869>] __mutex_lock_common+0x54/0x52e
             [<ffffffff813aede9>] mutex_lock_nested+0x34/0x39
             [<ffffffffa014b4ab>] rfkill_register+0x2b/0x29c [rfkill]
             [<ffffffffa0185ba0>] wiphy_register+0x1ae/0x270 [cfg80211]
             [<ffffffffa0206f01>] ieee80211_register_hw+0x1b4/0x3cf [mac80211]
             [<ffffffffa0292e98>] iwl_ucode_callback+0x9e9/0xae3 [iwlagn]
             [<ffffffff812d3e9d>] request_firmware_work_func+0x54/0x6f
             [<ffffffff81065d15>] kthread+0x8c/0x94
             [<ffffffff8100ac24>] kernel_thread_helper+0x4/0x10
      
      -> #1 (cfg80211_mutex){+.+.+.}:
             [<ffffffff81079ad7>] lock_acquire+0x120/0x15b
             [<ffffffff813ae869>] __mutex_lock_common+0x54/0x52e
             [<ffffffff813aede9>] mutex_lock_nested+0x34/0x39
             [<ffffffffa018605e>] cfg80211_get_dev_from_ifindex+0x1b/0x7c [cfg80211]
             [<ffffffffa0189f36>] cfg80211_wext_giwscan+0x58/0x990 [cfg80211]
             [<ffffffff8139a3ce>] ioctl_standard_iw_point+0x1a8/0x272
             [<ffffffff8139a529>] ioctl_standard_call+0x91/0xa7
             [<ffffffff8139a687>] T.723+0xbd/0x12c
             [<ffffffff8139a727>] wext_handle_ioctl+0x31/0x6d
             [<ffffffff8133014e>] dev_ioctl+0x63d/0x67a
             [<ffffffff8131afd9>] sock_ioctl+0x48/0x21d
             [<ffffffff81102abd>] do_vfs_ioctl+0x4ba/0x509
             [<ffffffff81102b5d>] sys_ioctl+0x51/0x74
             [<ffffffff81009e02>] system_call_fastpath+0x16/0x1b
      
      -> #0 (rtnl_mutex){+.+.+.}:
             [<ffffffff810796b0>] __lock_acquire+0xa93/0xd9a
             [<ffffffff81079ad7>] lock_acquire+0x120/0x15b
             [<ffffffff813ae869>] __mutex_lock_common+0x54/0x52e
             [<ffffffff813aede9>] mutex_lock_nested+0x34/0x39
             [<ffffffff813396c7>] rtnl_lock+0x12/0x14
             [<ffffffffa0185cb5>] cfg80211_rfkill_set_block+0x1a/0x7b [cfg80211]
             [<ffffffffa014aed0>] rfkill_set_block+0x80/0xd5 [rfkill]
             [<ffffffffa014b07e>] __rfkill_switch_all+0x3f/0x6f [rfkill]
             [<ffffffffa014b13d>] rfkill_switch_all+0x38/0x49 [rfkill]
             [<ffffffffa014b821>] rfkill_op_handler+0x105/0x136 [rfkill]
             [<ffffffff81060708>] process_one_work+0x248/0x403
             [<ffffffff81062620>] worker_thread+0x139/0x214
             [<ffffffff81065d15>] kthread+0x8c/0x94
             [<ffffffff8100ac24>] kernel_thread_helper+0x4/0x10
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Acked-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      c3d34d5d
    • David S. Miller's avatar
      netlink: Make NETLINK_USERSOCK work again. · b963ea89
      David S. Miller authored
      Once we started enforcing the a nl_table[] entry exist for
      a protocol, NETLINK_USERSOCK stopped working.  Add a dummy
      table entry so that it works again.
      Reported-by: default avatarThomas Voegtle <tv@lio96.de>
      Tested-by: default avatarThomas Voegtle <tv@lio96.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b963ea89
    • David S. Miller's avatar
      irda: Correctly clean up self->ias_obj on irda_bind() failure. · 628e300c
      David S. Miller authored
      If irda_open_tsap() fails, the irda_bind() code tries to destroy
      the ->ias_obj object by hand, but does so wrongly.
      
      In particular, it fails to a) release the hashbin attached to the
      object and b) reset the self->ias_obj pointer to NULL.
      
      Fix both problems by using irias_delete_object() and explicitly
      setting self->ias_obj to NULL, just as irda_release() does.
      Reported-by: default avatarTavis Ormandy <taviso@cmpxchg8b.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      628e300c
  4. 30 Aug, 2010 5 commits
  5. 28 Aug, 2010 2 commits
  6. 27 Aug, 2010 1 commit
  7. 26 Aug, 2010 6 commits
  8. 25 Aug, 2010 1 commit
  9. 24 Aug, 2010 8 commits
    • Dan Carpenter's avatar
      pxa168_eth: silence gcc warnings · b2bc8563
      Dan Carpenter authored
      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: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b2bc8563
    • Dan Carpenter's avatar
      pxa168_eth: update call to phy_mii_ioctl() · 4f2c8510
      Dan Carpenter authored
      The phy_mii_ioctl() function changed recently.  It now takes a struct
      ifreq pointer directly.
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4f2c8510
    • Dan Carpenter's avatar
      pxa168_eth: fix error handling in prope · 945c7c73
      Dan Carpenter authored
      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: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      945c7c73
    • Dan Carpenter's avatar
      pxa168_eth: remove unneeded null check · 4169591f
      Dan Carpenter authored
      "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: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4169591f
    • 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