1. 31 8月, 2007 1 次提交
    • J
      request_irq: fix DEBUG_SHIRQ handling · 59845b1f
      Jarek Poplawski 提交于
      Mariusz Kozlowski reported lockdep's warning:
      
      > =================================
      > [ INFO: inconsistent lock state ]
      > 2.6.23-rc2-mm1 #7
      > ---------------------------------
      > inconsistent {in-hardirq-W} -> {hardirq-on-W} usage.
      > ifconfig/5492 [HC0[0]:SC0[0]:HE1:SE1] takes:
      >  (&tp->lock){+...}, at: [<de8706e0>] rtl8139_interrupt+0x27/0x46b [8139too]
      > {in-hardirq-W} state was registered at:
      >   [<c0138eeb>] __lock_acquire+0x949/0x11ac
      >   [<c01397e7>] lock_acquire+0x99/0xb2
      >   [<c0452ff3>] _spin_lock+0x35/0x42
      >   [<de8706e0>] rtl8139_interrupt+0x27/0x46b [8139too]
      >   [<c0147a5d>] handle_IRQ_event+0x28/0x59
      >   [<c01493ca>] handle_level_irq+0xad/0x10b
      >   [<c0105a13>] do_IRQ+0x93/0xd0
      >   [<c010441e>] common_interrupt+0x2e/0x34
      ...
      > other info that might help us debug this:
      > 1 lock held by ifconfig/5492:
      >  #0:  (rtnl_mutex){--..}, at: [<c0451778>] mutex_lock+0x1c/0x1f
      >
      > stack backtrace:
      ...
      >  [<c0452ff3>] _spin_lock+0x35/0x42
      >  [<de8706e0>] rtl8139_interrupt+0x27/0x46b [8139too]
      >  [<c01480fd>] free_irq+0x11b/0x146
      >  [<de871d59>] rtl8139_close+0x8a/0x14a [8139too]
      >  [<c03bde63>] dev_close+0x57/0x74
      ...
      
      This shows that a driver's irq handler was running both in hard interrupt
      and process contexts with irqs enabled. The latter was done during
      free_irq() call and was possible only with CONFIG_DEBUG_SHIRQ enabled.
      This was fixed by another patch.
      
      But similar problem is possible with request_irq(): any locks taken from
      irq handler could be vulnerable - especially with soft interrupts. This
      patch fixes it by disabling local interrupts during handler's run. (It
      seems, disabling softirqs should be enough, but it needs more checking
      on possible races or other special cases).
      Reported-by: NMariusz Kozlowski <m.kozlowski@tuxland.pl>
      Signed-off-by: NJarek Poplawski <jarkao2@o2.pl>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      59845b1f
  2. 23 8月, 2007 1 次提交
  3. 13 8月, 2007 2 次提交
  4. 09 8月, 2007 1 次提交
  5. 02 8月, 2007 1 次提交
    • T
      genirq: temporary fix for level-triggered IRQ resend · 0fc4969b
      Thomas Gleixner 提交于
      Marcin Slusarz reported a ne2k-pci "hung network interface" regression.
      
      delayed disable relies on the ability to re-trigger the interrupt in the
      case that a real interrupt happens after the software disable was set.
      In this case we actually disable the interrupt on the hardware level
      _after_ it occurred.
      
      On enable_irq, we need to re-trigger the interrupt. On i386 this relies
      on a hardware resend mechanism (send_IPI_self()).
      
      Actually we only need the resend for edge type interrupts. Level type
      interrupts come back once enable_irq() re-enables the interrupt line.
      
      I assume that the interrupt in question is level triggered because it is
      shared and above the legacy irqs 0-15:
      
      	17:         12   IO-APIC-fasteoi   eth1, eth0
      
      Looking into the IO_APIC code, the resend via send_IPI_self() happens
      unconditionally. So the resend is done for level and edge interrupts.
      This makes the problem more mysterious.
      
      The code in question lib8390.c does
      
      	disable_irq();
      	fiddle_with_the_network_card_hardware()
      	enable_irq();
      
      The fiddle_with_the_network_card_hardware() might cause interrupts,
      which are cleared in the same code path again,
      
      Marcin found that when he disables the irq line on the hardware level
      (removing the delayed disable) the card is kept alive.
      
      So the difference is that we can get a resend on enable_irq, when an
      interrupt happens during the time, where we are in the disabled region.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0fc4969b
  6. 29 7月, 2007 1 次提交
  7. 22 7月, 2007 1 次提交
  8. 17 7月, 2007 1 次提交
    • A
      Improve behaviour of spurious IRQ detect · 4f27c00b
      Alan Cox 提交于
      Currently we handle spurious IRQ activity based upon seeing a lot of
      invalid interrupts, and we clear things back on the base of lots of valid
      interrupts.
      
      Unfortunately in some cases you get legitimate invalid interrupts caused by
      timing asynchronicity between the PCI bus and the APIC bus when disabling
      interrupts and pulling other tricks.  In this case although the spurious
      IRQs are not a problem our unhandled counters didn't clear and they act as
      a slow running timebomb.  (This is effectively what the serial port/tty
      problem that was fixed by clearing counters when registering a handler
      showed up)
      
      It's easy enough to add a second parameter - time.  This means that if we
      see a regular stream of harmless spurious interrupts which are not harming
      processing we don't go off and do something stupid like disable the IRQ
      after a month of running.  OTOH lockups and performance killers show up a
      lot more than 10/second
      
      [akpm@linux-foundation.org: cleanup]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4f27c00b
  9. 24 5月, 2007 1 次提交
    • L
      Fix crash with irqpoll due to the IRQF_IRQPOLL flag testing · 92ea7727
      Linus Torvalds 提交于
      With irqpoll enabled, trying to test the IRQF_IRQPOLL flag in the
      actions would cause a NULL pointer dereference if no action was
      installed (for example, the driver might have been unloaded with
      interrupts still pending).
      
      So be a bit more careful about testing the flag by making sure to test
      for that case.
      
      (The actual _change_ is trivial, the patch is more than a one-liner
      because I rewrote the testing to also be much more readable.
      
      Original (discarded) bugfix by Bernhard Walle.
      
      Cc: Bernhard Walle <bwalle@suse.de>
      Tested-by: NVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      92ea7727
  10. 12 5月, 2007 1 次提交
  11. 10 5月, 2007 1 次提交
  12. 09 5月, 2007 4 次提交
  13. 03 5月, 2007 1 次提交
    • M
      MSI: arch must connect the irq and the msi_desc · 7fe3730d
      Michael Ellerman 提交于
      set_irq_msi() currently connects an irq_desc to an msi_desc. The archs call
      it at some point in their setup routine, and then the generic code sets up the
      reverse mapping from the msi_desc back to the irq.
      
      set_irq_msi() should do both connections, making it the one and only call
      required to connect an irq with it's MSI desc and vice versa.
      
      The arch code MUST call set_irq_msi(), and it must do so only once it's sure
      it's not going to fail the irq allocation.
      
      Given that there's no need for the arch to return the irq anymore, the return
      value from the arch setup routine just becomes 0 for success and anything else
      for failure.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7fe3730d
  14. 08 4月, 2007 1 次提交
  15. 27 2月, 2007 1 次提交
    • E
      [PATCH] genirq: Mask irqs when migrating them. · 2a786b45
      Eric W. Biederman 提交于
      move_native_irqs tries to do the right thing when migrating irqs
      by disabling them.  However disabling them is a software logical
      thing, not a hardware thing.  This has always been a little flaky
      and after Ingo's latest round of changes it is guaranteed to not
      mask the apic.
      
      So this patch fixes move_native_irq to directly call the mask and
      unmask chip methods to guarantee that we mask the irq when we
      are migrating it.  We must do this as it is required by
      all code that call into the path.
      
      Since we don't know the masked status when IRQ_DISABLED is
      set so we will not be able to restore it.   The patch makes the code
      just give up and trying again the next time this routing is called.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2a786b45
  16. 17 2月, 2007 5 次提交
  17. 15 2月, 2007 1 次提交
  18. 13 2月, 2007 2 次提交
  19. 12 2月, 2007 2 次提交
  20. 10 2月, 2007 1 次提交
    • T
      devres: device resource management · 9ac7849e
      Tejun Heo 提交于
      Implement device resource management, in short, devres.  A device
      driver can allocate arbirary size of devres data which is associated
      with a release function.  On driver detach, release function is
      invoked on the devres data, then, devres data is freed.
      
      devreses are typed by associated release functions.  Some devreses are
      better represented by single instance of the type while others need
      multiple instances sharing the same release function.  Both usages are
      supported.
      
      devreses can be grouped using devres group such that a device driver
      can easily release acquired resources halfway through initialization
      or selectively release resources (e.g. resources for port 1 out of 4
      ports).
      
      This patch adds devres core including documentation and the following
      managed interfaces.
      
      * alloc/free	: devm_kzalloc(), devm_kzfree()
      * IO region	: devm_request_region(), devm_release_region()
      * IRQ		: devm_request_irq(), devm_free_irq()
      * DMA		: dmam_alloc_coherent(), dmam_free_coherent(),
      		  dmam_declare_coherent_memory(), dmam_pool_create(),
      		  dmam_pool_destroy()
      * PCI		: pcim_enable_device(), pcim_pin_device(), pci_is_managed()
      * iomap		: devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
      		  devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
      		  pcim_iomap(), pcim_iounmap()
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9ac7849e
  21. 08 2月, 2007 1 次提交
    • E
      msi: Kill the msi_desc array. · 5b912c10
      Eric W. Biederman 提交于
      We need to be able to get from an irq number to a struct msi_desc.
      The msi_desc array in msi.c had several short comings the big one was
      that it could not be used outside of msi.c.  Using irq_data in struct
      irq_desc almost worked except on some architectures irq_data needs to
      be used for something else.
      
      So this patch adds a msi_desc pointer to irq_desc, adds the appropriate
      wrappers and changes all of the msi code to use them.
      
      The dynamic_irq_init/cleanup code was tweaked to ensure the new
      field is left in a well defined state.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5b912c10
  22. 24 1月, 2007 1 次提交
  23. 11 1月, 2007 1 次提交
    • V
      [PATCH] x86-64: Make noirqdebug_setup function non init to fix modpost warning · 343cde51
      Vivek Goyal 提交于
      o noirqdebug_setup() is __init but it is being called by
        quirk_intel_irqbalance() which if of type __devinit. If CONFIG_HOTPLUG=y,
        quirk_intel_irqbalance() is put into text section and it is wrong to
        call a function in __init section.
      
      o MODPOST flags this on i386 if CONFIG_RELOCATABLE=y
      
      WARNING: vmlinux - Section mismatch: reference to .init.text:noirqdebug_setup from .text between 'quirk_intel_irqbalance' (at offset 0xc010969e) and 'i8237A_suspend'
      
      o Make noirqdebug_setup() non-init.
      Signed-off-by: NVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      343cde51
  24. 23 12月, 2006 1 次提交
  25. 21 12月, 2006 1 次提交
  26. 09 12月, 2006 1 次提交
    • H
      [PATCH] CPEI gets warning at kernel/irq/migration.c:27/move_masked_irq() · 6e2ac664
      Hidetoshi Seto 提交于
      While running my MCA test (hardware error injection) on 2.6.19,
      I got some warning like following:
      
      > BUG: warning at kernel/irq/migration.c:27/move_masked_irq()
      >
      > Call Trace:
      >  [<a000000100013d20>] show_stack+0x40/0xa0
      >                                 sp=e00000006b2578d0 bsp=e00000006b2510b0
      >  [<a000000100013db0>] dump_stack+0x30/0x60
      >                                 sp=e00000006b257aa0 bsp=e00000006b251098
      >  [<a0000001000de430>] move_masked_irq+0xb0/0x240
      >                                 sp=e00000006b257aa0 bsp=e00000006b251070
      >  [<a0000001000de6a0>] move_native_irq+0xe0/0x180
      >                                 sp=e00000006b257aa0 bsp=e00000006b251040
      >  [<a00000010004ff50>] iosapic_end_level_irq+0x30/0xe0
      >                                 sp=e00000006b257aa0 bsp=e00000006b251020
      >  [<a0000001000d94d0>] __do_IRQ+0x170/0x400
      >                                 sp=e00000006b257aa0 bsp=e00000006b250fd8
      >  [<a0000001000116f0>] ia64_handle_irq+0x1b0/0x260
      >                                 sp=e00000006b257aa0 bsp=e00000006b250fa8
      >  [<a00000010000c3a0>] ia64_leave_kernel+0x0/0x280
      >                                 sp=e00000006b257aa0 bsp=e00000006b250fa8
      >  [<a000000100690cf0>] _spin_unlock_irqrestore+0x30/0x60
      >                                 sp=e00000006b257c70 bsp=e00000006b250f90
      
      It comes from:
      
      [kernel/irq/migration.c]
        26         if (CHECK_IRQ_PER_CPU(desc->status)) {
        27                 WARN_ON(1);
        28                 return;
        29         }
      
      By putting some printk in kernel, I found that irqbalance is trying to
      move CPEI which is handled as PER_CPU irq. That's why.
      
      CPEI(Corrected Platform Error Interrupt) is ia64 specific irq, is
      allowed to pin to particular processor which selected by the platform, and
      even it is PER_CPU but it has set_affinity handler (=iosapic_set_affinity)
      as same as other IO-SAPIC-level interrupts. (I don't know why, but
      I guess that there would be typical situation where the handler for
      migration is needed, such as hotplug - the processor going to be
      offline/hot-removed.)
      
      To shut up this warning, there are 2 way at least:
       a) fix CPEI stuff
       b) prohibit setting affinity to PER_CPU irq
      
      I'm not sure what stuff of CPEI need to be fixed, but I think that
      returning error to attempting move PER_CPU irq is useful for all
      applications since it will never work.
      
      Following small patch takes b) style.
      It works, the warning disappeared and irqbalance still runs well.
      Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6e2ac664
  27. 08 12月, 2006 1 次提交
  28. 23 11月, 2006 1 次提交
  29. 17 11月, 2006 1 次提交
    • Z
      [PATCH] some irq_chip variables point to NULL · b86432b4
      Zhang, Yanmin 提交于
      I got an oops when booting 2.6.19-rc5-mm1 on my ia64 machine.
      
      Below is the log.
      
      Oops 11012296146944 [1]
      Modules linked in: binfmt_misc dm_mirror dm_multipath dm_mod thermal processor f
      an container button sg eepro100 e100 mii
      
      Pid: 0, CPU 0, comm:              swapper
      psr : 0000121008022038 ifs : 800000000000040b ip  : [<a0000001000e1411>]    Not
      tainted
      ip is at __do_IRQ+0x371/0x3e0
      unat: 0000000000000000 pfs : 000000000000040b rsc : 0000000000000003
      rnat: 656960155aa56aa5 bsps: a00000010058b890 pr  : 656960155aa55a65
      ldrs: 0000000000000000 ccv : 0000000000000000 fpsr: 0009804c0270033f
      csd : 0000000000000000 ssd : 0000000000000000
      b0  : a0000001000e1390 b6  : a0000001005beac0 b7  : e00000007f01aa00
      f6  : 000000000000000000000 f7  : 0ffe69090000000000000
      f8  : 1000a9090000000000000 f9  : 0ffff8000000000000000
      f10 : 1000a908ffffff6f70000 f11 : 1003e0000000000000909
      r1  : a000000100fbbff0 r2  : 0000000000010002 r3  : 0000000000010001
      r8  : fffffffffffbffff r9  : a000000100bd8060 r10 : a000000100dd83b8
      r11 : fffffffffffeffff r12 : a000000100bcbbb0 r13 : a000000100bc4000
      r14 : 0000000000010000 r15 : 0000000000010000 r16 : a000000100c01aa8
      r17 : a000000100d2c350 r18 : 0000000000000000 r19 : a000000100d2c300
      r20 : a000000100c01a88 r21 : 0000000080010100 r22 : a000000100c01ac0
      r23 : a0000001000108e0 r24 : e000000477980004 r25 : 0000000000000000
      r26 : 0000000000000000 r27 : e00000000913400c r28 : e0000004799ee51c
      r29 : e0000004778b87f0 r30 : a000000100d2c300 r31 : a00000010005c7e0
      
      Call Trace:
       [<a000000100014600>] show_stack+0x40/0xa0
                                      sp=a000000100bcb760 bsp=a000000100bc4f40
       [<a000000100014f00>] show_regs+0x840/0x880
                                      sp=a000000100bcb930 bsp=a000000100bc4ee8
       [<a000000100037fb0>] die+0x250/0x320
                                      sp=a000000100bcb930 bsp=a000000100bc4ea0
       [<a00000010005e5f0>] ia64_do_page_fault+0x8d0/0xa20
                                      sp=a000000100bcb950 bsp=a000000100bc4e50
       [<a00000010000caa0>] ia64_leave_kernel+0x0/0x290
                                      sp=a000000100bcb9e0 bsp=a000000100bc4e50
       [<a0000001000e1410>] __do_IRQ+0x370/0x3e0
                                      sp=a000000100bcbbb0 bsp=a000000100bc4df0
       [<a000000100011f50>] ia64_handle_irq+0x170/0x220
                                      sp=a000000100bcbbb0 bsp=a000000100bc4dc0
       [<a00000010000caa0>] ia64_leave_kernel+0x0/0x290
                                      sp=a000000100bcbbb0 bsp=a000000100bc4dc0
       [<a000000100012390>] ia64_pal_call_static+0x90/0xc0
                                      sp=a000000100bcbd80 bsp=a000000100bc4d78
       [<a000000100015630>] default_idle+0x90/0x160
                                      sp=a000000100bcbd80 bsp=a000000100bc4d58
       [<a000000100014290>] cpu_idle+0x1f0/0x440
                                      sp=a000000100bcbe20 bsp=a000000100bc4d18
       [<a000000100009980>] rest_init+0xc0/0xe0
                                      sp=a000000100bcbe20 bsp=a000000100bc4d00
       [<a0000001009f8ea0>] start_kernel+0x6a0/0x6c0
                                      sp=a000000100bcbe20 bsp=a000000100bc4ca0
       [<a0000001000089f0>] __end_ivt_text+0x6d0/0x6f0
                                      sp=a000000100bcbe30 bsp=a000000100bc4c00
       <0>Kernel panic - not syncing: Aiee, killing interrupt handler!
      
      The root cause is that some irq_chip variables, especially ia64_msi_chip,
      initiate their memeber end to point to NULL. __do_IRQ doesn't check
      if irq_chip->end is null and just calls it after processing the interrupt.
      
      As irq_chip->end is called at many places, so I fix it by reinitiating
      irq_chip->end to dummy_irq_chip.end, e.g., a noop function.
      Signed-off-by: NZhang Yanmin <yanmin.zhang@intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b86432b4
  30. 15 11月, 2006 1 次提交