1. 25 Aug, 2011 3 commits
    • Jiri Slaby's avatar
      TTY: define tty_wait_until_sent_from_close · a57a7bf3
      Jiri Slaby authored
      We need this helper to fix system stalls. The issue is that the rest
      of the system TTYs wait for us to finish waiting. This wasn't an issue
      with BKL. BKL used to unlock implicitly.
      
      This is based on the Arnd suggestion.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a57a7bf3
    • Jiri Slaby's avatar
      TTY: serial, move locking in uart_close · bafb0bd2
      Jiri Slaby authored
      So now, when we handle CLOSING flag, there is no point to hold
      port->mutex over the start of uart_close.
      
      Yes, there are still several things to reason about:
      * port->count etc is and always was protected by a spinlock
      * ->stop_rx is protected by a spinlock. Otherwise it would
        race with interrupts.
      * uart_wait_until_sent -- that one is already called without
        port->mutex from set_termios and tty_set_ldisc. Should anything
        be protected there, it would be tx_empty. And by a spinlock.
        8250 does this internally...
      
      This step is needed to fix system stalls. To not create an AB-BA lock
      dependency (see next patches).
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      bafb0bd2
    • Jiri Slaby's avatar
      TTY: serial, use ASYNCB_CLOSING in uart_close · 426929f8
      Jiri Slaby authored
      We need to move port->mutex locking after wait_until_sent in
      uart_close (for rationale see next patches). But if we did it now, we
      would introduce a race between close and open. This is exactly why
      port->mutex is locked at the top of uart_close.
      
      To avoid the race, we add ASYNCB_CLOSING to uart_close. Like every
      other sane TTY driver. Thanks to tty_port_block_til_ready used in
      uart_open we will have this for free. Then we can move the port->mutex
      lock.
      
      Also note that this will make the conversion to tty_port helpers
      easier. They are currently handling ASYNC_CLOSING flag correctly.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      426929f8
  2. 24 Aug, 2011 8 commits
  3. 23 Aug, 2011 21 commits
  4. 22 Aug, 2011 6 commits
  5. 21 Aug, 2011 2 commits