1. 03 3月, 2010 3 次提交
  2. 21 1月, 2010 2 次提交
  3. 24 12月, 2009 1 次提交
  4. 23 12月, 2009 3 次提交
  5. 10 10月, 2009 1 次提交
  6. 23 9月, 2009 1 次提交
    • D
      USB: use kfifo to buffer usb-generic serial writes · 8e8dce06
      David VomLehn 提交于
      When do_output_char() attempts to write a carriage return/line feed sequence,
      it first checks to see how much buffer room is available. If there are at least
      two characters free, it will write the carriage return/line feed with two calls
      to tty_put_char(). It calls the tty_operation functions write() for devices that
      don't support the tty_operations function put_char(). If the USB generic serial
      device's write URB is not in use, it will return the buffer size when asked how
      much room is available. The write() of the carriage return will cause it to mark
      the write URB busy, so the subsequent write() of the line feed will be ignored.
      
      This patch uses the kfifo infrastructure to implement a write FIFO that
      accurately returns the amount of space available in the buffer.
      Signed-off-by: NDavid VomLehn <dvomlehn@cisco.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8e8dce06
  7. 20 9月, 2009 1 次提交
  8. 11 7月, 2009 2 次提交
  9. 16 6月, 2009 4 次提交
    • A
      USB: usb-serial: replace shutdown with disconnect, release · f9c99bb8
      Alan Stern 提交于
      This patch (as1254) splits up the shutdown method of usb_serial_driver
      into a disconnect and a release method.
      
      The problem is that the usb-serial core was calling shutdown during
      disconnect handling, but drivers didn't expect it to be called until
      after all the open file references had been closed.  The result was an
      oops when the close method tried to use memory that had been
      deallocated by shutdown.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      f9c99bb8
    • J
      USB: usb_serial: only allow sysrq on a console port · 568d422e
      Jason Wessel 提交于
      The only time a sysrq should get processed is if the attached device
      is a console.  This is intended to protect sysrq execution on a host
      connected with a terminal program.
      
      Here is the problem scenario:
      
      host A <-- rs232 link --> host B
      
      Host A is using mincom and a usb pl2303 device to connect to host b
      which is a linux system with a usb pl2303 device acting as the serial
      console.  When host B is rebooted the pl2303 emits random junk
      characters on reset.  These character sequences contain serial break
      signals most of the time and when translated to a sysrq have caused
      host A to get random processes killed, reboots or power down.
      
      It is true that in this setup with this patch host B might still have
      the same problem as host A if you reboot host A.  In most cases host A
      is a development host which seldom gets rebooted, and you could turn
      off sysrq temporarily on host B if you need to reboot host A.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      568d422e
    • J
      USB: serial: usb_debug,usb_generic_serial: implement sysrq and serial break · 98fcb5f7
      Jason Wessel 提交于
      The usb_debug driver was modified to implement serial break handling
      by using a "magic" data packet comprised of the sequence:
      
             0x00 0xff 0x01 0xfe   0x00 0xfe 0x01 0xff
      
      When the tty layer requests a serial break the usb_debug driver sends
      the magic packet.  On the receiving side the magic packet is thrown
      away or a sysrq is activated depending on what kernel .config options
      have been set.
      
      The generic serial driver was modified as well as the usb serial
      headers to generically implement sysrq processing in the same way the
      non usb uart based drivers implement the sysrq handling.  This will
      allow other usb serial devices to implement sysrq handling as desired.
      
      The new usb serial functions are named similarly and implemented
      similarly to the uart functions as follows:
      
      usb_serial_handle_break <-> uart_handle_break
      usb_serial_handle_sysrq_char <-> uart_handle_sysrq_char
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      98fcb5f7
    • J
      USB: usb_debug, usb_generic_serial: implement multi urb write · 715b1dc0
      Jason Wessel 提交于
      The usb_debug driver, when used as the console, will always fail to
      insert the carriage return and new line sequence as well as randomly
      drop console output.  This is a result of only having the single
      write_urb and that the tty layer will have a lock that prevents the
      processing of the back to back urb requests.
      
      The solution is to allow more than one urb to be outstanding and have
      a slightly deeper transmit queue.  The idea and some code is borrowed
      from the ftdi_sio usb driver.
      
      The generic usb serial driver was modified so as to allow the classic
      method of 1 write urb, or a multi write urb scheme with N allowed
      outstanding urbs where N is controlled by max_in_flight_urbs.  When
      max_in_flight_urbs in a "struct usb_serial_driver" is non zero the
      multi write urb scheme will be used.
      
      The size of 4000 was selected for the usb_debug driver so that the
      driver lowers possibility of losing the queued console messages during
      the kernel startup.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      715b1dc0
  10. 11 6月, 2009 1 次提交
  11. 24 4月, 2009 1 次提交
  12. 25 3月, 2009 2 次提交
  13. 14 10月, 2008 1 次提交
    • A
      tty: usb-serial krefs · 4a90f09b
      Alan Cox 提交于
      Use kref in the USB serial drivers so that we don't free tty structures
      from under the URB receive handlers as has historically been the case if
      you were unlucky. This also gives us a framework for general tty drivers to
      use tty_port objects and refcount.
      
      Contains two err->dev_err changes merged together to fix clashes in the
      -next tree.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4a90f09b
  14. 23 7月, 2008 2 次提交
  15. 25 4月, 2008 4 次提交
  16. 11 3月, 2008 1 次提交
  17. 02 2月, 2008 1 次提交
    • S
      USB: Prepare serial core for autosuspend. · f0fbd5b9
      Sarah Sharp 提交于
      Claim the interface for a USB to serial converter when the tty is open,
      and release the interface when the tty is closed.
      
      If a driver doesn't provide a resume function, use the generic resume
      instead.
      
      Make sure the generic resume function does not submit the URBs if we're
      coming back from autosuspend.  On autoresume, we know that the open
      function will be called next, which will attempt to submit the URBs.  If
      we submit them in the resume function, the open will fail.
      
      This works for:
       - autosuspend
       - suspending with the tty open or closed
       - hibernate with the tty closed
      
      A hibernate (or a suspend that causes the USB subsystem to lose power)
      has issues.  If you have the tty open when you hibernate, a new tty will
      be created when the device re-enumerates during resume.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f0fbd5b9
  18. 29 11月, 2007 1 次提交
  19. 26 10月, 2007 1 次提交
  20. 13 7月, 2007 3 次提交
  21. 27 3月, 2007 1 次提交
  22. 17 2月, 2007 1 次提交
    • J
      USB: add flow control to usb-serial generic driver. · 253ca923
      Joris van Rantwijk 提交于
      I added two fields to struct usb_serial_port to keep track of the
      throttle state. Other usb-serial drivers typically use private data for
      such things, but the generic driver can not really do that because some
      of its code is also used by other drivers (which may have their own
      private data needs).
      
      As it is, I am not sure that this patch is useful in all scenarios.
      It is certainly helpful for low-bandwidth devices that can hold their
      data in response to throttling. But for devices that pump data in
      real-time as fast as possible (webcam, A/D converter, etc), throttling
      may actually cause more data loss.
      
      From: Joris van Rantwijk <jorispubl@xs4all.nl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      253ca923
  23. 08 2月, 2007 1 次提交
  24. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780