Skip to content
  1. Feb 19, 2011
    • Thomas Gleixner's avatar
      genirq: Fixup poll handling · fa27271b
      Thomas Gleixner authored
      
      
      try_one_irq() contains redundant code and lots of useless checks for
      shared interrupts. Check for shared before setting IRQ_INPROGRESS and
      then call handle_IRQ_event() while pending. Shorter version with the
      same functionality.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      fa27271b
    • Thomas Gleixner's avatar
      genirq: Warn when handler enables interrupts · b738a50a
      Thomas Gleixner authored
      
      
      We run all handlers with interrupts disabled and expect them not to
      enable them. Warn when we catch one who does.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      b738a50a
    • Thomas Gleixner's avatar
      genirq: Plug race in report_bad_irq() · 1082687e
      Thomas Gleixner authored
      
      
      We cannot walk the action chain unlocked. Even if IRQ_INPROGRESS is
      set an action can be removed and we follow a null pointer. It's safe
      to take the lock there, because the code which removes the action will
      call synchronize_irq() which waits unlocked for IRQ_INPROGRESS going
      away.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      1082687e
    • Thomas Gleixner's avatar
      genirq: Remove redundant thread affinity setting · 2b879eaf
      Thomas Gleixner authored
      
      
      Thread affinity is already set by setup_affinity().
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      2b879eaf
    • Thomas Gleixner's avatar
      genirq: Do not copy affinity before set · 3b8249e7
      Thomas Gleixner authored
      
      
      While rumaging through arch code I found that there are a few
      workarounds which deal with the fact that the initial affinity setting
      from request_irq() copies the mask into irq_data->affinity before the
      chip code is called. In the normal path we unconditionally copy the
      mask when the chip code returns 0.
      
      Copy after the code is called and add a return code
      IRQ_SET_MASK_OK_NOCOPY for the chip functions, which prevents the
      copy. That way we see the real mask when the chip function decided to
      truncate it further as some arches do. IRQ_SET_MASK_OK is 0, which is
      the current behaviour.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      3b8249e7
    • Thomas Gleixner's avatar
      genirq: Always apply cpu online mask · 569bda8d
      Thomas Gleixner authored
      
      
      If the affinity had been set by the user, then a later request_irq()
      will honour that setting. But online cpus can have changed. So apply
      the online mask and for this case as well.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      569bda8d
    • Thomas Gleixner's avatar
      genirq: Rremove redundant check · b008207c
      Thomas Gleixner authored
      
      
      IRQ_NO_BALANCING is already checked in irq_can_set_affinity() above,
      no need to check it again.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      b008207c
    • Thomas Gleixner's avatar
      genirq: Simplify affinity related code · 1fa46f1f
      Thomas Gleixner authored
      
      
      There is lot of #ifdef CONFIG_GENERIC_PENDING_IRQ along with
      duplicated code in the irq core. Move the #ifdeffery into one place
      and cleanup the code so it's readable. No functional change.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      1fa46f1f
    • Thomas Gleixner's avatar
      genirq: Namespace cleanup · a0cd9ca2
      Thomas Gleixner authored
      
      
      The irq namespace has become quite convoluted. My bad.  Clean it up
      and deprecate the old functions. All new functions follow the scheme:
      
      irq number based:
          irq_set/get/xxx/_xxx(unsigned int irq, ...)
      
      irq_data based:
      	 irq_data_set/get/xxx/_xxx(struct irq_data *d, ....)
      
      irq_desc based:
      	 irq_desc_get_xxx(struct irq_desc *desc)
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      a0cd9ca2
    • Thomas Gleixner's avatar
      genirq: Add missing buslock to set_irq_type(), set_irq_wake() · 43abe43c
      Thomas Gleixner authored
      
      
      chips behind a slow bus cannot update the chip under desc->lock, but
      we miss the chip_buslock/chip_bus_sync_unlock() calls around the set
      type and set wake functions.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      43abe43c
    • Thomas Gleixner's avatar
      genirq: Make nr_irqs runtime expandable · e7bcecb7
      Thomas Gleixner authored
      
      
      We face more and more the requirement to expand nr_irqs at
      runtime. The reason are irq expanders which can not be detected in the
      early boot stage. So we speculate nr_irqs to have enough room. Further
      Xen needs extra irq numbers and we really want to avoid adding more
      "detection" code into the early boot. There is no real good reason why
      we need to limit nr_irqs at early boot.
      
      Allow the allocation code to expand nr_irqs. We have already 8k extra
      number space in the allocation bitmap, so lets use it.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      e7bcecb7
    • Thomas Gleixner's avatar
      Merge branch 'irq/urgent' into irq/core · 218502bf
      Thomas Gleixner authored
      
      
      Reason: Further patches are conflicting with mainline fixes
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      218502bf
    • Thomas Gleixner's avatar
      genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for now · 6d83f94d
      Thomas Gleixner authored
      With CONFIG_SHIRQ_DEBUG=y we call a newly installed interrupt handler
      in request_threaded_irq().
      
      The original implementation (commit a304e1b8) called the handler
      _BEFORE_ it was installed, but that caused problems with handlers
      calling disable_irq_nosync(). See commit 377bf1e4
      
      .
      
      It's braindead in the first place to call disable_irq_nosync in shared
      handlers, but ....
      
      Moving this call after we installed the handler looks innocent, but it
      is very subtle broken on SMP.
      
      Interrupt handlers rely on the fact, that the irq core prevents
      reentrancy.
      
      Now this debug call violates that promise because we run the handler
      w/o the IRQ_INPROGRESS protection - which we cannot apply here because
      that would result in a possibly forever masked interrupt line.
      
      A concurrent real hardware interrupt on a different CPU results in
      handler reentrancy and can lead to complete wreckage, which was
      unfortunately observed in reality and took a fricking long time to
      debug.
      
      Leave the code here for now. We want this debug feature, but that's
      not easy to fix. We really should get rid of those
      disable_irq_nosync() abusers and remove that function completely.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: stable@kernel.org # .28 -> .37
      6d83f94d
    • Thomas Gleixner's avatar
      genirq: Prevent access beyond allocated_irqs bitmap · c1ee6264
      Thomas Gleixner authored
      
      
      Lars-Peter Clausen pointed out:
      
         I stumbled upon this while looking through the existing archs using
         SPARSE_IRQ.  Even with SPARSE_IRQ the NR_IRQS is still the upper
         limit for the number of IRQs.
      
         Both PXA and MMP set NR_IRQS to IRQ_BOARD_START, with
         IRQ_BOARD_START being the number of IRQs used by the core.
      
         In various machine files the nr_irqs field of the ARM machine
         defintion struct is then set to "IRQ_BOARD_START + NR_BOARD_IRQS".
      
         As a result "nr_irqs" will greater then NR_IRQS which then again
         causes the "allocated_irqs" bitmap in the core irq code to be
         accessed beyond its size overwriting unrelated data.
      
      The core code really misses a sanity check there.
      
      This went unnoticed so far as by chance the compiler/linker places
      data behind that bitmap which gets initialized later on those affected
      platforms.
      
      So the obvious fix would be to add a sanity check in early_irq_init()
      and break all affected platforms. Though that check wants to be
      backported to stable as well, which will require to fix all known
      problematic platforms and probably some more yet not known ones as
      well. Lots of churn.
      
      A way simpler solution is to allocate a slightly larger bitmap and
      avoid the whole churn w/o breaking anything. Add a few warnings when
      an arch returns utter crap.
      
      Reported-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: stable@kernel.org # .37
      Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      c1ee6264
    • Linus Torvalds's avatar
      Merge branch 'rtc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip · 0cc9d525
      Linus Torvalds authored
      * 'rtc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        RTC: Re-enable UIE timer/polling emulation
        RTC: Revert UIE emulation removal
        RTC: Release mutex in error path of rtc_alarm_irq_enable
      0cc9d525
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · 4c3021da
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (37 commits)
        net: deinit automatic LIST_HEAD
        net: dont leave active on stack LIST_HEAD
        net: provide default_advmss() methods to blackhole dst_ops
        tg3: Restrict phy ioctl access
        drivers/net: Call netif_carrier_off at the end of the probe
        ixgbe: work around for DDP last buffer size
        ixgbe: fix panic due to uninitialised pointer
        e1000e: flush all writebacks before unload
        e1000e: check down flag in tasks
        isdn: hisax: Use l2headersize() instead of dup (and buggy) func.
        arp_notify: unconditionally send gratuitous ARP for NETDEV_NOTIFY_PEERS.
        cxgb4vf: Use defined Mailbox Timeout
        cxgb4vf: Quiesce Virtual Interfaces on shutdown ...
        cxgb4vf: Behave properly when CONFIG_DEBUG_FS isn't defined ...
        cxgb4vf: Check driver parameters in the right place ...
        pch_gbe: Fix the MAC Address load issue.
        iwlwifi: Delete iwl3945_good_plcp_health.
        net/can/softing: make CAN_SOFTING_CS depend on CAN_SOFTING
        netfilter: nf_iterate: fix incorrect RCU usage
        pch_gbe: Fix the issue that the receiving data is not normal.
        ...
      4c3021da
    • Linus Torvalds's avatar
      Merge branch 'for-linus/bugfixes' of git://xenbits.xen.org/people/ianc/linux-2.6 · a5bbef0b
      Linus Torvalds authored
      * 'for-linus/bugfixes' of git://xenbits.xen.org/people/ianc/linux-2.6:
        xen: suspend and resume system devices when running PVHVM
      a5bbef0b
    • Linus Torvalds's avatar
      Merge branch 'fixes-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · bc3adfc6
      Linus Torvalds authored
      * 'fixes-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: make sure MAYDAY_INITIAL_TIMEOUT is at least 2 jiffies long
        workqueue, freezer: unify spelling of 'freeze' + 'able' to 'freezable'
        workqueue: wake up a worker when a rescuer is leaving a gcwq
      bc3adfc6
    • Eric Dumazet's avatar
      net: deinit automatic LIST_HEAD · ceaaec98
      Eric Dumazet authored
      commit 9b5e383c
      
       (net: Introduce
      unregister_netdevice_many()) left an active LIST_HEAD() in
      rollback_registered(), with possible memory corruption.
      
      Even if device is freed without touching its unreg_list (and therefore
      touching the previous memory location holding LISTE_HEAD(single), better
      close the bug for good, since its really subtle.
      
      (Same fix for default_device_exit_batch() for completeness)
      
      Reported-by: default avatarMichal Hocko <mhocko@suse.cz>
      Tested-by: default avatarMichal Hocko <mhocko@suse.cz>
      Reported-by: default avatarEric W. Biderman <ebiderman@xmission.com>
      Tested-by: default avatarEric W. Biderman <ebiderman@xmission.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Octavian Purdila <opurdila@ixiacom.com>
      CC: stable <stable@kernel.org> [.33+]
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ceaaec98
    • Linus Torvalds's avatar
      net: dont leave active on stack LIST_HEAD · f87e6f47
      Linus Torvalds authored
      Eric W. Biderman and Michal Hocko reported various memory corruptions
      that we suspected to be related to a LIST head located on stack, that
      was manipulated after thread left function frame (and eventually exited,
      so its stack was freed and reused).
      
      Eric Dumazet suggested the problem was probably coming from commit
      44345724
      
       (net: factorize
      sync-rcu call in unregister_netdevice_many)
      
      This patch fixes __dev_close() and dev_close() to properly deinit their
      respective LIST_HEAD(single) before exiting.
      
      References: https://lkml.org/lkml/2011/2/16/304
      References: https://lkml.org/lkml/2011/2/14/223
      
      Reported-by: default avatarMichal Hocko <mhocko@suse.cz>
      Tested-by: default avatarMichal Hocko <mhocko@suse.cz>
      Reported-by: default avatarEric W. Biderman <ebiderman@xmission.com>
      Tested-by: default avatarEric W. Biderman <ebiderman@xmission.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Octavian Purdila <opurdila@ixiacom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f87e6f47
    • Eric Dumazet's avatar
      net: provide default_advmss() methods to blackhole dst_ops · 214f45c9
      Eric Dumazet authored
      Commit 0dbaee3b
      
       (net: Abstract default ADVMSS behind an
      accessor.) introduced a possible crash in tcp_connect_init(), when
      dst->default_advmss() is called from dst_metric_advmss()
      
      Reported-by: default avatarGeorge Spelvin <linux@horizon.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      214f45c9
    • Linus Torvalds's avatar
      Expand CONFIG_DEBUG_LIST to several other list operations · 3c18d4de
      Linus Torvalds authored
      
      
      When list debugging is enabled, we aim to readably show list corruption
      errors, and the basic list_add/list_del operations end up having extra
      debugging code in them to do some basic validation of the list entries.
      
      However, "list_del_init()" and "list_move[_tail]()" ended up avoiding
      the debug code due to how they were written. This fixes that.
      
      So the _next_ time we have list_move() problems with stale list entries,
      we'll hopefully have an easier time finding them..
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3c18d4de
  2. Feb 18, 2011
  3. Feb 17, 2011