1. 17 7月, 2012 2 次提交
  2. 13 7月, 2012 5 次提交
  3. 10 7月, 2012 1 次提交
  4. 07 7月, 2012 2 次提交
  5. 27 6月, 2012 1 次提交
  6. 21 6月, 2012 1 次提交
    • D
      pch_uart: Add eg20t_port lock field, avoid recursive spinlocks · fe89def7
      Darren Hart 提交于
      pch_uart_interrupt() takes priv->port.lock which leads to two recursive
      spinlock calls if low_latency==1 or CONFIG_PREEMPT_RT_FULL=y (one
      otherwise):
      
      pch_uart_interrupt
        spin_lock_irqsave(priv->port.lock, flags)
        case PCH_UART_IID_RDR_TO (data ready)
        handle_rx_to
          push_rx
            tty_port_tty_get
              spin_lock_irqsave(&port->lock, flags) <--- already hold this lock
              ...
            tty_flip_buffer_push
              ...
              flush_to_ldisc
                spin_lock_irqsave(&tty->buf.lock)
                  spin_lock_irqsave(&tty->buf.lock)
                  disc->ops->receive_buf(tty, char_buf)
                    n_tty_receive_buf
                      tty->ops->flush_chars()
                      uart_flush_chars
                        uart_start
                          spin_lock_irqsave(&port->lock) <--- already hold this lock
      
      Avoid this by using a dedicated lock to protect the eg20t_port structure
      and IO access to its membase. This is more consistent with the 8250
      driver.  Ensure priv->lock is always take prior to priv->port.lock when
      taken at the same time.
      
      V2: Remove inadvertent whitespace change.
      V3: Account for oops_in_progress for the private lock in
          pch_console_write().
      
      Note: Like the 8250 driver, if a printk is introduced anywhere inside
            the pch_console_write() critical section, the kernel will hang
            on a recursive spinlock on the private lock. The oops case is
            handled by using a trylock in the oops_in_progress case.
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
      CC: Feng Tang <feng.tang@intel.com>
      CC: Alexander Stein <alexander.stein@systec-electronic.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fe89def7
  7. 19 6月, 2012 1 次提交
  8. 16 6月, 2012 1 次提交
    • C
      serial: pxa: add spin lock for console write · cfe275c2
      Chao Xie 提交于
      v3:
      Remove empty line
      
      v2:
      Move local_irq_save() after clk_prepare_enable()
      
      v1:
      At UP mode, when cpu want to print message in kernel, it will invoke
      peempt_disable and disable irq. So it is safe for UP mode.
      For SMP mode, it is not safe to protect the HW reigsters.
      one CPU will run a program which will invoke printf.
      another CPU will run a program in kernel that invoke printk.
      So when second CPU is trying to printk, it will do
      1. save ier register
      2. enable uue bit of ier register
      3. push buffer to uart fifo
      4 .restore ier register
      when first CPU want to printf, and it happens between 1 and 4, it will
      enable thre bit of ier, and waiting for transmit intterupt. while step 4
      will make the ier lost thre bit.
      add spin lock here to protect the ier register for console write.
      Signed-off-by: NChao Xie <chao.xie@marvell.com>
      Signed-off-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cfe275c2
  9. 15 6月, 2012 1 次提交
    • R
      vt: fix race in vt_waitactive() · 2fc46915
      Rabin Vincent 提交于
      pm_restore_console() is called from the suspend/resume path, and this
      calls vt_move_to_console(), which calls vt_waitactive().
      
      There's a race in this path which causes the process which requests the
      suspend to sleep indefinitely waiting for an event which already
      happened:
      
      P1                                      P2
       vt_move_to_console()
        set_console()
          schedule_console_callback()
        vt_waitactive()
          check n == fg_console +1
                                             console_callback()
                                               switch_screen()
                                               vt_event_post() // no waiters
      
          vt_event_wait() // forever
      
      Fix the race by ensuring we're registered for the event before we check
      if it's already completed.
      Signed-off-by: NRabin Vincent <rabin.vincent@stericsson.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2fc46915
  10. 14 6月, 2012 9 次提交
  11. 13 6月, 2012 16 次提交