1. 24 8月, 2011 2 次提交
    • 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
    • S
      USB: usbtest: use URB_ZERO_PACKET for BULK-OUT transfers · 7c79d094
      Sebastian Andrzej Siewior 提交于
      Executing
      | testusb -a -c 1 -t 3 -v 421 -s 2048
      
      does not complete on the gadget side.
      g_zero enqueues a 4096 bytes long buffer. The host sends 2048bytes which
      is a multiple of wMaxPacketSize (either 64 or 512 bytes). The host is
      done with sending data but the gadget waits for more.
      Since the protocol does not include transfer-length-field sending a
      terminating zero packet seems the only way out.
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7c79d094
  2. 11 5月, 2011 1 次提交
  3. 10 5月, 2011 1 次提交
  4. 03 5月, 2011 2 次提交
  5. 30 4月, 2011 1 次提交
    • A
      USB: add queued-unlinks test case to usbtest driver · 869410f8
      Alan Stern 提交于
      This patch (as1452b) adds a new test case to the usbtest driver.  Test
      24 exercises the unlink-from-queue pathways in the host.  It queues a
      user-specified number of bulk-OUT URBs of user-specified size, unlinks
      the fourth- and second-from-last URBs in the queue, and then waits to
      see if all the URBs complete in the expected way (except of course
      that the unlinked URBs might complete normally, if they weren't
      unlinked soon enough).
      
      This new test has confirmed the existence of a bug in the ehci-hcd
      driver, to be fixed by a separate patch.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      869410f8
  6. 23 1月, 2011 1 次提交
  7. 23 10月, 2010 2 次提交
  8. 11 8月, 2010 3 次提交
    • M
      USB: usbtest: support test device with only one iso-in or iso-out endpoint · 951fd8ee
      Ming Lei 提交于
      It is very common that one altsetting may include only one iso-in or iso-out
      single endpoint, especially for high bandwidth endpoint, so support it.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      951fd8ee
    • M
      USB: usbtest: avoid to free coherent buffer in atomic context · e10e1bec
      Ming Lei 提交于
      This patch fixes the warning below:
      [30753.755998] ------------[ cut here ]------------
      [30753.755998] WARNING: at /home/tom/git/linux-2.6/linux-2.6-next/arch/x86/include/asm/dma-mapping.h:155 hcd_buffer_free+0xb1/0xd4 [usbcore]()
      [30753.755998] Hardware name: 6475EK2
      [30753.755998] Modules linked in: uvcvideo ehci_hcd usbtest cdc_ether usbnet vfat fat usb_storage nfsd lockd nfs_acl auth_rpcgss exportfs mii tun videodev v4l1_compat v4l2_compat_ioctl32 fuse bridge stp llc sunrpc ipv6 cpufreq_ondemand acpi_cpufreq freq_table mperf kvm_intel kvm arc4 ecb ath5k usbhid mac80211 snd_hda_codec_conexant ch341 usbserial ath cfg80211 thinkpad_acpi snd_hda_intel pcspkr wmi hwmon yenta_socket iTCO_wdt iTCO_vendor_support i2c_i801 e1000e snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore snd_page_alloc pata_acpi uhci_hcd ohci_hcd usbcore i915 drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded: uvcvideo]
      [30753.755998] Pid: 0, comm: swapper Tainted: G        W   2.6.35-rc6-gkh-wl+ #49
      [30753.755998] Call Trace:
      [30753.755998]  <IRQ>  [<ffffffff8104478a>] warn_slowpath_common+0x80/0x98
      [30753.755998]  [<ffffffff810447b7>] warn_slowpath_null+0x15/0x17
      [30753.755998]  [<ffffffffa00ce02d>] hcd_buffer_free+0xb1/0xd4 [usbcore]
      [30753.755998]  [<ffffffffa00c1345>] usb_free_coherent+0x1c/0x1e [usbcore]
      [30753.755998]  [<ffffffffa00b13e4>] simple_free_urb+0x23/0x2f [usbtest]
      [30753.755998]  [<ffffffffa00b210b>] iso_callback+0xbb/0x10f [usbtest]
      [30753.755998]  [<ffffffffa00c7390>] usb_hcd_giveback_urb+0x8c/0xc0 [usbcore]
      [30753.755998]  [<ffffffffa0449b35>] ehci_urb_done+0x84/0x95 [ehci_hcd]
      [30753.755998]  [<ffffffffa044b5a5>] ehci_work+0x41a/0x7dd [ehci_hcd]
      [30753.755998]  [<ffffffffa044e298>] ehci_irq+0x33b/0x370 [ehci_hcd]
      [30753.755998]  [<ffffffff8100fb05>] ? sched_clock+0x9/0xd
      [30753.755998]  [<ffffffff8105e641>] ? sched_clock_local+0x1c/0x82
      [30753.755998]  [<ffffffff8105e76a>] ? sched_clock_cpu+0xc3/0xce
      [30753.755998]  [<ffffffff81067c7e>] ? trace_hardirqs_off+0xd/0xf
      [30753.755998]  [<ffffffff8105e7b8>] ? cpu_clock+0x43/0x5e
      [30753.755998]  [<ffffffffa00c6999>] usb_hcd_irq+0x45/0xa1 [usbcore]
      [30753.755998]  [<ffffffff81092e02>] handle_IRQ_event+0x20/0xa5
      [30753.755998]  [<ffffffff81094cea>] handle_fasteoi_irq+0x92/0xd2
      [30753.755998]  [<ffffffff8100c0ed>] handle_irq+0x1f/0x2a
      [30753.755998]  [<ffffffff8100b75d>] do_IRQ+0x57/0xbe
      [30753.755998]  [<ffffffff8136a693>] ret_from_intr+0x0/0x16
      [30753.755998]  <EOI>  [<ffffffff81223baa>] ? acpi_idle_enter_bm+0x231/0x269
      [30753.755998]  [<ffffffff81223ba3>] ? acpi_idle_enter_bm+0x22a/0x269
      [30753.755998]  [<ffffffff812c4b6b>] cpuidle_idle_call+0x99/0xce
      [30753.755998]  [<ffffffff81008dd5>] cpu_idle+0x61/0xaa
      [30753.755998]  [<ffffffff8136374b>] start_secondary+0x1c2/0x1c6
      [30753.755998] ---[ end trace 904cfaf7ab4cb1a2 ]---
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e10e1bec
    • A
      USB-BKL: Convert usb_driver ioctl to unlocked_ioctl · c532b29a
      Andi Kleen 提交于
      And audit all the users. None needed the BKL.  That was easy
      because there was only very few around.
      
      Tested with allmodconfig build on x86-64
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      From: Andi Kleen <ak@linux.intel.com>
      c532b29a
  9. 21 5月, 2010 2 次提交
    • D
      USB: rename usb_buffer_alloc() and usb_buffer_free() users · 997ea58e
      Daniel Mack 提交于
      For more clearance what the functions actually do,
      
        usb_buffer_alloc() is renamed to usb_alloc_coherent()
        usb_buffer_free()  is renamed to usb_free_coherent()
      
      They should only be used in code which really needs DMA coherency.
      
      All call sites have been changed accordingly, except for staging
      drivers.
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Pedro Ribeiro <pedrib@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      997ea58e
    • A
      USB: remove uses of URB_NO_SETUP_DMA_MAP · 0ede76fc
      Alan Stern 提交于
      This patch (as1350) removes all usages of coherent buffers for USB
      control-request setup-packet buffers.  There's no good reason to
      reserve coherent memory for these things; control requests are hardly
      ever used in large quantity (the major exception is firmware
      transfers, and they aren't time-critical).  Furthermore, only seven
      drivers used it.  We might as well always use streaming DMA mappings
      for setup-packet buffers, and remove some extra complexity from
      usbcore.
      
      The DMA-mapping portion of hcd.c is currently in flux.  A separate
      patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP
      after everything else settles down.  The removal should go smoothly,
      as by then nobody will be using it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0ede76fc
  10. 03 3月, 2010 2 次提交
    • N
      USB misc: make USB device id constant · 33b9e162
      Németh Márton 提交于
      The id_table field of the struct usb_device_id is constant in <linux/usb.h>
      so it is worth to make the initialization data also constant.
      
      The semantic match that finds this kind of pattern is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      disable decl_init,const_decl_init;
      identifier I1, I2, x;
      @@
      	struct I1 {
      	  ...
      	  const struct I2 *x;
      	  ...
      	};
      @s@
      identifier r.I1, y;
      identifier r.x, E;
      @@
      	struct I1 y = {
      	  .x = E,
      	};
      @c@
      identifier r.I2;
      identifier s.E;
      @@
      	const struct I2 E[] = ... ;
      @depends on !c@
      identifier r.I2;
      identifier s.E;
      @@
      +	const
      	struct I2 E[] = ...;
      // </smpl>
      Signed-off-by: NNémeth Márton <nm127@freemail.hu>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: cocci@diku.dk
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      33b9e162
    • A
      USB: convert to the runtime PM framework · 9bbdf1e0
      Alan Stern 提交于
      This patch (as1329) converts the USB stack over to the PM core's
      runtime PM framework.  This involves numerous changes throughout
      usbcore, especially to hub.c and driver.c.  Perhaps the most notable
      change is that CONFIG_USB_SUSPEND now depends on CONFIG_PM_RUNTIME
      instead of CONFIG_PM.
      
      Several fields in the usb_device and usb_interface structures are no
      longer needed.  Some code which used to depend on CONFIG_USB_PM now
      depends on CONFIG_USB_SUSPEND (requiring some rearrangement of header
      files).
      
      The only visible change in behavior should be that following a system
      sleep (resume from RAM or resume from hibernation), autosuspended USB
      devices will be resumed just like everything else.  They won't remain
      suspended.  But if they aren't in use then they will naturally
      autosuspend again in a few seconds.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9bbdf1e0
  11. 12 12月, 2009 1 次提交
  12. 16 6月, 2009 1 次提交
  13. 08 1月, 2009 1 次提交
  14. 23 10月, 2008 1 次提交
  15. 26 7月, 2008 1 次提交
  16. 15 5月, 2008 1 次提交
    • M
      usbtest: comment on why this code "expects" negative and positive errnos · 6def7553
      Marcin Slusarz 提交于
      On Mon, May 12, 2008 at 01:02:22AM -0700, David Brownell wrote:
      > On Sunday 11 May 2008, Marcin Slusarz wrote:
      > > 
      > > test_ctrl_queue expects (?) positive and negative errnos.
      > > what is going on here?
      > 
      > The sign is just a way to flag something:
      > 
      >                 /* some faults are allowed, not required */
      > 
      > The negative ones are required.  Positive codes are optional,
      > in the sense that, depending on how the peripheral happens
      > to be implemented, they won't necessarily be triggered.
      > 
      > For example, the test to fetch a device qualifier desriptor
      > must succeed if the device is running at high speed.  So that
      > test is marked as negative.  But when it's full speed, it
      > could legitimately fail; marked as positive.  And so on for
      > other tests.
      > 
      > Look at how the codes are *interpreted* to see it work.
      
      Lets document it.
      
      Based on comment from David Brownell <david-b@pacbell.net>.
      Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6def7553
  17. 03 5月, 2008 1 次提交
    • D
      USB: usbtest displays diagnostics again · 28ffd79c
      David Brownell 提交于
      Minor cleanup to the "usbtest" driver, mostly to resolve a regression:
      all the important diagnostics were at KERN_DEBUG, so that when the
      "#define DEBUG" was removed from the top of that file it stopped
      providing diagnostics.  Fix by using KERN_ERROR.  Also:
      
       - Stop using the legacy dbg() calls
       - Simplify the internal debug macros
       - Correct some test descriptions:
      	* Test #10 subcase 7 should *always* stall
      	* Test #10 subcase 8 *may* stall
       - Diagnostic about control queue test failures is more informative
       - Fix some whitespace "bugs"
      
      And add a warning about the rude interaction between usbfs ioctl()
      and khubd during device disconnect ... don't unplug a device under
      test, that will wedge.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      28ffd79c
  18. 25 4月, 2008 4 次提交
  19. 03 4月, 2008 1 次提交
  20. 02 2月, 2008 4 次提交
  21. 23 10月, 2007 1 次提交
  22. 20 7月, 2007 1 次提交
  23. 08 12月, 2006 2 次提交
  24. 02 12月, 2006 1 次提交
  25. 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
  26. 12 8月, 2006 1 次提交