1. 28 7月, 2009 2 次提交
  2. 13 7月, 2009 2 次提交
    • J
      USB: console: Fix regression in usb console on kernel boot · 6e406121
      Jason Wessel 提交于
      The commit 335f8514 introduced a
      regression which stopped usb consoles from working correctly as a
      kernel boot console as well as interactive login device.
      
      The addition of the serial_close() which in turn calls
      tty_port_close_start() will change the reference count of port.count
      and warn about it.  The usb console code had previously incremented
      the port.count to indicate it was making use of the device as a
      console and the forced change causes a double open on the usb device
      which leads to a non obvious kernel oops later on when the tty is
      freed.
      
      To fix the problem instead make use of port->console to track if the
      port is in fact an active console port to avoid double initialization
      of the usb serial device.  The port.count is incremented and
      decremented only with in the scope of usb_console_setup() for the
      purpose of the low level driver initialization.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6e406121
    • A
      headers: smp_lock.h redux · 405f5571
      Alexey Dobriyan 提交于
      * Remove smp_lock.h from files which don't need it (including some headers!)
      * Add smp_lock.h to files which do need it
      * Make smp_lock.h include conditional in hardirq.h
        It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT
      
        This will make hardirq.h inclusion cheaper for every PREEMPT=n config
        (which includes allmodconfig/allyesconfig, BTW)
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      405f5571
  3. 26 6月, 2009 1 次提交
  4. 16 6月, 2009 2 次提交
  5. 11 6月, 2009 1 次提交
  6. 29 5月, 2009 1 次提交
    • A
      usb-serial: fix crash when sub-driver updates firmware · 0a3c8549
      Alan Stern 提交于
      This patch (as1244) fixes a crash in usb-serial that occurs when a
      sub-driver returns a positive value from its attach method, indicating
      that new firmware was loaded and the device will disconnect and
      reconnect.  The usb-serial core then skips the step of registering the
      port devices; when the disconnect occurs, the attempt to unregister
      the ports fails dramatically.
      
      This problem shows up with Keyspan devices and it might affect others
      as well.
      
      When the attach method returns a positive value, the patch sets
      num_ports to 0.  This tells usb_serial_disconnect() not to try
      unregistering any of the ports; instead they are cleaned up by
      destroy_serial().
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      0a3c8549
  7. 24 4月, 2009 1 次提交
    • A
      USB: serial: fix lifetime and locking problems · 2d93148a
      Alan Stern 提交于
      This patch (as1229) fixes a few lifetime and locking problems in the
      usb-serial driver.  The main symptom is that an invalid kevent is
      created when the serial device is unplugged while a connection is
      active.
      
      	Ports should be unregistered when device is disconnected,
      	not when the parent usb_serial structure is deallocated.
      
      	Each open file should hold a reference to the corresponding
      	port structure, and the reference should be released when
      	the file is closed.
      
      	serial->disc_mutex should be acquired in serial_open(), to
      	resolve the classic race between open and disconnect.
      
      	serial_close() doesn't need to hold both serial->disc_mutex
      	and port->mutex at the same time.
      
      	Release the subdriver's module reference only after releasing
      	all the other references, in case one of the release routines
      	needs to invoke some code in the subdriver module.
      
      	Replace a call to flush_scheduled_work() (which is prone to
      	deadlocks) with cancel_work_sync().  Also, add a call to
      	cancel_work_sync() in the disconnect routine.
      
      	Reduce the scope of serial->disc_mutex in serial_disconnect().
      	The only place it really needs to protect is where the
      	"disconnected" flag is set.
      
      This fixes the bug reported in
      
      	http://bugs.freedesktop.org/show_bug.cgi?id=20703Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NDan Williams <dcbw@redhat.com>
      Tested-by: NMing Lei <tom.leiming@gmail.com>
      Reviewed-by: NOliver Neukum <oliver@neukum.org>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      2d93148a
  8. 01 4月, 2009 1 次提交
  9. 25 3月, 2009 5 次提交
    • D
      usb-serial: fix usb_serial_register bug when boot with nousb param · e4abe665
      Dave Young 提交于
      With "nousb" cmdline booting, built-in serial drivers (ie. airecable)
      will trigger kernel oops.
      
      Indeed, if nousb, usb_serial_init will failed, and the usb serial bus type
      will not be registerd, then usb_serial_register call driver_register
      which try to register the driver to a not registered bus.
      
      Here add usb_disabled() check in usb_serial_register to fix it.
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e4abe665
    • J
      USB: serial: refuse to open recently removed USB Serial devices · 331879fd
      James Woodcock 提交于
      A USB-serial converter device is plugged into a system, and a process
      opens it's device node.  If the device is physically removed whilst the
      process still has its device node open, then other processes can
      sucessfully open the now non-existent device's node.  I would expect
      that open() on a device that has been physically removed should return
      ENODEV.
      
      This is manifesting itself with getty on my system.  I do the following:
      1.  set up inittab to spawn getty on ttyUSB0, eg:
          T1:23:respawn:/sbin/getty -L ttyUSB0 115200 vt100
      2.  Plug in USB-serial converter cable
      3.  Wait for a login prompt on a terminal program attached to the serial
          cable
      4.  Login
      5.  Pull the USB-serial converter cable from the box
      6.  getty doesn't realise that ttyUSB0 no longer exists as /dev/ttyUSB0
          can still be opened.
      7.  Re-insert the USB-serial converter cable
      8.  You should no longer get a login prompt over the serial cable, as
          the the USB-serial cable now shows up as /dev/ttyUSB1, and getty is
          trying to talk to /dev/ttyUSB0.
      
      The attached patch will cause open("/dev/ttyUSB0", O_RDONLY) to return
      ENODEV after the USB-serial converter has been pulled.  The patch was
      created against 2.6.28.1.  I can supply it against something else if
      needs be.  It is fairly simple, so should be OK.
      
      I am using a pl2303 device, although I don't think that makes any
      difference.
      
      
      From: James Woodcock <James.Woodcock@ACULAB.COM>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      331879fd
    • O
      USB: serial: remove recourse to generic method · 1c27ae67
      Oliver Neukum 提交于
      This removes the fallback to the generic method. It is cleaner to
      explicitely request it. Introducing this was my mistake. This will
      be solved by an explicit test and the driver being allowed to request
      what it needs to be done upon resumption.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1c27ae67
    • O
      USB: serial: use generic method if no alternative is provided in usb serial layer · c49cfa91
      Oliver Neukum 提交于
      This patch makes use of the generic method if a serial driver provides
      no implementation. This simplifies implementing suspend/resume support
      in serial drivers.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c49cfa91
    • O
      USB: serial: introduce a flag into the usb serial layer to tell drivers that... · f8bece8d
      Oliver Neukum 提交于
      USB: serial: introduce a flag into the usb serial layer to tell drivers that their URBs are killed due to suspension
      
      This patch introduces a flag into the usb serial layer to tell drivers
      that their URBs are killed due to suspension. That is necessary to let
      drivers know whether they should report an error back.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      
      Hi Greg,
      
      this is for 2.6.30. Patches to use this in drivers are under development.
      
      	Regards
      		Oliver
      
      f8bece8d
  10. 13 1月, 2009 1 次提交
  11. 03 1月, 2009 3 次提交
  12. 31 10月, 2008 1 次提交
  13. 18 10月, 2008 2 次提交
  14. 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
  15. 24 9月, 2008 1 次提交
  16. 14 8月, 2008 1 次提交
  17. 23 7月, 2008 3 次提交
  18. 22 7月, 2008 4 次提交
  19. 30 4月, 2008 1 次提交
    • A
      tty: The big operations rework · f34d7a5b
      Alan Cox 提交于
      - Operations are now a shared const function block as with most other Linux
        objects
      
      - Introduce wrappers for some optional functions to get consistent behaviour
      
      - Wrap put_char which used to be patched by the tty layer
      
      - Document which functions are needed/optional
      
      - Make put_char report success/fail
      
      - Cache the driver->ops pointer in the tty as tty->ops
      
      - Remove various surplus lock calls we no longer need
      
      - Remove proc_write method as noted by Alexey Dobriyan
      
      - Introduce some missing sanity checks where certain driver/ldisc
        combinations would oops as they didn't check needed methods were present
      
      [akpm@linux-foundation.org: fix fs/compat_ioctl.c build]
      [akpm@linux-foundation.org: fix isicom]
      [akpm@linux-foundation.org: fix arch/ia64/hp/sim/simserial.c build]
      [akpm@linux-foundation.org: fix kgdb]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f34d7a5b
  20. 25 4月, 2008 4 次提交
  21. 16 4月, 2008 1 次提交
    • G
      USB: remove broken usb-serial num_endpoints check · 07c3b1a1
      Greg Kroah-Hartman 提交于
      The num_interrupt_in, num_bulk_in, and other checks in the usb-serial
      code are just wrong, there are too many different devices out there with
      different numbers of endpoints.  We need to just be sticking with the
      device ids instead of trying to catch this kind of thing.  It broke too
      many different devices.
      
      This fixes a large number of usb-serial devices to get them working
      properly again.
      
      
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      07c3b1a1
  22. 02 2月, 2008 1 次提交