1. 02 12月, 2008 1 次提交
  2. 13 11月, 2008 1 次提交
    • M
      genirq: __irq_set_trigger: change pr_warning to pr_debug · 3ff68a6a
      Mark Nelson 提交于
      Commit 0c5d1eb7 (genirq: record trigger
      type) caused powerpc platforms that had no set_type() function in their
      struct irq_chip to spew out warnings about "No set_type function for
      IRQ...". This warning isn't necessarily justified though because the
      generic powerpc platform code calls set_irq_type() (which in turn calls
      __irq_set_trigger) with information from the device tree to establish
      the interrupt mappings, regardless of whether the PIC can actually set
      a type.
      
      A platform's irq_chip might not have a set_type function for a variety
      of reasons, for example: the platform may have the type essentially
      hard-coded, or as in the case for Cell interrupts are just messages
      past around that have no real concept of type, or the platform
      could even have a virtual PIC as on the PS3.
      Signed-off-by: NMark Nelson <markn@au1.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3ff68a6a
  3. 10 11月, 2008 3 次提交
  4. 16 10月, 2008 8 次提交
  5. 02 10月, 2008 1 次提交
    • D
      genirq: record trigger type · 0c5d1eb7
      David Brownell 提交于
      Genirq hasn't previously recorded the trigger type used by any given IRQ,
      although some irq_chip support has done so.  That data can be useful when
      troubleshooting.  This patch records it in the relevant irq_desc.status
      bits, and improves consistency between the two driver-visible calls
      affected:
      
       - Make set_irq_type() usage match request_irq() usage:
          * IRQ_TYPE_NONE should be a NOP; succeed, so irq_chip methods
            won't have to handle that case any more (many do it wrong).
          * IRQ_TYPE_PROBE is ignored; any buggy out-of-tree callers
            might need to switch over to the real IRQ probing code.
          * emit the same diagnostics (from shared utility code)
      
       - Their kerneldoc now reflects usage:
          * request_irq() flags include IRQF_TRIGGER_* to specify
            active edge(s)/level ... docs previously omitted that
          * set_irq_type() is declared in <linux/irq.h> so callers
            should use the (bit-equivalent) IRQ_TYPE_* symbols there
      
      Also: adds a warning about shared IRQs that don't end up using the
      requested trigger mode; and fix an unrelated "sparse" warning.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0c5d1eb7
  6. 07 9月, 2008 1 次提交
  7. 22 8月, 2008 1 次提交
    • A
      genirq: fix irq_desc->depth handling with DEBUG_SHIRQ · 377bf1e4
      Anton Vorontsov 提交于
      When DEBUG_SHIRQ is selected, a spurious IRQ is issued before
      the setup_irq() initializes the desc->depth. An IRQ handler may
      call disable_irq_nosync(), but then setup_irq() will overwrite
      desc->depth, and upon enable_irq() we'll catch this WARN:
      
      ------------[ cut here ]------------
      Badness at kernel/irq/manage.c:180
      NIP: c0061ab8 LR: c0061f10 CTR: 00000000
      REGS: cf83be50 TRAP: 0700   Not tainted  (2.6.27-rc3-23450-g74919b0)
      MSR: 00021032 <ME,IR,DR>  CR: 22042022  XER: 20000000
      TASK = cf829100[5] 'events/0' THREAD: cf83a000
      GPR00: c0061f10 cf83bf00 cf829100 c038e674 00000016 00000000 cf83bef8 00000038
      GPR08: c0298910 00000000 c0310d28 cf83a000 00000c9c 1001a1a8 0fffe000 00800000
      GPR16: ffffffff 00000000 007fff00 00000000 007ffeb0 c03320a0 c031095c c0310924
      GPR24: cf8292ec cf807190 cf83a000 00009032 c038e6a4 c038e674 cf99b1cc c038e674
      NIP [c0061ab8] __enable_irq+0x20/0x80
      LR [c0061f10] enable_irq+0x50/0x70
      Call Trace:
      [cf83bf00] [c038e674] irq_desc+0x630/0x9000 (unreliable)
      [cf83bf10] [c0061f10] enable_irq+0x50/0x70
      [cf83bf30] [c01abe94] phy_change+0x68/0x108
      [cf83bf50] [c0046394] run_workqueue+0xc4/0x16c
      [cf83bf90] [c0046834] worker_thread+0x74/0xd4
      [cf83bfd0] [c004ab7c] kthread+0x48/0x84
      [cf83bff0] [c00135e0] kernel_thread+0x44/0x60
      Instruction dump:
      4e800020 3d20c031 38a94214 4bffffcc 9421fff0 7c0802a6 93e1000c 7c7f1b78
      90010014 8123001c 2f890000 409e001c <0fe00000> 80010014 83e1000c 38210010
      
      That trace corresponds to this line:
      WARN(1, KERN_WARNING "Unbalanced enable for IRQ %d\n", irq);
      
      The patch fixes the problem by moving the SHIRQ code below the
      setup_irq().
      
      Unfortunately we can't easily move the SHIRQ code inside the
      setup_irq(), since it grabs a spinlock, so to prvent a 'real'
      IRQ from interfere us we should disable that IRQ.
      
      p.s. The driver in question is drivers/net/phy/phy.c.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      377bf1e4
  8. 06 8月, 2008 1 次提交
  9. 27 7月, 2008 1 次提交
  10. 26 7月, 2008 1 次提交
  11. 25 7月, 2008 1 次提交
    • U
      generic irqs: handle failure of irqchip->set_type in setup_irq · 82736f4d
      Uwe Kleine-König 提交于
      set_type returns an int indicating success or failure, but up to now
      setup_irq ignores that.
      
      In my case this resulted in a machine hang:
      
      gpio-keys requested IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, but
      arm/ns9xxx can only trigger on one direction so set_type didn't touch
      the configuration which happens do default to a level sensitiveness and
      returned -EINVAL.  setup_irq ignored that and unmasked the irq.  This
      resulted in an endless triggering of the gpio-key interrupt service
      routine which effectively killed the machine.
      
      With this patch applied setup_irq propagates the error to the caller.
      
      Note that before in the case
      
      	chip && !chip->set_type && !chip->name
      
      a NULL pointer was feed to printk.  This is fixed, too.
      Signed-off-by: NUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      82736f4d
  12. 24 7月, 2008 1 次提交
  13. 12 7月, 2008 1 次提交
  14. 10 7月, 2008 1 次提交
  15. 05 6月, 2008 1 次提交
    • M
      genirq: Expose default irq affinity mask (take 3) · 18404756
      Max Krasnyansky 提交于
      Current IRQ affinity interface does not provide a way to set affinity
      for the IRQs that will be allocated/activated in the future.
      This patch creates /proc/irq/default_smp_affinity that lets users set
      default affinity mask for the newly allocated IRQs. Changing the default
      does not affect affinity masks for the currently active IRQs, they
      have to be changed explicitly.
      
      Updated based on Paul J's comments and added some more documentation.
      Signed-off-by: NMax Krasnyansky <maxk@qualcomm.com>
      Cc: pj@sgi.com
      Cc: a.p.zijlstra@chello.nl
      Cc: tglx@linutronix.de
      Cc: rdunlap@xenotime.net
      Cc: mingo@elte.hu
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      18404756
  16. 02 5月, 2008 1 次提交
    • T
      genirq: reenable a nobody cared disabled irq when a new driver arrives · 1adb0850
      Thomas Gleixner 提交于
      Uwe Kleine-Koenig has some strange hardware where one of the shared
      interrupts can be asserted during boot before the appropriate driver
      loads. Requesting the shared irq line from another driver result in a
      spurious interrupt storm which finally disables the interrupt line.
      
      I have seen similar behaviour on resume before (the hardware does not
      work anymore so I can not verify).
      
      Change the spurious disable logic to increment the disable depth and
      mark the interrupt with an extra flag which allows us to reenable the
      interrupt when a new driver arrives which requests the same irq
      line. In the worst case this will disable the irq again via the
      spurious trap, but there is a decent chance that the new driver is the
      one which can handle the already asserted interrupt and makes the box
      usable again.
      
      Eric Biederman said further: This case also happens on a regular basis
      in kdump kernels where we deliberately don't shutdown the hardware
      before starting the new kernel.  This patch should reduce the need for
      using irqpoll in that situation by a small amount.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-and-Acked-by: NUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
      1adb0850
  17. 29 4月, 2008 1 次提交
  18. 30 1月, 2008 1 次提交
  19. 24 10月, 2007 1 次提交
    • H
      Fix synchronize_irq races with IRQ handler · a98ce5c6
      Herbert Xu 提交于
      As it is some callers of synchronize_irq rely on memory barriers
      to provide synchronisation against the IRQ handlers.  For example,
      the tg3 driver does
      
      	tp->irq_sync = 1;
      	smp_mb();
      	synchronize_irq();
      
      and then in the IRQ handler:
      
      	if (!tp->irq_sync)
      		netif_rx_schedule(dev, &tp->napi);
      
      Unfortunately memory barriers only work well when they come in
      pairs.  Because we don't actually have memory barriers on the
      IRQ path, the memory barrier before the synchronize_irq() doesn't
      actually protect us.
      
      In particular, synchronize_irq() may return followed by the
      result of netif_rx_schedule being made visible.
      
      This patch (mostly written by Linus) fixes this by using spin
      locks instead of memory barries on the synchronize_irq() path.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a98ce5c6
  20. 17 10月, 2007 1 次提交
  21. 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
  22. 23 8月, 2007 1 次提交
  23. 09 5月, 2007 1 次提交
  24. 17 2月, 2007 2 次提交
  25. 15 2月, 2007 1 次提交
  26. 13 2月, 2007 2 次提交
  27. 12 2月, 2007 1 次提交
    • A
      [PATCH] sort the devres mess out · 5ea81769
      Al Viro 提交于
      * Split the implementation-agnostic stuff in separate files.
      * Make sure that targets using non-default request_irq() pull
        kernel/irq/devres.o
      * Introduce new symbols (HAS_IOPORT and HAS_IOMEM) defaulting to positive;
        allow architectures to turn them off (we needed these symbols anyway for
        dependencies of quite a few drivers).
      * protect the ioport-related parts of lib/devres.o with CONFIG_HAS_IOPORT.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5ea81769
  28. 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
  29. 24 1月, 2007 1 次提交