1. 08 1月, 2014 12 次提交
  2. 21 12月, 2013 1 次提交
  3. 20 12月, 2013 3 次提交
  4. 19 12月, 2013 1 次提交
    • C
      TTY/n_gsm: Removing the wrong tty_unlock/lock() in gsm_dlci_release() · be706572
      Chuansheng Liu 提交于
      Commit 4d9b1090(tty: Prevent deadlock in n_gsm driver)
      tried to close all the virtual ports synchronously before closing the
      phycial ports, so the tty_vhangup() is used.
      
      But the tty_unlock/lock() is wrong:
      tty_release
       tty_ldisc_release
        tty_lock_pair(tty, o_tty)  < == Here the tty is for physical port
        tty_ldisc_kill
          gsmld_close
            gsm_cleanup_mux
              gsm_dlci_release
                tty = tty_port_tty_get(&dlci->port)
                                  < == Here the tty(s) are for virtual port
      
      They are different ttys, so before tty_vhangup(virtual tty), do not need
      to call the tty_unlock(virtual tty) at all which causes unbalanced unlock
      warning.
      
      When enabling mutex debugging option, we will hit the below warning also:
      [   99.276903] =====================================
      [   99.282172] [ BUG: bad unlock balance detected! ]
      [   99.287442] 3.10.20-261976-gaec5ba0 #44 Tainted: G           O
      [   99.293972] -------------------------------------
      [   99.299240] mmgr/152 is trying to release lock (&tty->legacy_mutex) at:
      [   99.306693] [<c1b2dcad>] mutex_unlock+0xd/0x10
      [   99.311669] but there are no more locks to release!
      [   99.317131]
      [   99.317131] other info that might help us debug this:
      [   99.324440] 3 locks held by mmgr/152:
      [   99.328542]  #0:  (&tty->legacy_mutex/1){......}, at: [<c1b30ab0>] tty_lock_nested+0x40/0x90
      [   99.338116]  #1:  (&tty->ldisc_mutex){......}, at: [<c15dbd02>] tty_ldisc_kill+0x22/0xd0
      [   99.347284]  #2:  (&gsm->mutex){......}, at: [<c15e3d83>] gsm_cleanup_mux+0x73/0x170
      [   99.356060]
      [   99.356060] stack backtrace:
      [   99.360932] CPU: 0 PID: 152 Comm: mmgr Tainted: G           O 3.10.20-261976-gaec5ba0 #44
      [   99.370086]  ef4a4de0 ef4a4de0 ef4c1d98 c1b27b91 ef4c1db8 c1292655 c1dd10f5 c1b2dcad
      [   99.378921]  c1b2dcad ef4a4de0 ef4a528c ffffffff ef4c1dfc c12930dd 00000246 00000000
      [   99.387754]  00000000 00000000 c15e1926 00000000 00000001 ddfa7530 00000003 c1b2dcad
      [   99.396588] Call Trace:
      [   99.399326]  [<c1b27b91>] dump_stack+0x16/0x18
      [   99.404307]  [<c1292655>] print_unlock_imbalance_bug+0xe5/0xf0
      [   99.410840]  [<c1b2dcad>] ? mutex_unlock+0xd/0x10
      [   99.416110]  [<c1b2dcad>] ? mutex_unlock+0xd/0x10
      [   99.421382]  [<c12930dd>] lock_release_non_nested+0x1cd/0x210
      [   99.427818]  [<c15e1926>] ? gsm_destroy_network+0x36/0x130
      [   99.433964]  [<c1b2dcad>] ? mutex_unlock+0xd/0x10
      [   99.439235]  [<c12931a2>] lock_release+0x82/0x1c0
      [   99.444505]  [<c1b2dcad>] ? mutex_unlock+0xd/0x10
      [   99.449776]  [<c1b2dcad>] ? mutex_unlock+0xd/0x10
      [   99.455047]  [<c1b2dc2f>] __mutex_unlock_slowpath+0x5f/0xd0
      [   99.461288]  [<c1b2dcad>] mutex_unlock+0xd/0x10
      [   99.466365]  [<c1b30bb1>] tty_unlock+0x21/0x50
      [   99.471345]  [<c15e3dd1>] gsm_cleanup_mux+0xc1/0x170
      [   99.476906]  [<c15e44d2>] gsmld_close+0x52/0x90
      [   99.481983]  [<c15db905>] tty_ldisc_close.isra.1+0x35/0x50
      [   99.488127]  [<c15dbd0c>] tty_ldisc_kill+0x2c/0xd0
      [   99.493494]  [<c15dc7af>] tty_ldisc_release+0x2f/0x50
      [   99.499152]  [<c15d572c>] tty_release+0x37c/0x4b0
      [   99.504424]  [<c1b2dcad>] ? mutex_unlock+0xd/0x10
      [   99.509695]  [<c1b2dcad>] ? mutex_unlock+0xd/0x10
      [   99.514967]  [<c1372f6e>] ? eventpoll_release_file+0x7e/0x90
      [   99.521307]  [<c1335849>] __fput+0xd9/0x200
      [   99.525996]  [<c133597d>] ____fput+0xd/0x10
      [   99.530685]  [<c125c731>] task_work_run+0x81/0xb0
      [   99.535957]  [<c12019e9>] do_notify_resume+0x49/0x70
      [   99.541520]  [<c1b30dc4>] work_notifysig+0x29/0x31
      [   99.546897] ------------[ cut here ]------------
      
      So here we can call tty_vhangup() directly which is for virtual port.
      Reviewed-by: NChao Bi <chao.bi@intel.com>
      Signed-off-by: NLiu, Chuansheng <chuansheng.liu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be706572
  5. 18 12月, 2013 13 次提交
  6. 17 12月, 2013 2 次提交
    • J
      serial: 8250_dw: Fix LCR workaround regression · 6979f8d2
      James Hogan 提交于
      Commit c49436b6 (serial: 8250_dw: Improve unwritable LCR workaround)
      caused a regression. It added a check that the LCR was written properly
      to detect and workaround the busy quirk, but the behaviour of bit 5
      (UART_LCR_SPAR) differs between IP versions 3.00a and 3.14c per the
      docs. On older versions this caused the check to fail and it would
      repeatedly force idle and rewrite the LCR register, causing delays and
      preventing any input from serial being received.
      
      This is fixed by masking out UART_LCR_SPAR before making the comparison.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Tim Kryger <tim.kryger@linaro.org>
      Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
      Cc: Matt Porter <matt.porter@linaro.org>
      Cc: Markus Mayer <markus.mayer@linaro.org>
      Tested-by: NTim Kryger <tim.kryger@linaro.org>
      Tested-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
      Tested-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6979f8d2
    • P
      tty: Fix hang at ldsem_down_read() · cf872776
      Peter Hurley 提交于
      When a controlling tty is being hung up and the hang up is
      waiting for a just-signalled tty reader or writer to exit, and a new tty
      reader/writer tries to acquire an ldisc reference concurrently with the
      ldisc reference release from the signalled reader/writer, the hangup
      can hang. The new reader/writer is sleeping in ldsem_down_read() and the
      hangup is sleeping in ldsem_down_write() [1].
      
      The new reader/writer fails to wakeup the waiting hangup because the
      wrong lock count value is checked (the old lock count rather than the new
      lock count) to see if the lock is unowned.
      
      Change helper function to return the new lock count if the cmpxchg was
      successful; document this behavior.
      
      [1] edited dmesg log from reporter
      
      SysRq : Show Blocked State
        task                        PC stack   pid father
      systemd         D ffff88040c4f0000     0     1      0 0x00000000
       ffff88040c49fbe0 0000000000000046 ffff88040c4a0000 ffff88040c49ffd8
       00000000001d3980 00000000001d3980 ffff88040c4a0000 ffff88040593d840
       ffff88040c49fb40 ffffffff810a4cc0 0000000000000006 0000000000000023
      Call Trace:
       [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4
       [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4
       [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4
       [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4
       [<ffffffff817a6649>] schedule+0x24/0x5e
       [<ffffffff817a588b>] schedule_timeout+0x15b/0x1ec
       [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4
       [<ffffffff817aa691>] ? _raw_spin_unlock_irq+0x24/0x26
       [<ffffffff817aa10c>] down_read_failed+0xe3/0x1b9
       [<ffffffff817aa26d>] ldsem_down_read+0x8b/0xa5
       [<ffffffff8142b5ca>] ? tty_ldisc_ref_wait+0x1b/0x44
       [<ffffffff8142b5ca>] tty_ldisc_ref_wait+0x1b/0x44
       [<ffffffff81423f5b>] tty_write+0x7d/0x28a
       [<ffffffff814241f5>] redirected_tty_write+0x8d/0x98
       [<ffffffff81424168>] ? tty_write+0x28a/0x28a
       [<ffffffff8115d03f>] do_loop_readv_writev+0x56/0x79
       [<ffffffff8115e604>] do_readv_writev+0x1b0/0x1ff
       [<ffffffff8116ea0b>] ? do_vfs_ioctl+0x32a/0x489
       [<ffffffff81167d9d>] ? final_putname+0x1d/0x3a
       [<ffffffff8115e6c7>] vfs_writev+0x2e/0x49
       [<ffffffff8115e7d3>] SyS_writev+0x47/0xaa
       [<ffffffff817ab822>] system_call_fastpath+0x16/0x1b
      bash            D ffffffff81c104c0     0  5469   5302 0x00000082
       ffff8800cf817ac0 0000000000000046 ffff8804086b22a0 ffff8800cf817fd8
       00000000001d3980 00000000001d3980 ffff8804086b22a0 ffff8800cf817a48
       000000000000b9a0 ffff8800cf817a78 ffffffff81004675 ffff8800cf817a44
      Call Trace:
       [<ffffffff81004675>] ? dump_trace+0x165/0x29c
       [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4
       [<ffffffff8100edda>] ? save_stack_trace+0x26/0x41
       [<ffffffff817a6649>] schedule+0x24/0x5e
       [<ffffffff817a588b>] schedule_timeout+0x15b/0x1ec
       [<ffffffff810a4cc0>] ? sched_clock_cpu+0x9f/0xe4
       [<ffffffff817a9f03>] ? down_write_failed+0xa3/0x1c9
       [<ffffffff817aa691>] ? _raw_spin_unlock_irq+0x24/0x26
       [<ffffffff817a9f0b>] down_write_failed+0xab/0x1c9
       [<ffffffff817aa300>] ldsem_down_write+0x79/0xb1
       [<ffffffff817aada3>] ? tty_ldisc_lock_pair_timeout+0xa5/0xd9
       [<ffffffff817aada3>] tty_ldisc_lock_pair_timeout+0xa5/0xd9
       [<ffffffff8142bf33>] tty_ldisc_hangup+0xc4/0x218
       [<ffffffff81423ab3>] __tty_hangup+0x2e2/0x3ed
       [<ffffffff81424a76>] disassociate_ctty+0x63/0x226
       [<ffffffff81078aa7>] do_exit+0x79f/0xa11
       [<ffffffff81086bdb>] ? get_signal_to_deliver+0x206/0x62f
       [<ffffffff810b4bfb>] ? lock_release_holdtime.part.8+0xf/0x16e
       [<ffffffff81079b05>] do_group_exit+0x47/0xb5
       [<ffffffff81086c16>] get_signal_to_deliver+0x241/0x62f
       [<ffffffff810020a7>] do_signal+0x43/0x59d
       [<ffffffff810f2af7>] ? __audit_syscall_exit+0x21a/0x2a8
       [<ffffffff810b4bfb>] ? lock_release_holdtime.part.8+0xf/0x16e
       [<ffffffff81002655>] do_notify_resume+0x54/0x6c
       [<ffffffff817abaf8>] int_signal+0x12/0x17
      Reported-by: NSami Farin <sami.farin@gmail.com>
      Cc: <stable@vger.kernel.org> # 3.12.x
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cf872776
  7. 10 12月, 2013 1 次提交
  8. 09 12月, 2013 7 次提交