1. 17 6月, 2009 1 次提交
  2. 11 6月, 2009 2 次提交
    • A
      tty: Untangle termios and mm mutex dependencies · 26a2e20f
      Alan Cox 提交于
      Although this doesn't cause any problems it could potentially do so for
      future mmap using devices. No real work is needed to sort it out so untangle
      it before it causes problems
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26a2e20f
    • A
      tty: throttling race fix · 38db8979
      Alan Cox 提交于
      The tty throttling code can race due to the lock drops. It takes very high
      loads but this has been observed and verified by Rob Duncan.
      
      The basic problem is that on an SMP box we can go
      
      	CPU #1				CPU #2
      	need to throttle ?
      	suppose we should		buffer space cleared
      					are we throttled
      					yes ? - unthrottle
      	call throttle method
      
      This changeet take the termios lock to protect against this. The termios
      lock isn't the initial obvious candidate but many implementations of throttle
      methods already need to poke around their own termios structures (and nobody
      really locks them against a racing change of flow control).
      
      This does mean that anyone who is setting tty->low_latency = 1 and then
      calling tty_flip_buffer_push from their unthrottle method is going to end up
      collapsing in a pile of locks. However we've removed all the known bogus
      users of low_latency = 1 and such use isn't safe anyway for other reasons so
      catching it would be an improvement.
      Signed-off-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      38db8979
  3. 16 1月, 2009 1 次提交
  4. 14 10月, 2008 4 次提交
  5. 28 8月, 2008 1 次提交
  6. 21 7月, 2008 1 次提交
    • A
      tty: Ldisc revamp · a352def2
      Alan Cox 提交于
      Move the line disciplines towards a conventional ->ops arrangement.  For
      the moment the actual 'tty_ldisc' struct in the tty is kept as part of
      the tty struct but this can then be changed if it turns out that when it
      all settles down we want to refcount ldiscs separately to the tty.
      
      Pull the ldisc code out of /proc and put it with our ldisc code.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a352def2
  7. 24 6月, 2008 1 次提交
  8. 30 4月, 2008 6 次提交
  9. 09 2月, 2008 1 次提交
  10. 09 1月, 2008 1 次提交
  11. 24 12月, 2007 1 次提交
    • C
      tty: fix logic change introduced by wait_event_interruptible_timeout() · db99247a
      Cory T. Tusar 提交于
      Commit 5a52bd4a introduced a subtle logic
      change in tty_wait_until_sent().  The original version would only error out
      of the 'do { ...  } while (timeout)' loop if signal_pending() evaluated to
      true; a timeout or break due to an empty buffer would fall out of the loop
      and into the tty->driver->wait_until_sent handling.  The current
      implementation will error out on either a pending signal or an empty
      buffer, falling through to the tty->driver->wait_until_sent handling only
      on a timeout.
      
      The ->wait_until_sent() will not be reached if the buffer empties before
      timeout jiffies have elapsed.  This behavior differs from that prior to commit
      5a52bd4a.
      
      I turned this up while using a little serial download utility to bootstrap an
      ARM-based eval board.  The util worked fine on 2.6.22.x, but consistently
      failed on 2.6.23.x.  Once I'd determined that, I narrowed things down with git
      bisect, and found the above difference in logic in tty_wait_until_sent() by
      inspection.
      
      This change reverts the logic flow in tty_wait_until_sent() to match that
      prior to the aforementioned commit.
      Signed-off-by: NCory T. Tusar <ctusar@videon-central.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Acked-by: NJiri Slaby <jirislaby@gmail.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      db99247a
  12. 07 11月, 2007 1 次提交
    • A
      [TTY]: Fix network driver interactions with TCGET/SET calls. · 0fc00e24
      Alan Cox 提交于
      Dave Miller noted various cases where line disciplines for things like
      ppp go poking around in termios themselves in ways that broke with the
      new termios code. Rather than have them all learning about termios
      internals provide proper methods for this
      
      - tty_mode_ioctl()
      
      	This handles all the terminal mode handling for speed/carrier
      etc and none of the methods are ldisc dependant so they can be called
      by any user
      
      - tty_perform_flush()
      
      	This extracts the flush functionality and enables pppd the ppp
      layer to share it cleanly.
      
      The existing n_tty_ioctl code is refactored in this patch to provide
      the new functions and to call them itself appropriately. This patch
      has no (intended) behaviour changes and simply prepares for the other
      fixes.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0fc00e24
  13. 20 10月, 2007 1 次提交
  14. 19 10月, 2007 1 次提交
  15. 17 10月, 2007 1 次提交
    • A
      tty: expose new methods needed for drivers to get termios right · 5f519d72
      Alan Cox 提交于
      This adds three new functions (or in one case to be more exact makes it
      always available)
      
      tty_termios_copy_hw
      
      Copies all the hardware settings from one termios structure to the other.
      This is intended for drivers that support little or no hardware setting
      
      tty_termios_encode_baud_rate
      
      Allows you to set the input and output baud rate in a termios structure.  A
      driver is supposed to set the resulting baud rate from a request so most
      will want to use this function to set the resulting input and output rates
      to match the hardware values.  Internally it knows about keeping Bxxx
      encoding when possible to maximise compatibility.
      
      tty_encode_baud_rate
      
      As above but for the tty's own current termios structure
      
      I suspect this will initially need some tweaking as it gets enabled by
      driver patches over the next few mm cycles so consider this lot -mm only
      for the moment so it can stabilize and end up neat before it goes to base.
      
      I've tried not to break any obscure architectures - if you get a speed you
      can't represent the code will print warnings on non updated termios systems
      but not break.
      
      Once this is merged and seems sane I've got a growing pile of driver
      updates to use it - notably for USB serial drivers.
      
      [akpm@linux-foundation.org: cleanups]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5f519d72
  16. 15 9月, 2007 1 次提交
  17. 12 9月, 2007 1 次提交
    • D
      tty: termios locking functions break with new termios type · f629307c
      David Miller 提交于
      I ran into a few problems.
      
      n_tty_ioctl() for instance:
      
      drivers/char/tty_ioctl.c:799: error: $,1rxstruct termios$,1ry has no
      member named $,1rxc_ispeed$,1ry
      
      This is calling the copy interface that is supposed to be using
      a termios2 when the new interfaces are defined, however:
      
      	case TIOCGLCKTRMIOS:
      		if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
      			return -EFAULT;
      		return 0;
      
      This is going to write over the end of the userspace
      structure by a few bytes, and wasn't caught by you yet
      because the i386 implementation is simply copy_to_user()
      which does zero type checking.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f629307c
  18. 17 7月, 2007 3 次提交
  19. 12 2月, 2007 1 次提交
    • A
      [PATCH] tty: improve encode_baud_rate logic · 78137e3b
      Alan Cox 提交于
      Mostly so people can see the work in progress.  This enhances the encode
      function which isn't currently used in the base tree but is when using some of
      the testing tty patches.
      
      This resolves a problem with some hardware where applications got confusing
      information from the tty ioctls.  Correct but confusing.
      
      In some situations asking for, say, 9600 baud actually gets you 9595 baud or
      similar near-miss values.  With the old code this meant that a request for
      B9600 got a return of BOTHER, 9595 which programs interpreted as a failure.
      
      The new code now works on the following basis
      
      - If you ask for specific rate via BOTHER, you get a precise return
      
      - If you ask for a standard Bfoo rate and the result is close you get a Bfoo
        return
      
      - If you ask for a standard Bfoo rate and get something way off you get a
        BOTHER/rate return
      
      This seems to fix up the cases I've found where this broke compatibility.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      78137e3b
  20. 09 12月, 2006 3 次提交
    • A
      [PATCH] tty_ioctl: use termios for the old structure and termios2 for the new · 64bb6c5e
      Alan Cox 提交于
      Having split out the user and kernel structures it turns out that some non
      glibc C libraries pull their termios struct from the kernel headers
      directly or indirectly.  This means we must keep "struct termios" as the
      library sees it correct for the old ioctls.  Not a big problem just shuffle
      the names and ifdef around a bit
      
      [akpm@osdl.org: build fix]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      64bb6c5e
    • A
      [PATCH] tty: switch to ktermios · 606d099c
      Alan Cox 提交于
      This is the grungy swap all the occurrences in the right places patch that
      goes with the updates.  At this point we have the same functionality as
      before (except that sgttyb() returns speeds not zero) and are ready to
      begin turning new stuff on providing nobody reports lots of bugs
      
      If you are a tty driver author converting an out of tree driver the only
      impact should be termios->ktermios name changes for the speed/property
      setting functions from your upper layers.
      
      If you are implementing your own TCGETS function before then your driver
      was broken already and its about to get a whole lot more painful for you so
      please fix it 8)
      
      Also fill in c_ispeed/ospeed on init for most devices, although the current
      code will do this for you anyway but I'd like eventually to lose that extra
      paranoia
      
      [akpm@osdl.org: bluetooth fix]
      [mp3@de.ibm.com: sclp fix]
      [mp3@de.ibm.com: warning fix for tty3270]
      [hugh@veritas.com: fix tty_ioctl powerpc build]
      [jdike@addtoit.com: uml: fix ->set_termios declaration]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NMartin Peschke <mp3@de.ibm.com>
      Acked-by: NPeter Oberparleiter <oberpar@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      606d099c
    • A
      [PATCH] tty: switch to ktermios and new framework · edc6afc5
      Alan Cox 提交于
      This is the core of the switch to the new framework.  I've split it from the
      driver patches which are mostly search/replace and would encourage people to
      give this one a good hard stare.
      
      The references to BOTHER and ISHIFT are the termios values that must be
      defined by a platform once it wants to turn on "new style" ioctl support.  The
      code patches here ensure that providing
      
      1. The termios overlays the ktermios in memory
      2. The only new kernel only fields are c_ispeed/c_ospeed (or none)
      
      the existing behaviour is retained.  This is true for the patches at this
      point in time.
      
      Future patches will define BOTHER, ISHIFT and enable newer termios structures
      for each architecture, and once they are all done some of the ifdefs also
      vanish.
      
      [akpm@osdl.org: warning fix]
      [akpm@osdl.org: IRDA fix]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      edc6afc5
  21. 30 9月, 2006 2 次提交
  22. 28 8月, 2006 1 次提交
  23. 29 6月, 2005 1 次提交
  24. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4