Skip to content
  1. Jan 04, 2012
  2. Dec 24, 2011
  3. Dec 23, 2011
  4. Dec 22, 2011
    • Srivatsa S. Bhat's avatar
      VFS: Fix race between CPU hotplug and lglocks · e30e2fdf
      Srivatsa S. Bhat authored
      Currently, the *_global_[un]lock_online() routines are not at all synchronized
      with CPU hotplug. Soft-lockups detected as a consequence of this race was
      reported earlier at https://lkml.org/lkml/2011/8/24/185
      
      . (Thanks to Cong Meng
      for finding out that the root-cause of this issue is the race condition
      between br_write_[un]lock() and CPU hotplug, which results in the lock states
      getting messed up).
      
      Fixing this race by just adding {get,put}_online_cpus() at appropriate places
      in *_global_[un]lock_online() is not a good option, because, then suddenly
      br_write_[un]lock() would become blocking, whereas they have been kept as
      non-blocking all this time, and we would want to keep them that way.
      
      So, overall, we want to ensure 3 things:
      1. br_write_lock() and br_write_unlock() must remain as non-blocking.
      2. The corresponding lock and unlock of the per-cpu spinlocks must not happen
         for different sets of CPUs.
      3. Either prevent any new CPU online operation in between this lock-unlock, or
         ensure that the newly onlined CPU does not proceed with its corresponding
         per-cpu spinlock unlocked.
      
      To achieve all this:
      (a) We introduce a new spinlock that is taken by the *_global_lock_online()
          routine and released by the *_global_unlock_online() routine.
      (b) We register a callback for CPU hotplug notifications, and this callback
          takes the same spinlock as above.
      (c) We maintain a bitmap which is close to the cpu_online_mask, and once it is
          initialized in the lock_init() code, all future updates to it are done in
          the callback, under the above spinlock.
      (d) The above bitmap is used (instead of cpu_online_mask) while locking and
          unlocking the per-cpu locks.
      
      The callback takes the spinlock upon the CPU_UP_PREPARE event. So, if the
      br_write_lock-unlock sequence is in progress, the callback keeps spinning,
      thus preventing the CPU online operation till the lock-unlock sequence is
      complete. This takes care of requirement (3).
      
      The bitmap that we maintain remains unmodified throughout the lock-unlock
      sequence, since all updates to it are managed by the callback, which takes
      the same spinlock as the one taken by the lock code and released only by the
      unlock routine. Combining this with (d) above, satisfies requirement (2).
      
      Overall, since we use a spinlock (mentioned in (a)) to prevent CPU hotplug
      operations from racing with br_write_lock-unlock, requirement (1) is also
      taken care of.
      
      By the way, it is to be noted that a CPU offline operation can actually run
      in parallel with our lock-unlock sequence, because our callback doesn't react
      to notifications earlier than CPU_DEAD (in order to maintain our bitmap
      properly). And this means, since we use our own bitmap (which is stale, on
      purpose) during the lock-unlock sequence, we could end up unlocking the
      per-cpu lock of an offline CPU (because we had locked it earlier, when the
      CPU was online), in order to satisfy requirement (2). But this is harmless,
      though it looks a bit awkward.
      
      Debugged-by: default avatarCong Meng <mc@linux.vnet.ibm.com>
      Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: stable@vger.kernel.org
      e30e2fdf
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · ecefc36b
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        net: Add a flow_cache_flush_deferred function
        ipv4: reintroduce route cache garbage collector
        net: have ipconfig not wait if no dev is available
        sctp: Do not account for sizeof(struct sk_buff) in estimated rwnd
        asix: new device id
        davinci-cpdma: fix locking issue in cpdma_chan_stop
        sctp: fix incorrect overflow check on autoclose
        r8169: fix Config2 MSIEnable bit setting.
        llc: llc_cmsg_rcv was getting called after sk_eat_skb.
        net: bpf_jit: fix an off-one bug in x86_64 cond jump target
        iwlwifi: update SCD BC table for all SCD queues
        Revert "Bluetooth: Revert: Fix L2CAP connection establishment"
        Bluetooth: Clear RFCOMM session timer when disconnecting last channel
        Bluetooth: Prevent uninitialized data access in L2CAP configuration
        iwlwifi: allow to switch to HT40 if not associated
        iwlwifi: tx_sync only on PAN context
        mwifiex: avoid double list_del in command cancel path
        ath9k: fix max phy rate at rate control init
        nfc: signedness bug in __nci_request()
        iwlwifi: do not set the sequence control bit is not needed
      ecefc36b
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · d5ed5e48
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: atmel/ac97c: using software reset instead hardware reset if not available
      d5ed5e48
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 · 0703c680
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
        mfd: Include linux/io.h to jz4740-adc
        mfd: Use request_threaded_irq for twl4030-irq instead of irq_set_chained_handler
        mfd: Base interrupt for twl4030-irq must be one-shot
        mfd: Handle tps65910 clear-mask correctly
        mfd: add #ifdef CONFIG_DEBUG_FS guard for ab8500_debug_resources
        mfd: Fix twl-core oops while calling twl_i2c_* for unbound driver
        mfd: include linux/module.h for ab5500-debugfs
        mfd: Update wm8994 active device checks for WM1811
        mfd: Set tps6586x bits if new value is different from the old one
        mfd: Set da903x bits if new value is different from the old one
        mfd: Set adp5520 bits if new value is different from the old one
        mfd: Add missed free_irq in da903x_remove
      0703c680
    • Dave Kleikamp's avatar
      vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL · e6f67b8c
      Dave Kleikamp authored
      
      
      lockdep reports a deadlock in jfs because a special inode's rw semaphore
      is taken recursively.  The mapping's gfp mask is GFP_NOFS, but is not
      used when __read_cache_page() calls add_to_page_cache_lru().
      
      Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e6f67b8c
    • Greg Kroah-Hartman's avatar
      Merge branch 'for-greg' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus · 341f5b10
      Greg Kroah-Hartman authored
      * 'for-greg' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb:
        usb: gadget: epautoconf: do not change number of streams
        usb: dwc3: core: fix cached revision on our structure
        usb: musb: fix reset issue with full speed device
      341f5b10
    • David Miller's avatar
      USB: Fix usb/isp1760 build on sparc · abf058e1
      David Miller authored
      
      
      This commit:
      
      commit 8f5d6215
      Author: Joachim Foerster <joachim.foerster@missinglinkelectronics.com>
      Date:   Mon Oct 10 18:06:54 2011 +0200
      
          usb/isp1760: Let OF bindings depend on general CONFIG_OF instead of PPC_OF .
      
          To be able to use the driver on other OF-aware architectures, too.
          And add necessary OF related #includes to fix compilation error.
      
      Signed-off-by: default avatarJoachim Foerster <joachim.foerster@missinglinkelectronics.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      enabled the build on all CONFIG_OF architectures, but it cannot do
      this.
      
      This driver depends upon CONFIG_OF_IRQ but not all CONFIG_OF platforms
      support that infrastructure, in particular Sparc does not so the
      build fails.
      
      Please push a patch like the following to Linus so that this code only
      gets built where it actually should.
      
      --------------------
      usb/isp1760: Add missing CONFIG_OF_IRQ dependency on OF code.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      abf058e1
    • Steffen Klassert's avatar
      net: Add a flow_cache_flush_deferred function · c0ed1c14
      Steffen Klassert authored
      
      
      flow_cach_flush() might sleep but can be called from
      atomic context via the xfrm garbage collector. So add
      a flow_cache_flush_deferred() function and use this if
      the xfrm garbage colector is invoked from within the
      packet path.
      
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Acked-by: default avatarTimo Teräs <timo.teras@iki.fi>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c0ed1c14
    • Eric Dumazet's avatar
      ipv4: reintroduce route cache garbage collector · 9f28a2fc
      Eric Dumazet authored
      
      
      Commit 2c8cec5c (ipv4: Cache learned PMTU information in inetpeer)
      removed IP route cache garbage collector a bit too soon, as this gc was
      responsible for expired routes cleanup, releasing their neighbour
      reference.
      
      As pointed out by Robert Gladewitz, recent kernels can fill and exhaust
      their neighbour cache.
      
      Reintroduce the garbage collection, since we'll have to wait our
      neighbour lookups become refcount-less to not depend on this stuff.
      
      Reported-by: default avatarRobert Gladewitz <gladewitz@gmx.de>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f28a2fc
    • John W. Linville's avatar
      Merge branch 'master' of... · b4949b84
      John W. Linville authored
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
      b4949b84
  5. Dec 21, 2011