Skip to content
  1. Mar 30, 2013
    • Chanho Min's avatar
      ARM: PL011: Add support for Rx DMA buffer polling. · cb06ff10
      Chanho Min authored
      
      
      In DMA support, The received data is not pushed to tty until the DMA buffer
      is filled. But some megabyte rate chips such as BT expect fast response and
      data should be pushed immediately. In order to fix this issue, We suggest
      the use of the timer for polling DMA buffer.
      In our test, no data loss occurred at high-baudrate as compared with interrupt-
      driven (We tested with 3Mbps).
      We changes:
      
      - We add timer for polling. If we set poll_timer to 10, every 10ms,
       timer handler checks the residue in the dma buffer and transfer data
       to the tty. Also, last_residue is updated for the next polling.
      
      - poll_timeout is used to prevent the timer's system cost.
        If poll_timeout is set to 3000 and no data is received in 3 seconds,
        we inactivate poll timer and driver falls back to interrupt-driven.
        When data is received again in FIFO and UART irq is occurred, we switch
        back to DMA mode and start polling.
      
      - We use consistent DMA mappings to avoid from the frequent cache operation
        of the timer function for default.
      
      - pl011_dma_rx_chars is modified. the pending size is recalculated because
        data can be taken by polling.
      
      - the polling time is adjusted if dma rx poll is enabled but no rate is
        specified. Ideal polling interval to push 1 character at every interval
        is the reciprocal of 'baud rate / 10 line bits per character / 1000 ms
        per sec'. But It is very aggressive to system. Experimentally,
       '10000000 / baud' is suitable to receive dozens of characters. the poll rate
       can be specified statically by dma_rx_poll_rate of the platform data as well.
      
      Changes compared to v1:
       - Use of consistent DMA mappings.
       - Added dma_rx_poll_rate in platform data to specify the polling interval.
       - Added dma_rx_poll_timeout in platform data to specify the polling timeout.
      
      Changes compared to v2:
       - Use of consistent DMA mappings for default.
       - Added dma_rx_poll_enable in platform data to adjust the polling time
         according to the baud rate.
       - remove unnecessary lock from the polling function.
      
      Signed-off-by: default avatarChanho Min <chanho.min@lge.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb06ff10
  2. Mar 29, 2013
  3. Mar 26, 2013
  4. Mar 22, 2013
  5. Mar 19, 2013
    • Zhang Yanfei's avatar
      driver: tty: vt: remove cast for kmalloc return value · 8358f624
      Zhang Yanfei authored
      
      
      remove cast for kmalloc return value.
      
      Signed-off-by: default avatarZhang Yanfei <zhangyanfei@cn.fujitsu.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8358f624
    • Zhang Yanfei's avatar
      driver: tty: serial: remove cast for kzalloc return value · b9a129f4
      Zhang Yanfei authored
      
      
      remove cast for kzalloc return value.
      
      Signed-off-by: default avatarZhang Yanfei <zhangyanfei@cn.fujitsu.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b9a129f4
    • Jiri Slaby's avatar
      TTY: serial, stop accessing potential NULLs · 7bbe08d6
      Jiri Slaby authored
      The following commits:
      * 6732c8bb (TTY: switch
        tty_schedule_flip)
      * 2e124b4a (TTY: switch
        tty_flip_buffer_push)
      * 05c7cd39 (TTY: switch
        tty_insert_flip_string)
      * 92a19f9c (TTY: switch
        tty_insert_flip_char)
      * 227434f8
      
       (TTY: switch
        tty_buffer_request_room to tty_port)
      
      introduced a potential NULL dereference to some drivers. In
      particular, when the device is used as a console, incoming bytes can
      kill the box. This is caused by removed checks for TTY against NULL.
      
      It happened because it was unclear to me why the checks were there. I
      assumed them superfluous because the interrupts were unbound or
      otherwise stopped. But this is not the case for consoles for these
      drivers, as was pointed out by David Miller.
      
      Now, this patch re-introduces the checks (at this point we check
      port->state, not the tty proper, as we do not care about tty pointers
      anymore). For both of the drivers, we place the check below the
      handling of break signal so that sysrq can actually work. (One needs
      to issue a break and then sysrq key within the following 5 seconds.)
      
      We do not change sc26xx, sunhv, and sunsu here because they behave the
      same as before.  People having that hardware should fix the driver
      eventually, however. They always could unconditionally dereference tty
      in receive_chars, port->state in uart_handle_dcd_change, and
      up->port.state->port.tty.
      
      There is perhaps more to fix in all those drivers, but they are at
      least in a state they were before.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7bbe08d6
    • Peter Hurley's avatar
      tty: Fix recursive deadlock in tty_perform_flush() · e7f3880c
      Peter Hurley authored
      
      
      tty_perform_flush() can deadlock when called while holding
      a line discipline reference. By definition, all ldisc drivers
      hold a ldisc reference, so calls originating from ldisc drivers
      must not block for a ldisc reference.
      
      The deadlock can occur when:
        CPU 0                    |  CPU 1
                                 |
      tty_ldisc_ref(tty)         |
      ....                       | <line discipline halted>
      tty_ldisc_ref_wait(tty)    |
                                 |
      
      CPU 0 cannot progess because it cannot obtain an ldisc reference
      with the line discipline has been halted (thus no new references
      are granted).
      CPU 1 cannot progress because an outstanding ldisc reference
      has not been released.
      
      An in-tree call-tree audit of tty_perform_flush() [1] shows 5
      ldisc drivers calling tty_perform_flush() indirectly via
      n_tty_ioctl_helper() and 2 ldisc drivers calling directly.
      A single tty driver safely uses the function.
      
      [1]
      Recursive usage:
      
      /* These functions are line discipline ioctls and thus
       * recursive wrt line discipline references */
      
      tty_perform_flush() - ./drivers/tty/tty_ioctl.c
          n_tty_ioctl_helper()
              hci_uart_tty_ioctl(default) - drivers/bluetooth/hci_ldisc.c (N_HCI)
              n_hdlc_tty_ioctl(default) - drivers/tty/n_hdlc.c (N_HDLC)
              gsmld_ioctl(default) - drivers/tty/n_gsm.c (N_GSM0710)
              n_tty_ioctl(default) - drivers/tty/n_tty.c (N_TTY)
              gigaset_tty_ioctl(default) - drivers/isdn/gigaset/ser-gigaset.c (N_GIGASET_M101)
          ppp_synctty_ioctl(TCFLSH) - drivers/net/ppp/pps_synctty.c
          ppp_asynctty_ioctl(TCFLSH) - drivers/net/ppp/ppp_async.c
      
      Non-recursive use:
      
      tty_perform_flush() - drivers/tty/tty_ioctl.c
          ipw_ioctl(TCFLSH) - drivers/tty/ipwireless/tty.c
             /* This function is a tty i/o ioctl method, which
              * is invoked by tty_ioctl() */
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e7f3880c
    • Peter Hurley's avatar
      tty: Remove redundant tty_wait_until_sent() · be397116
      Peter Hurley authored
      
      
      tty_ioctl() already waits until sent.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be397116
    • Peter Hurley's avatar
    • Peter Hurley's avatar
      tty: Fold one-line assign function into callers · f4807045
      Peter Hurley authored
      
      
      Now that tty_ldisc_assign() is a one-line file-scoped function,
      remove it and perform the simple assignment at its call sites.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4807045
    • Peter Hurley's avatar
      tty: Document unsafe ldisc reference acquire · 16759f6c
      Peter Hurley authored
      
      
      Merge get_ldisc() into its only call site.
      Note how, after merging, the unsafe acquire of an ldisc reference
      is obvious.
      
         CPU 0 in tty_ldisc_try()         |  CPU 1 in tty_ldisc_halt()
                                          |
      test_bit(TTY_LDISC, &tty_flags)     |
      if (true)                           |  clear_bit(TTY_LDISC, &tty_flags)
        tty->ldisc != 0?                  |  atomic_read(&tty->ldisc->users)
        if (true)                         |  ret_val == 1?
          atomic_inc(&tty->ldisc->users)  |  if (false)
                                          |    wait
                                          |
      <goes on assuming safe ldisc use>   |  <doesn't wait - proceeds w/ close>
                                          |
      
      The spin lock in tty_ldisc_try() does nothing wrt synchronizing
      the ldisc halt since it's not acquired as part of halting.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16759f6c
    • Peter Hurley's avatar
      tty: Separate release semantics of ldisc reference · ebc9baed
      Peter Hurley authored
      
      
      tty_ldisc_ref()/tty_ldisc_unref() have usage semantics
      equivalent to down_read_trylock()/up_read(). Only
      callers of tty_ldisc_put() are performing the additional
      operations necessary for proper ldisc teardown, and then only
      after ensuring no outstanding 'read lock' remains.
      
      Thus, tty_ldisc_unref() should never be the last reference;
      WARN if it is. Conversely, tty_ldisc_put() should never be
      destructing if the use count != 1.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ebc9baed
    • Peter Hurley's avatar
      tty: Don't protect atomic operation with mutex · 8842dda2
      Peter Hurley authored
      
      
      test_bit() is already atomic; drop mutex lock/unlock.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8842dda2
    • Peter Hurley's avatar
      tty: Add ldisc hangup debug messages · fc575ee6
      Peter Hurley authored
      
      
      Expected typical debug log:
      [  582.721965] tty_open: opening pts3...
      [  582.721970] tty_open: opening pts3...
      [  582.721977] tty_release: pts3 (tty count=3)...
      [  582.721980] tty_release: ptm3 (tty count=1)...
      [  582.722015] pts3 vhangup...
      [  582.722020] tty_ldisc_hangup: pts3: closing ldisc: ffff88007a920540
      [  582.724128] tty_release: pts3 (tty count=2)...
      [  582.724217] tty_ldisc_hangup: pts3: re-opened ldisc: ffff88007a920580
      [  582.724221] tty_release: ptm3: final close
      [  582.724234] tty_ldisc_release: ptm3: closing ldisc: ffff88007a920a80
      [  582.724238] tty_ldisc_release: ptm3: ldisc closed
      [  582.724241] tty_release: ptm3: freeing structure...
      [  582.724741] tty_open: opening pts3...
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fc575ee6
    • Peter Hurley's avatar
      tty: Bracket ldisc release with TTY_DEBUG_HANGUP messages · 96433d10
      Peter Hurley authored
      
      
      Expected typical log output:
      [    2.437211] tty_open: opening pts1...
      [    2.443376] tty_open: opening pts5...
      [    2.447830] tty_release: ptm0 (tty count=1)...
      [    2.447849] pts0 vhangup...
      [    2.447865] tty_release: ptm0: final close
      [    2.447876] tty_release: ptm0: freeing structure...
      [    2.451634] tty_release: tty1 (tty count=1)...
      [    2.451638] tty_release: tty1: final close
      [    2.451654] tty_release: tty1: freeing structure...
      [    2.452505] tty_release: pts5 (tty count=2)...
      [    2.453029] tty_open: opening pts0...
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      96433d10
    • Peter Hurley's avatar
      tty: Fix 'deferred reopen' ldisc comment · c8785241
      Peter Hurley authored
      
      
      This comment is a victim of code migration from
      "tty: Fix the ldisc hangup race"; re-parent it.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c8785241
    • Peter Hurley's avatar
      tty: Make core responsible for synchronizing its work · a2965b7b
      Peter Hurley authored
      
      
      The tty core relies on the ldisc layer for synchronizing destruction
      of the tty. Instead, the final tty release must wait for any pending tty
      work to complete prior to tty destruction.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a2965b7b
    • Peter Hurley's avatar
      tty: Complete ownership transfer of flip buffers · 4f98d467
      Peter Hurley authored
      
      
      Waiting for buffer work to complete is not required for safely
      performing changes to the line discipline, once the line discipline
      is halted. The buffer work routine, flush_to_ldisc(), will be
      unable to acquire an ldisc ref and all existing references were
      waited until released (so it can't already have one).
      
      Ensure running buffer work which may reference the soon-to-be-gone
      tty completes and any buffer work running after this point retrieves
      a NULL tty.
      
      Also, ensure all buffer work is cancelled on port destruction.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4f98d467
    • Peter Hurley's avatar
      tty: Don't reenable already enabled ldisc · d9121566
      Peter Hurley authored
      
      
      tty_ldisc_hangup() guarantees the ldisc is enabled (or that there
      is no ldisc). Since __tty_hangup() was the only user, re-define
      tty_ldisc_enable() in file-scope.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d9121566
    • Peter Hurley's avatar
      n_tty: Fully initialize ldisc before restarting buffer work · b66f4fa5
      Peter Hurley authored
      
      
      Buffer work may already be pending when the n_tty ldisc is re-opened,
      eg., when setting the ldisc (via TIOCSETD ioctl) and when hanging up
      the tty. Since n_tty_set_room() may restart buffer work, first ensure
      the ldisc is completely initialized.
      
      Factor n_tty_set_room() out of reset_buffer_flags() (only 2 callers)
      and reorganize n_tty_open() to set termios last; buffer work will
      be restarted there if necessary, after the char_map is properly
      initialized.
      
      Fixes this WARNING:
      
      [  549.561769] ------------[ cut here ]------------
      [  549.598755] WARNING: at drivers/tty/n_tty.c:160 n_tty_set_room+0xff/0x130()
      [  549.604058] scheduling buffer work for halted ldisc
      [  549.607741] Pid: 9417, comm: trinity-child28 Tainted: G      D W 3.7.0-next-20121217-sasha-00023-g8689ef9 #219
      [  549.652580] Call Trace:
      [  549.662754]  [<ffffffff81c432cf>] ? n_tty_set_room+0xff/0x130
      [  549.665458]  [<ffffffff8110cae7>] warn_slowpath_common+0x87/0xb0
      [  549.668257]  [<ffffffff8110cb71>] warn_slowpath_fmt+0x41/0x50
      [  549.671007]  [<ffffffff81c432cf>] n_tty_set_room+0xff/0x130
      [  549.673268]  [<ffffffff81c44597>] reset_buffer_flags+0x137/0x150
      [  549.675607]  [<ffffffff81c45b71>] n_tty_open+0x131/0x1c0
      [  549.677699]  [<ffffffff81c47824>] tty_ldisc_open.isra.5+0x54/0x70
      [  549.680147]  [<ffffffff81c482bf>] tty_ldisc_hangup+0x11f/0x1e0
      [  549.682409]  [<ffffffff81c3fa17>] __tty_hangup+0x137/0x440
      [  549.684634]  [<ffffffff81c3fd49>] tty_vhangup+0x9/0x10
      [  549.686443]  [<ffffffff81c4a42c>] pty_close+0x14c/0x160
      [  549.688446]  [<ffffffff81c41225>] tty_release+0xd5/0x490
      [  549.690460]  [<ffffffff8127d8a2>] __fput+0x122/0x250
      [  549.692577]  [<ffffffff8127d9d9>] ____fput+0x9/0x10
      [  549.694534]  [<ffffffff811348c2>] task_work_run+0xb2/0xf0
      [  549.696349]  [<ffffffff81113c6d>] do_exit+0x36d/0x580
      [  549.698286]  [<ffffffff8107d964>] ? syscall_trace_enter+0x24/0x2e0
      [  549.702729]  [<ffffffff81113f4a>] do_group_exit+0x8a/0xc0
      [  549.706775]  [<ffffffff81113f92>] sys_exit_group+0x12/0x20
      [  549.711088]  [<ffffffff83cfab18>] tracesys+0xe1/0xe6
      [  549.728001] ---[ end trace 73eb41728f11f87e ]---
      
      Reported-by: default avatarSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b66f4fa5
    • Peter Hurley's avatar
      n_tty: Correct unthrottle-with-buffer-flush comments · 25518c68
      Peter Hurley authored
      
      
      The driver is no longer unthrottled on buffer reset, so remove
      comments that claim it is.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      25518c68
    • Peter Hurley's avatar
      tty: Wait for SAK work before waiting for hangup work · 977066e7
      Peter Hurley authored
      
      
      SAK work may schedule hangup work (if TTY_SOFT_SAK is defined), thus
      SAK work must be flushed before hangup work.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      977066e7
    • Peter Hurley's avatar
      tty: Halt both ldiscs concurrently · f4cf7a38
      Peter Hurley authored
      
      
      The pty driver does not obtain an ldisc reference to the linked
      tty when writing. When the ldiscs are sequentially halted, it
      is possible for one ldisc to be halted, and before the second
      ldisc can be halted, a concurrent write schedules buffer work on
      the first ldisc. This can lead to an access-after-free error when
      the scheduled buffer work starts on the closed ldisc.
      
      Prevent subsequent use after halt by performing each stage
      of the halt on both ttys.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4cf7a38
    • Peter Hurley's avatar
      tty: Strengthen no-subsequent-use guarantee of tty_ldisc_halt() · cf528476
      Peter Hurley authored
      
      
      In preparation for destructing and freeing the tty, the line discipline
      must first be brought to an inactive state before it can be destructed.
      This line discipline shutdown must:
       - disallow new users of the ldisc
       - wait for existing ldisc users to finish
       - only then, cancel/flush their pending/running work
      
      Factor tty_ldisc_wait_idle() from tty_set_ldisc() and tty_ldisc_kill()
      to ensure this shutdown order.
      
      Failure to provide this guarantee can result in scheduled work
      running after the tty has already been freed, as indicated in the
      following log message:
      
      [   88.331234] WARNING: at drivers/tty/tty_buffer.c:435 flush_to_ldisc+0x194/0x1d0()
      [   88.334505] Hardware name: Bochs
      [   88.335618] tty is bad=-1
      [   88.335703] Modules linked in: netconsole configfs bnep rfcomm bluetooth ......
      [   88.345272] Pid: 39, comm: kworker/1:1 Tainted: G        W    3.7.0-next-20121129+ttydebug-xeon #20121129+ttydebug
      [   88.347736] Call Trace:
      [   88.349024]  [<ffffffff81058aff>] warn_slowpath_common+0x7f/0xc0
      [   88.350383]  [<ffffffff81058bf6>] warn_slowpath_fmt+0x46/0x50
      [   88.351745]  [<ffffffff81432bd4>] flush_to_ldisc+0x194/0x1d0
      [   88.353047]  [<ffffffff816f7fe1>] ? _raw_spin_unlock_irq+0x21/0x50
      [   88.354190]  [<ffffffff8108a809>] ? finish_task_switch+0x49/0xe0
      [   88.355436]  [<ffffffff81077ad1>] process_one_work+0x121/0x490
      [   88.357674]  [<ffffffff81432a40>] ? __tty_buffer_flush+0x90/0x90
      [   88.358954]  [<ffffffff81078c84>] worker_thread+0x164/0x3e0
      [   88.360247]  [<ffffffff81078b20>] ? manage_workers+0x120/0x120
      [   88.361282]  [<ffffffff8107e230>] kthread+0xc0/0xd0
      [   88.362284]  [<ffffffff816f0000>] ? cmos_do_probe+0x2eb/0x3bf
      [   88.363391]  [<ffffffff8107e170>] ? flush_kthread_worker+0xb0/0xb0
      [   88.364797]  [<ffffffff816fff6c>] ret_from_fork+0x7c/0xb0
      [   88.366087]  [<ffffffff8107e170>] ? flush_kthread_worker+0xb0/0xb0
      [   88.367266] ---[ end trace 453a7c9f38fbfec0 ]---
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cf528476
    • Peter Hurley's avatar
      tty: Relocate tty_ldisc_halt() to avoid forward declaration · 11cf48ea
      Peter Hurley authored
      
      
      tty_ldisc_halt() will use the file-scoped function, tty_ldisc_wait_idle(),
      in the following patch.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      11cf48ea
    • Peter Hurley's avatar
      tty: Fix ldisc halt sequence on hangup · 76bc35e7
      Peter Hurley authored
      
      
      Flip buffer work cannot be cancelled until all outstanding ldisc
      references have been released. Convert the ldisc ref wait into
      a full ldisc halt with buffer work cancellation.
      
      Note that the legacy mutex is not held while cancelling.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      76bc35e7
    • Peter Hurley's avatar
      tty: Remove unnecessary re-test of ldisc ref count · 2276ad97
      Peter Hurley authored
      
      
      Since the tty->ldisc is prevented from being changed by tty_set_ldisc()
      when a tty is being hung up, re-testing the ldisc user count is
      unnecessary -- ie, it cannot be a different ldisc and the user count
      cannot have increased (assuming the caller meets the precondition that
      TTY_LDISC flag is cleared)
      
      Removal of the 'early-out' locking optimization is necessary for
      the subsequent patch 'tty: Fix ldisc halt sequence on hangup'.
      
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2276ad97