1. 12 10月, 2010 7 次提交
    • T
      genirq: Implement sane enumeration · a98d24b7
      Thomas Gleixner 提交于
      Use the allocator bitmap to lookup active interrupts.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      a98d24b7
    • T
      genirq: Prepare proc for real sparse irq support · 13bfe99e
      Thomas Gleixner 提交于
      /proc/irq never removes any entries, but when irq descriptors can be
      freed for real this is necessary. Otherwise we'd reference a freed
      descriptor in /proc/irq/N
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      13bfe99e
    • T
      genirq: Implement a sane sparse_irq allocator · 1f5a5b87
      Thomas Gleixner 提交于
      The current sparse_irq allocator has several short comings due to
      failures in the design or the lack of it:
      
       - Requires iteration over the number of active irqs to find a free slot
         (Some architectures have grown their own workarounds for this)
       - Removal of entries is not possible
       - Racy between create_irq_nr and destroy_irq (plugged by horrible
         callbacks)
       - Migration of active irq descriptors is not possible
       - No bulk allocation of irq ranges
       - Sprinkeled irq_desc references all over the place outside of kernel/irq/
         (The previous chip functions series is addressing this issue)
      
      Implement a sane allocator which fixes the above short comings (though
      migration of active descriptors needs a full tree wide cleanup of the
      direct and mostly unlocked access to irq_desc).
      
      The new allocator still uses a radix_tree, but uses a bitmap for
      keeping track of allocated irq numbers. That allows:
      
       - Fast lookup of a free slot
       - Allows the removal of descriptors
       - Prevents the create/destroy race
       - Bulk allocation of consecutive irq ranges
       - Basic design is ready for migration of life descriptors after
         further cleanups
      
      The bitmap is also used in the SPARSE_IRQ=n case for lookup and
      raceless (de)allocation of irq numbers. So it removes the requirement
      for looping through the descriptor array to find slots.
      
      Right now it uses sparse_irq_lock to protect the bitmap and the radix
      tree, but after cleaning up all users we should be able convert that
      to a mutex and to switch the radix_tree and decriptor allocations to
      GFP_KERNEL.
      
      [ Folded in a bugfix from Yinghai Lu ]
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      1f5a5b87
    • T
      genirq: Provide default irq init flags · 1318a481
      Thomas Gleixner 提交于
      Arch code sets it's own irq_desc.status flags right after boot and for
      dynamically allocated interrupts. That might involve iterating over a
      huge array.
      
      Allow ARCH_IRQ_INIT_FLAGS to set separate flags aside of IRQ_DISABLED
      which is the default.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      1318a481
    • T
      genirq: Remove export of kstat_irqs_cpu · d895f51e
      Thomas Gleixner 提交于
      The statistics accessor is only used by proc/stats and
      show_interrupts(). Both are compiled in.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      d895f51e
    • T
      genirq: Remove early_init_irq_lock_class() · 154cd387
      Thomas Gleixner 提交于
      early_init_irq_lock_class() is called way before anything touches the
      irq descriptors. In case of SPARSE_IRQ=y this is a NOP operation
      because the radix tree is empty at this point. For the SPARSE_IRQ=n
      case it's sufficient to set the lock class in early_init_irq(). 
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      154cd387
    • T
      genirq: Distangle kernel/irq/handle.c · 3795de23
      Thomas Gleixner 提交于
      kernel/irq/handle.c has become a dumpground for random code in random
      order. Split out the irq descriptor management and the dummy irq_chip
      implementation into separate files. Cleanup the include maze while at
      it.
      
      No code change.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      3795de23