1. 15 3月, 2015 8 次提交
  2. 14 3月, 2015 2 次提交
  3. 13 3月, 2015 12 次提交
  4. 09 3月, 2015 13 次提交
  5. 08 3月, 2015 3 次提交
  6. 07 3月, 2015 2 次提交
    • J
      TTY: fix tty_wait_until_sent maximum timeout · c37bc682
      Johan Hovold 提交于
      Currently tty_wait_until_sent may take up to twice as long as the
      requested timeout while waiting for driver and hardware buffers to
      drain.
      
      Fix this by taking the remaining number of jiffies after waiting for
      driver buffers to drain into account so that the timeout actually
      becomes a maximum timeout as it is documented to be.
      
      Note that this specifically implies tighter timings when closing a port
      as a consequence of actually honouring the port closing-wait setting
      for drivers relying on tty_wait_until_sent_from_close (e.g. via
      tty_port_close_start).
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Reviewed-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c37bc682
    • J
      TTY: fix tty_wait_until_sent on 64-bit machines · 79fbf4a5
      Johan Hovold 提交于
      Fix overflow bug in tty_wait_until_sent on 64-bit machines, where an
      infinite timeout (0) would be passed to the underlying tty-driver's
      wait_until_sent-operation as a negative timeout (-1), causing it to
      return immediately.
      
      This manifests itself for example as tcdrain() returning immediately,
      drivers not honouring the drain flags when setting terminal attributes,
      or even dropped data on close as a requested infinite closing-wait
      timeout would be ignored.
      
      The first symptom  was reported by Asier LLANO who noted that tcdrain()
      returned prematurely when using the ftdi_sio usb-serial driver.
      
      Fix this by passing 0 rather than MAX_SCHEDULE_TIMEOUT (LONG_MAX) to the
      underlying tty driver.
      
      Note that the serial-core wait_until_sent-implementation is not affected
      by this bug due to a lucky chance (comparison to an unsigned maximum
      timeout), and neither is the cyclades one that had an explicit check for
      negative timeouts, but all other tty drivers appear to be affected.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Cc: stable <stable@vger.kernel.org>	# v2.6.12
      Reported-by: NZIV-Asier Llano Palacios <asier.llano@cgglobal.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Reviewed-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      79fbf4a5