1. 18 Aug, 2009 6 commits
  2. 17 Aug, 2009 13 commits
    • Thomas Gleixner's avatar
      v2.6.31-rc6-rt3 · bde823b2
      Thomas Gleixner authored
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      bde823b2
    • Thomas Gleixner's avatar
      bb7d2a77
    • Thomas Gleixner's avatar
      Merge branch 'rt/base' into rt/head · d94ddace
      Thomas Gleixner authored
      Conflicts:
      	kernel/irq/chip.c
      	kernel/irq/internals.h
      	kernel/irq/manage.c
      
      Convert forced irq threading to the new ONESHOT infrastructure
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      d94ddace
    • Thomas Gleixner's avatar
      Merge branch 'rt/local-irq' into rt/base · 4eec1a1e
      Thomas Gleixner authored
      4eec1a1e
    • Thomas Gleixner's avatar
      tty: Do not disable interrupts in put_ldisc on -rt · b67602a5
      Thomas Gleixner authored
      Fixes the following on PREEMPT_RT:
      
      BUG: sleeping function called from invalid context at kernel/rtmutex.c:684
      in_atomic(): 0, irqs_disabled(): 1, pid: 9116, name: sshd
      Pid: 9116, comm: sshd Not tainted 2.6.31-rc6-rt2 #6
      Call Trace:
      [<ffffffff81034a4f>] __might_sleep+0xec/0xee
      [<ffffffff812fbc6d>] rt_spin_lock+0x34/0x75
      [ffffffff81064a83>] atomic_dec_and_spin_lock+0x36/0x54
      [<ffffffff811df7c7>] put_ldisc+0x57/0xa6
      [<ffffffff811dfb87>] tty_ldisc_hangup+0xe7/0x19f
      [<ffffffff811d9224>] do_tty_hangup+0xff/0x319
      [<ffffffff811d9453>] tty_vhangup+0x15/0x17
      [<ffffffff811e1263>] pty_close+0x127/0x12b
      [<ffffffff811dac41>] tty_release_dev+0x1ad/0x4c0
      ....
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      b67602a5
    • Thomas Gleixner's avatar
      Merge branch 'linus' into rt/local-irq · f88cdf92
      Thomas Gleixner authored
      f88cdf92
    • Thomas Gleixner's avatar
      Merge branch 'rt/irq' into rt/base · 21478b2e
      Thomas Gleixner authored
      Conflicts:
      	kernel/irq/chip.c
      	kernel/irq/manage.c
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      21478b2e
    • Thomas Gleixner's avatar
      Merge branch 'irq/threaded' into rt/irq · 5a53f07b
      Thomas Gleixner authored
      Conflicts:
      	include/linux/interrupt.h
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      5a53f07b
    • Thomas Gleixner's avatar
      Merge branch 'irq/urgent' into rt/irq · e220e49c
      Thomas Gleixner authored
      e220e49c
    • Thomas Gleixner's avatar
      genirq: Do not wakeup irq thread from __setup_irq() and set action->irq · 3c26caa7
      Thomas Gleixner authored
      The wake_up_process() of the new irq thread in __setup_irq() is
      bogus. The irqaction is not yet set up completely, especially
      action->irq is not initialized. As a consequence the irq thread might
      dereference the wrong interrupt descriptor.
      
      Remove the wake up and set action->irq before the action is
      installed. The thread is woken up from the first interrupt.
      Reported-by: default avatarMichael Buesch <mb@bu3sch.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarMichael Buesch <mb@bu3sch.de>
      3c26caa7
    • Thomas Gleixner's avatar
      genirq: Support nested threaded irq handling · 399b5da2
      Thomas Gleixner authored
      Interrupt chips which are behind a slow bus (i2c, spi ...) and
      demultiplex other interrupt sources need to run their interrupt
      handler in a thread. 
      
      The demultiplexed interrupt handlers need to run in thread context as
      well and need to finish before the demux handler thread can reenable
      the interrupt line. So the easiest way is to run the sub device
      handlers in the context of the demultiplexing handler thread.
      
      To avoid that a separate thread is created for the subdevices the
      function set_nested_irq_thread() is provided which sets the
      IRQ_NESTED_THREAD flag in the interrupt descriptor.
      
      A driver which calls request_threaded_irq() must not be aware of the
      fact that the threaded handler is called in the context of the
      demultiplexing handler thread. The setup code checks the
      IRQ_NESTED_THREAD flag which was set from the irq chip setup code and
      does not setup a separate thread for the interrupt. The primary
      function which is provided by the device driver is replaced by an
      internal dummy function which warns when it is called.
      
      For the demultiplexing handler a helper function handle_nested_irq()
      is provided which calls the demux interrupt thread function in the
      context of the caller and does the proper interrupt accounting and
      takes the interrupt disabled status of the demultiplexed subdevice
      into account.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Trilok Soni <soni.trilok@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Brian Swetland <swetland@google.com>
      Cc: Joonyoung Shim <jy0922.shim@samsung.com>
      Cc: m.szyprowski@samsung.com
      Cc: t.fujak@samsung.com
      Cc: kyungmin.park@samsung.com,
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Daniel Ribeiro <drwyrm@gmail.com>
      Cc: arve@android.com
      Cc: Barry Song <21cnbao@gmail.com>
      399b5da2
    • Thomas Gleixner's avatar
      genirq: Add buslock support · 70aedd24
      Thomas Gleixner authored
      Some interrupt chips are connected to a "slow" bus (i2c, spi ...). The
      bus access needs to sleep and therefor cannot be called in atomic
      contexts.
      
      Some of the generic interrupt management functions like disable_irq(),
      enable_irq() ... call interrupt chip functions with the irq_desc->lock
      held and interrupts disabled. This does not work for such devices.
      
      Provide a separate synchronization mechanism for such interrupt
      chips. The irq_chip structure is extended by two optional functions
      (bus_lock and bus_sync_and_unlock).
      
      The idea is to serialize the bus access for those operations in the
      core code so that drivers which are behind that bus operated interrupt
      controller do not have to worry about it and just can use the normal
      interfaces. To achieve this we add two function pointers to the
      irq_chip: bus_lock and bus_sync_unlock.
      
      bus_lock() is called to serialize access to the interrupt controller
      bus.
      
      Now the core code can issue chip->mask/unmask ... commands without
      changing the fast path code at all. The chip implementation merily
      stores that information in a chip private data structure and
      returns. No bus interaction as these functions are called from atomic
      context.
      
      After that bus_sync_unlock() is called outside the atomic context. Now
      the chip implementation issues the bus commands, waits for completion
      and unlocks the interrupt controller bus.
      
      The irq_chip implementation as pseudo code:
      
      struct irq_chip_data {
             struct mutex   mutex;
             unsigned int   irq_offset;
             unsigned long  mask;
             unsigned long  mask_status;
      }
      
      static void bus_lock(unsigned int irq)
      {
              struct irq_chip_data *data = get_irq_desc_chip_data(irq);
      
              mutex_lock(&data->mutex);
      }
      
      static void mask(unsigned int irq)
      {
              struct irq_chip_data *data = get_irq_desc_chip_data(irq);
      
              irq -= data->irq_offset;
              data->mask |= (1 << irq);
      }
      
      static void unmask(unsigned int irq)
      {
              struct irq_chip_data *data = get_irq_desc_chip_data(irq);
      
              irq -= data->irq_offset;
              data->mask &= ~(1 << irq);
      }
      
      static void bus_sync_unlock(unsigned int irq)
      {
              struct irq_chip_data *data = get_irq_desc_chip_data(irq);
      
              if (data->mask != data->mask_status) {
                      do_bus_magic_to_set_mask(data->mask);
                      data->mask_status = data->mask;
              }
              mutex_unlock(&data->mutex);
      }
      
      The device drivers can use request_threaded_irq, free_irq, disable_irq
      and enable_irq as usual with the only restriction that the calls need
      to come from non atomic context.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Trilok Soni <soni.trilok@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Brian Swetland <swetland@google.com>
      Cc: Joonyoung Shim <jy0922.shim@samsung.com>
      Cc: m.szyprowski@samsung.com
      Cc: t.fujak@samsung.com
      Cc: kyungmin.park@samsung.com,
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Daniel Ribeiro <drwyrm@gmail.com>
      Cc: arve@android.com
      Cc: Barry Song <21cnbao@gmail.com>
      70aedd24
    • Thomas Gleixner's avatar
      genirq: Add oneshot support · b25c340c
      Thomas Gleixner authored
      For threaded interrupt handlers we expect the hard interrupt handler
      part to mask the interrupt on the originating device. The interrupt
      line itself is reenabled after the hard interrupt handler has
      executed.
      
      This requires access to the originating device from hard interrupt
      context which is not always possible. There are devices which can only
      be accessed via a bus (i2c, spi, ...). The bus access requires thread
      context. For such devices we need to keep the interrupt line masked
      until the threaded handler has executed.
      
      Add a new flag IRQF_ONESHOT which allows drivers to request that the
      interrupt is not unmasked after the hard interrupt context handler has
      been executed and the thread has been woken. The interrupt line is
      unmasked after the thread handler function has been executed.
      
      Note that for now IRQF_ONESHOT cannot be used with IRQF_SHARED to
      avoid complex accounting mechanisms.
      
      For oneshot interrupts the primary handler simply returns
      IRQ_WAKE_THREAD and does nothing else. A generic implementation
      irq_default_primary_handler() is provided to avoid useless copies all
      over the place. It is automatically installed when
      request_threaded_irq() is called with handler=NULL and
      thread_fn!=NULL.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Trilok Soni <soni.trilok@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Brian Swetland <swetland@google.com>
      Cc: Joonyoung Shim <jy0922.shim@samsung.com>
      Cc: m.szyprowski@samsung.com
      Cc: t.fujak@samsung.com
      Cc: kyungmin.park@samsung.com,
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Daniel Ribeiro <drwyrm@gmail.com>
      Cc: arve@android.com
      Cc: Barry Song <21cnbao@gmail.com>
      b25c340c
  3. 16 Aug, 2009 4 commits
  4. 15 Aug, 2009 6 commits
  5. 14 Aug, 2009 4 commits
  6. 13 Aug, 2009 7 commits