1. 27 11月, 2011 1 次提交
  2. 16 11月, 2011 5 次提交
  3. 24 8月, 2011 1 次提交
    • K
      USB: use usb_endpoint_maxp() instead of le16_to_cpu() · 29cc8897
      Kuninori Morimoto 提交于
      Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
      instead of le16_to_cpu(desc->wMaxPacketSize).
      This patch fix it up
      
      Cc: Armin Fuerst <fuerst@in.tum.de>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Johannes Erdfelt <johannes@erdfelt.com>
      Cc: Vojtech Pavlik <vojtech@suse.cz>
      Cc: Oliver Neukum <oliver@neukum.name>
      Cc: David Kubicek <dave@awk.cz>
      Cc: Johan Hovold <jhovold@gmail.com>
      Cc: Brad Hards <bhards@bigpond.net.au>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: David Lopo <dlopo@chipidea.mips.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
      Cc: Xie Xiaobo <X.Xie@freescale.com>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Jiang Bo <tanya.jiang@freescale.com>
      Cc: Yuan-hsin Chen <yhchen@faraday-tech.com>
      Cc: Darius Augulis <augulis.darius@gmail.com>
      Cc: Xiaochen Shen <xiaochen.shen@intel.com>
      Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com>
      Cc: Robert Jarzmik <robert.jarzmik@free.fr>
      Cc: Ben Dooks <ben@simtec.co.uk>
      Cc: Thomas Abraham <thomas.ab@samsung.com>
      Cc: Herbert Pötzl <herbert@13thfloor.at>
      Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
      Cc: Roman Weissgaerber <weissg@vienna.at>
      Acked-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Tony Olech <tony.olech@elandigitalsystems.com>
      Cc: Florian Floe Echtler <echtler@fs.tum.de>
      Cc: Christian Lucht <lucht@codemercs.com>
      Cc: Juergen Stuber <starblue@sourceforge.net>
      Cc: Georges Toth <g.toth@e-biz.lu>
      Cc: Bill Ryder <bryder@sgi.com>
      Cc: Kuba Ober <kuba@mareimbrium.org>
      Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      29cc8897
  4. 26 2月, 2011 1 次提交
    • A
      USB: serial drivers need to use larger bulk-in buffers · 969e3033
      Alan Stern 提交于
      When a driver doesn't know how much data a device is going to send,
      the buffer size should be at least as big as the endpoint's maxpacket
      value.  The serial drivers don't follow this rule; many of them
      request only 256-byte bulk-in buffers.  As a result, they suffer
      overflow errors if a high-speed device wants to send a lot of data,
      because high-speed bulk endpoints are required to have a maxpacket
      size of 512.
      
      This patch (as1450) fixes the problem by using the driver's
      bulk_in_size value as a minimum, always allocating buffers no smaller
      than the endpoint's maxpacket size.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NFlynn Marquardt <flynn@flynnux.de>
      CC: <stable@kernel.org> [after .39-rc1 is out]
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      969e3033
  5. 18 2月, 2011 4 次提交
  6. 23 1月, 2011 1 次提交
  7. 01 12月, 2010 1 次提交
  8. 18 11月, 2010 1 次提交
  9. 23 10月, 2010 1 次提交
    • A
      tty: Make tiocgicount a handler · d281da7f
      Alan Cox 提交于
      Dan Rosenberg noted that various drivers return the struct with uncleared
      fields. Instead of spending forever trying to stomp all the drivers that
      get it wrong (and every new driver) do the job in one place.
      
      This first patch adds the needed operations and hooks them up, including
      the needed USB midlayer and serial core plumbing.
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d281da7f
  10. 24 8月, 2010 1 次提交
    • M
      USB: serial: fix leak of usb serial module refrence count · d92a3ca6
      Ming Lei 提交于
      The patch with title below makes reference count of usb serial module
      always more than one after driver is bound.
      
      	USB-BKL: Remove BKL use for usb serial driver probing
      
      In fact, the patch above only replaces lock_kernel() with try_module_get()
      , and does not use module_put() to do what unlock_kernel() did, so casue leak
      of reference count of usb serial module and the module can not be unloaded
      after serial driver is bound with device.
      
      This patch fixes the issue, also simplifies such things:
      	-only call try_module_get() once in the entry of usb_serial_probe()
      	-only call module_put() once in the exit of usb_serial_probe
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: Johan Hovold <jhovold@gmail.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d92a3ca6
  11. 11 8月, 2010 2 次提交
  12. 21 5月, 2010 5 次提交
    • J
      USB: serial: reimplement generic fifo-based writes · 27c7acf2
      Johan Hovold 提交于
      Reimplement fifo-based writes in the generic driver using a multiple
      pre-allocated urb scheme.
      
      In contrast to multi-urb writes, no allocations (of urbs or buffers) are
      made during run-time and there is less pressure on the host stack
      queues as currently only two urbs are used (implementation is generic
      and can handle more than two urbs as well, though).
      
      Initial tests using ftdi_sio show that the implementation achieves the
      same (maximum) throughput at high baudrates as multi-urb writes. The CPU
      usage is much lower than for multi-urb writes for small write requests
      and only slightly higher for large (e.g. 2k) requests (due to extra copy
      via fifo?).
      
      Also outperforms multi-urb writes for small write requests on an
      embedded arm-9 system, where multi-urb writes are CPU-bound at high
      baudrates (perf reveals that a lot of time is spent in the host stack
      enqueue function -- could perhaps be a bug as well).
      
      Keeping the original write_urb, buffer and flag for now as there are
      other drivers depending on them.
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      27c7acf2
    • J
      USB: serial: generalise write buffer preparation · eaa3bcb0
      Johan Hovold 提交于
      Generalise write buffer preparation.
      
      This allows for drivers to manipulate (e.g. add headers) to bulk out
      data before it is sent.
      
      This adds a new function pointer to usb_serial_driver:
      
      int (*prepare_write_buffer)(struct usb_serial_port *port,
      		void **dest, size_t size, const void *src, size_t count);
      
      The function is generic and can be used with either kfifo-based or
      multi-urb writes:
      
      If *dest is NULL the implementation should allocate dest.
      If src is NULL the implementation should use the port write fifo.
      
      If not set, a generic implementation is used which simply uses memcpy or
      kfifo_out.
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      eaa3bcb0
    • J
      USB: serial: generalise generic read implementation · 23154320
      Johan Hovold 提交于
      Add process_read_urb to usb_serial_driver so that a driver can rely on
      the generic read (and throttle) mechanism but still do device specific
      processing of incoming data (such as adding tty_flags before pushing to
      line discipline).
      
      The default generic implementation handles sysrq for consoles but
      otherwise simply pushes to tty.
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      23154320
    • J
      USB: serial: allow drivers to define bulk buffer sizes · bbcb2b90
      Johan Hovold 提交于
      Allow drivers to define custom bulk in/out buffer sizes in struct
      usb_serial_driver. If not set, fall back to the default buffer size
      which matches the endpoint size.
      
      Three drivers are currently freeing the pre-allocated buffers and
      allocating larger ones to achieve this at port probe (ftdi_sio) or even
      at port open (ipaq and iuu_phoenix), which needless to say is suboptimal.
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bbcb2b90
    • J
      usb-serial: Use tty_port version console instead of usb_serial_port · bd5afa9e
      Jason Wessel 提交于
      Replace all instances of using the console variable in struct
      usb_serial_port with the struct tty_port version.
      
      CC: Alan Cox <alan@linux.intel.com>
      CC: Alan Stern <stern@rowland.harvard.edu>
      CC: Oliver Neukum <oliver@neukum.org>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: linux-usb@vger.kernel.org
      CC: linux-kernel@vger.kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bd5afa9e
  13. 03 3月, 2010 2 次提交
  14. 24 12月, 2009 1 次提交
  15. 23 12月, 2009 2 次提交
    • S
      kfifo: move out spinlock · c1e13f25
      Stefani Seibold 提交于
      Move the pointer to the spinlock out of struct kfifo.  Most users in
      tree do not actually use a spinlock, so the few exceptions now have to
      call kfifo_{get,put}_locked, which takes an extra argument to a
      spinlock.
      Signed-off-by: NStefani Seibold <stefani@seibold.net>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c1e13f25
    • S
      kfifo: move struct kfifo in place · 45465487
      Stefani Seibold 提交于
      This is a new generic kernel FIFO implementation.
      
      The current kernel fifo API is not very widely used, because it has to
      many constrains.  Only 17 files in the current 2.6.31-rc5 used it.
      FIFO's are like list's a very basic thing and a kfifo API which handles
      the most use case would save a lot of development time and memory
      resources.
      
      I think this are the reasons why kfifo is not in use:
      
       - The API is to simple, important functions are missing
       - A fifo can be only allocated dynamically
       - There is a requirement of a spinlock whether you need it or not
       - There is no support for data records inside a fifo
      
      So I decided to extend the kfifo in a more generic way without blowing up
      the API to much.  The new API has the following benefits:
      
       - Generic usage: For kernel internal use and/or device driver.
       - Provide an API for the most use case.
       - Slim API: The whole API provides 25 functions.
       - Linux style habit.
       - DECLARE_KFIFO, DEFINE_KFIFO and INIT_KFIFO Macros
       - Direct copy_to_user from the fifo and copy_from_user into the fifo.
       - The kfifo itself is an in place member of the using data structure, this save an
         indirection access and does not waste the kernel allocator.
       - Lockless access: if only one reader and one writer is active on the fifo,
         which is the common use case, no additional locking is necessary.
       - Remove spinlock - give the user the freedom of choice what kind of locking to use if
         one is required.
       - Ability to handle records. Three type of records are supported:
         - Variable length records between 0-255 bytes, with a record size
           field of 1 bytes.
         - Variable length records between 0-65535 bytes, with a record size
           field of 2 bytes.
         - Fixed size records, which no record size field.
       - Preserve memory resource.
       - Performance!
       - Easy to use!
      
      This patch:
      
      Since most users want to have the kfifo as part of another object,
      reorganize the code to allow including struct kfifo in another data
      structure.  This requires changing the kfifo_alloc and kfifo_init
      prototypes so that we pass an existing kfifo pointer into them.  This
      patch changes the implementation and all existing users.
      
      [akpm@linux-foundation.org: fix warning]
      Signed-off-by: NStefani Seibold <stefani@seibold.net>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      45465487
  16. 12 12月, 2009 3 次提交
  17. 10 10月, 2009 2 次提交
  18. 28 9月, 2009 1 次提交
    • D
      tty: Fix regressions caused by commit b50989dc · f278a2f7
      Dave Young 提交于
      The following commit made console open fails while booting:
      
      	commit b50989dc
      	Author: Alan Cox <alan@linux.intel.com>
      	Date:   Sat Sep 19 13:13:22 2009 -0700
      
      	tty: make the kref destructor occur asynchronously
      
      Due to tty release routines run in a workqueue now, error like the
      following will be reported while booting:
      
      INIT open /dev/console Input/output error
      
      It also causes hibernation regression to appear as reported at
      http://bugzilla.kernel.org/show_bug.cgi?id=14229
      
      The reason is that now there's latency issue with closing, but when
      we open a "closing not finished" tty, -EIO will be returned.
      
      Fix it as per the following Alan's suggestion:
      
        Fun but it's actually not a bug and the fix is wrong in itself as
        the port may be closing but not yet being destructed, in which case
        it seems to do the wrong thing.  Opening a tty that is closing (and
        could be closing for long periods) is supposed to return -EIO.
      
        I suspect a better way to deal with this and keep the old console
        timing is to split tty->shutdown into two functions.
      
        tty->shutdown() - called synchronously just before we dump the tty
        onto the waitqueue for destruction
      
        tty->cleanup() - called when the destructor runs.
      
        We would then do the shutdown part which can occur in IRQ context
        fine, before queueing the rest of the release (from tty->magic = 0
        ...  the end) to occur asynchronously
      
        The USB update in -next would then need a call like
      
             if (tty->cleanup)
                     tty->cleanup(tty);
      
        at the top of the async function and the USB shutdown to be split
        between shutdown and cleanup as the USB resource cleanup and final
        tidy cannot occur synchronously as it needs to sleep.
      
        In other words the logic becomes
      
             final kref put
                     make object unfindable
      
             async
                     clean it up
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      [ rjw: Rebased on top of 2.6.31-git, reworked the changelog. ]
      Signed-off-by: N"Rafael J. Wysocki" <rjw@sisk.pl>
      [ Changed serial naming to match new rules, dropped tty_shutdown as per
        comments from Alan Stern  - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f278a2f7
  19. 23 9月, 2009 3 次提交
  20. 20 9月, 2009 2 次提交
    • A
      usb-serial: straighten out serial_open · 320348c8
      Alan Stern 提交于
      This patch (as1291) removes a bunch of code from serial_open(), things
      that were rendered unnecessary by earlier patches.  A missing spinlock
      is added to protect port->port.count, which needs to be incremented
      even if the open fails but not if the tty has gotten a hangup.  The
      test for whether the hardware has been initialized, based on the use
      count, is replaced by a more transparent test of the
      ASYNCB_INITIALIZED bit in the port flags.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      320348c8
    • A
      usb-serial: add missing tests and debug lines · ff8324df
      Alan Stern 提交于
      This patch (as1290) adds some missing tests.  serial_down() isn't
      supposed to do anything if the hardware hasn't been initialized, and
      serial_close() isn't supposed to do anything if the tty has gotten a
      hangup (because serial_hangup() takes care of shutting down the
      hardware).
      
      The patch also updates and adds a few debugging lines.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ff8324df