1. 19 3月, 2013 2 次提交
    • J
      TTY: fix DTR not being dropped on hang up · 957dacae
      Johan Hovold 提交于
      Move HUPCL handling to port shutdown so that DTR is dropped also on hang
      up (tty_port_close is a noop for hung-up ports).
      
      Also do not try to drop DTR for uninitialised ports where it has never
      been raised (e.g. after a failed open).
      
      Note that this is also the current behaviour of serial-core.
      
      Nine drivers currently call tty_port_close_start directly (rather than
      through tty_port_close) and seven of them lower DTR as part of their
      close (if the port has been initialised). Fixup the remaining two
      drivers so that it continues to be lowered also on normal (non-HUP)
      close. [ Note that most of those other seven drivers did not expect DTR
      to have been dropped by tty_port_close_start in the first place. ]
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      957dacae
    • J
      TTY: add tty_port_tty_hangup helper · aa27a094
      Jiri Slaby 提交于
      It allows for cleaning up on a considerable amount of places. They did
      port_get, hangup, kref_put. Now the only thing needed is to call
      tty_port_tty_hangup which does exactly that. And they can also decide
      whether to consider CLOCAL or completely ignore that.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aa27a094
  2. 30 1月, 2013 1 次提交
    • D
      tty: Prevent deadlock in n_gsm driver · 4d9b1090
      Dirkjan Bussink 提交于
      This change fixes a deadlock when the multiplexer is closed while there
      are still client side ports open.
      
      When the multiplexer is closed and there are active tty's it tries to
      close them with tty_vhangup. This has a problem though, because
      tty_vhangup needs the tty_lock. This patch changes it to unlock the
      tty_lock before attempting the hangup and relocks afterwards. The
      additional call to tty_port_tty_set is needed because otherwise the
      port stays active because of the reference counter.
      
      This change also exposed another problem that other code paths don't
      expect that the multiplexer could have been closed. This patch also adds
      checks for these cases in the gsmtty_ class of function that could be
      called.
      
      The documentation explicitly states that "first close all virtual ports
      before closing the physical port" but we've found this to not always
      reality in our field situations. The GPRS / UTMS modem sometimes crashes
      and needs a power cycle in that case which means cleanly shutting down
      everything is not always possible. This change makes it much more robust
      for our situation where at least the system is recoverable with this patch
      and doesn't hang in a deadlock situation inside the kernel.
      
      The patch is against the long term support kernel (3.4.27) and should
      apply cleanly to more recent branches. Tested with a Telit GE864-QUADV2
      and Telit HE910 modem.
      Signed-off-by: NDirkjan Bussink <dirkjan.bussink@nedap.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4d9b1090
  3. 16 1月, 2013 5 次提交
  4. 16 11月, 2012 1 次提交
  5. 17 9月, 2012 1 次提交
  6. 17 8月, 2012 8 次提交
  7. 11 8月, 2012 1 次提交
  8. 17 7月, 2012 1 次提交
  9. 09 3月, 2012 1 次提交
  10. 09 11月, 2011 1 次提交
    • A
      n_gsm: Fix timings · a8d12007
      Alan Cox 提交于
      Alek Du reported that the code erroneously applies time to jiffies
      conversions twice to the t1 and t2 values. In normal use on a modem link
      this cases no visible problem but on a slower link it will break as with
      HZ=1000 as is typical we are running t1/t2 ten times too fast.
      
      Alek's original patch removed the conversion from the timer setting but we
      in fact have to be more careful as the contents of t1/t2 are visible via
      the device API and we thus need to correct the constants.
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a8d12007
  11. 27 9月, 2011 3 次提交
  12. 27 8月, 2011 2 次提交
  13. 09 7月, 2011 1 次提交
  14. 02 7月, 2011 3 次提交
    • R
      tty: n_gsm: Added refcount usage to gsm_mux and gsm_dlci structs · 6ab8fba7
      Russ Gorby 提交于
      The gsm_mux is created/destroyed when ldisc is
      opened/closed but clients of the MUX channel devices (gsmttyN)
      may access this structure as long as the TTYs are open.
      For the open, the ldisc open is guaranteed to preceed the TTY open,
      but the close has no such guaranteed ordering. As a result,
      the gsm_mux can be freed in the ldisc close before being accessed
      by one of the TTY clients. This can happen if the ldisc is removed
      while there are open, active MUX channels.
      A similar situation exists for DLCI-0, it is basically a resource
      shared by MUX and DLCI  , and should not be freed while they can
      be accessed
      
      To avoid this, gsm_mux and dlcis now have a reference counter
      ldisc open takes a reference on the mux and all the dlcis
      gsmtty_open takes a reference on the mux, dlci0 and its specific
      dlci. Dropping the last reference initiates the actual free.
      Signed-off-by: NRuss Gorby <russ.gorby@intel.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6ab8fba7
    • R
      tty: n_gsm: Add raw-ip support · bcd5abe2
      Russ Gorby 提交于
      This patch adds the ability to open a network data connection over a mux
      virtual tty channel. This is for modems that support data connections
      with raw IP frames instead of PPP. On high speed data connections this
      eliminates a significant amount of PPP overhead. To use this interface,
      the application must first tell the modem to open a network connection on
      a virtual tty. Once that has been accomplished, the app will issue an
      IOCTL on that virtual tty to create the network interface. The IOCTL will
      return the index of the interface created.
      
      The two IOCTL commands are:
      
          ioctl( fd, GSMIOC_ENABLE_NET );
      
          ioctl( fd, GSMIOC_DISABLE_NET );
      Signed-off-by: NRuss Gorby <russ.gorby@intel.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bcd5abe2
    • R
      tty: n_gsm: expose gsmtty device nodes at ldisc open time · d50f6dca
      Russ Gorby 提交于
      The n_gsm driver being an ldisc, does not provide a convenient method
      e.g. udev to create the tty device nodes automatically when the ldisc
      is opened.
      
      The TTY device nodes are now created via calls to tty_register_device
      from the ldisc open.
      Signed-off-by: NRuss Gorby <russ.gorby@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d50f6dca
  15. 17 6月, 2011 2 次提交
  16. 04 6月, 2011 1 次提交
    • L
      Revert "tty: make receive_buf() return the amout of bytes received" · 55db4c64
      Linus Torvalds 提交于
      This reverts commit b1c43f82.
      
      It was broken in so many ways, and results in random odd pty issues.
      
      It re-introduced the buggy schedule_work() in flush_to_ldisc() that can
      cause endless work-loops (see commit a5660b41: "tty: fix endless
      work loop when the buffer fills up").
      
      It also used an "unsigned int" return value fo the ->receive_buf()
      function, but then made multiple functions return a negative error code,
      and didn't actually check for the error in the caller.
      
      And it didn't actually work at all.  BenH bisected down odd tty behavior
      to it:
        "It looks like the patch is causing some major malfunctions of the X
         server for me, possibly related to PTYs.  For example, cat'ing a
         large file in a gnome terminal hangs the kernel for -minutes- in a
         loop of what looks like flush_to_ldisc/workqueue code, (some ftrace
         data in the quoted bits further down).
      
         ...
      
         Some more data: It -looks- like what happens is that the
         flush_to_ldisc work queue entry constantly re-queues itself (because
         the PTY is full ?) and the workqueue thread will basically loop
         forver calling it without ever scheduling, thus starving the consumer
         process that could have emptied the PTY."
      
      which is pretty much exactly the problem we fixed in a5660b41.
      
      Milton Miller pointed out the 'unsigned int' issue.
      Reported-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reported-by: NMilton Miller <miltonm@bga.com>
      Cc: Stefan Bigler <stefan.bigler@keymile.com>
      Cc: Toby Gray <toby.gray@realvnc.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      55db4c64
  17. 10 5月, 2011 1 次提交
  18. 30 4月, 2011 1 次提交
  19. 23 4月, 2011 1 次提交
  20. 20 4月, 2011 1 次提交
  21. 31 3月, 2011 1 次提交
  22. 10 3月, 2011 1 次提交