02 May, 2012

1 commit

  • bMaxPacketSize0 field for super speed is a power of 2, not a count.
    The size itself is always 512.

    Max packet size for a super speed bulk endpoint is 1024, so
    allocate the urb size in halt_simple() accordingly.

    Signed-off-by: Paul Zimmerman
    Acked-by: Felipe Balbi
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Paul Zimmerman
     

19 Apr, 2012

1 commit


18 Apr, 2012

2 commits


27 Nov, 2011

1 commit


18 Sep, 2011

1 commit

  • In a few places in the kernel, the code prints
    a human-readable USB device speed (eg. "high speed").
    This involves a switch statement sometimes wrapped
    around in ({ ... }) block leading to code repetition.

    To mitigate this issue, this commit introduces
    usb_speed_string() function, which returns
    a human-readable name of provided speed.

    It also changes a few places switch was used to use
    this new function. This changes a bit the way the
    speed is printed in few instances at the same time
    standardising it.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     

24 Aug, 2011

2 commits

  • 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
    Cc: Pavel Machek
    Cc: Johannes Erdfelt
    Cc: Vojtech Pavlik
    Cc: Oliver Neukum
    Cc: David Kubicek
    Cc: Johan Hovold
    Cc: Brad Hards
    Acked-by: Felipe Balbi
    Cc: Sebastian Andrzej Siewior
    Cc: Thomas Dahlmann
    Cc: David Brownell
    Cc: David Lopo
    Cc: Alan Stern
    Cc: Michal Nazarewicz
    Cc: Xie Xiaobo
    Cc: Li Yang
    Cc: Jiang Bo
    Cc: Yuan-hsin Chen
    Cc: Darius Augulis
    Cc: Xiaochen Shen
    Cc: Yoshihiro Shimoda
    Cc: OKI SEMICONDUCTOR,
    Cc: Robert Jarzmik
    Cc: Ben Dooks
    Cc: Thomas Abraham
    Cc: Herbert Pötzl
    Cc: Arnaud Patard
    Cc: Roman Weissgaerber
    Acked-by: Sarah Sharp
    Cc: Tony Olech
    Cc: Florian Floe Echtler
    Cc: Christian Lucht
    Cc: Juergen Stuber
    Cc: Georges Toth
    Cc: Bill Ryder
    Cc: Kuba Ober
    Cc: Inaky Perez-Gonzalez
    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     
  • 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: Felipe Balbi
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Greg Kroah-Hartman

    Sebastian Andrzej Siewior
     

24 May, 2011

1 commit

  • * 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (205 commits)
    USB: EHCI: Remove SPARC_LEON {read,write}_be definitions from ehci.h
    USB: UHCI: Support big endian GRUSBHC HC
    sparc: add {read,write}*_be routines
    USB: UHCI: Add support for big endian descriptors
    USB: UHCI: Use ACCESS_ONCE rather than using a full compiler barrier
    USB: UHCI: Add support for big endian mmio
    usb-storage: Correct adjust_quirks to include latest flags
    usb/isp1760: Fix possible unlink problems
    usb/isp1760: Move function isp1760_endpoint_disable() within file.
    USB: remove remaining usages of hcd->state from usbcore and fix regression
    usb: musb: ux500: add configuration and build options for ux500 dma
    usb: musb: ux500: add dma glue layer for ux500
    usb: musb: ux500: add dma name for ux500
    usb: musb: ux500: add ux500 specific code for gadget side
    usb: musb: fix compile error
    usb-storage: fix up the unusual_realtek device list
    USB: gadget: f_audio: Fix invalid dereference of initdata
    EHCI: don't rescan interrupt QHs needlessly
    OHCI: fix regression caused by nVidia shutdown workaround
    USB: OTG: msm: Free VCCCX regulator even if we can't set the voltage
    ...

    Linus Torvalds
     

11 May, 2011

1 commit


10 May, 2011

1 commit


03 May, 2011

2 commits

  • dummy_hcd + g_zero:

    |./testusb -a -s 1024 -v 1024 -t 10
    | usbtest 2-1:3.0: subtest 14 error, status 0

    with patch:
    ./testusb -a -t 10
    |unknown speed /proc/bus/usb/001/002
    | dummy_udc dummy_udc: disabled ep-a
    | dummy_udc dummy_udc: disabled ep-b
    | dummy_udc dummy_udc: enabled ep-a (ep1in-bulk) maxpacket 1024
    | dummy_udc dummy_udc: enabled ep-b (ep2out-bulk) maxpacket 1024
    | zero gadget: source/sink enabled
    | usbtest 1-1:3.0: TEST 10: queue 32 control calls, 1000 times
    | dummy_hcd dummy_hcd: timer fired with no URBs pending?
    |/proc/bus/usb/001/002 test 10, 0.022370 secs

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Greg Kroah-Hartman

    Sebastian Andrzej Siewior
     
  • Signed-off-by: Sebastian Andrzej Siewior
    Reviewed-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Sebastian Andrzej Siewior
     

30 Apr, 2011

1 commit

  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

23 Jan, 2011

1 commit

  • Add a set of new tests similar to the existing ones but using
    transfer buffers at an "odd" address [ie offset of +1 from
    the buffer obtained by kmalloc() or usb_alloc_coherent()]

    The new tests are:
    #17 : bulk out (like #1) using kmalloc and DMA mapping by USB core.
    #18 : bulk in (like #2) using kmalloc and DMA mapping by USB core.
    #19 : bulk out (like #1) using usb_alloc_coherent()
    #20 : bulk in (like #2) using usb_alloc_coherent()
    #21 : control write (like #14)
    #22 : isochonous out (like #15)
    #23 : isochonous in (like #16)

    Signed-off-by: Martin Fuzzey
    Signed-off-by: Greg Kroah-Hartman

    Martin Fuzzey
     

23 Oct, 2010

2 commits


11 Aug, 2010

3 commits

  • 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: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    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] [] warn_slowpath_common+0x80/0x98
    [30753.755998] [] warn_slowpath_null+0x15/0x17
    [30753.755998] [] hcd_buffer_free+0xb1/0xd4 [usbcore]
    [30753.755998] [] usb_free_coherent+0x1c/0x1e [usbcore]
    [30753.755998] [] simple_free_urb+0x23/0x2f [usbtest]
    [30753.755998] [] iso_callback+0xbb/0x10f [usbtest]
    [30753.755998] [] usb_hcd_giveback_urb+0x8c/0xc0 [usbcore]
    [30753.755998] [] ehci_urb_done+0x84/0x95 [ehci_hcd]
    [30753.755998] [] ehci_work+0x41a/0x7dd [ehci_hcd]
    [30753.755998] [] ehci_irq+0x33b/0x370 [ehci_hcd]
    [30753.755998] [] ? sched_clock+0x9/0xd
    [30753.755998] [] ? sched_clock_local+0x1c/0x82
    [30753.755998] [] ? sched_clock_cpu+0xc3/0xce
    [30753.755998] [] ? trace_hardirqs_off+0xd/0xf
    [30753.755998] [] ? cpu_clock+0x43/0x5e
    [30753.755998] [] usb_hcd_irq+0x45/0xa1 [usbcore]
    [30753.755998] [] handle_IRQ_event+0x20/0xa5
    [30753.755998] [] handle_fasteoi_irq+0x92/0xd2
    [30753.755998] [] handle_irq+0x1f/0x2a
    [30753.755998] [] do_IRQ+0x57/0xbe
    [30753.755998] [] ret_from_intr+0x0/0x16
    [30753.755998] [] ? acpi_idle_enter_bm+0x231/0x269
    [30753.755998] [] ? acpi_idle_enter_bm+0x22a/0x269
    [30753.755998] [] cpuidle_idle_call+0x99/0xce
    [30753.755998] [] cpu_idle+0x61/0xaa
    [30753.755998] [] start_secondary+0x1c2/0x1c6
    [30753.755998] ---[ end trace 904cfaf7ab4cb1a2 ]---

    Signed-off-by: Ming Lei
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • 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: Andi Kleen
    Cc: Arnd Bergmann
    From: Andi Kleen

    Andi Kleen
     

21 May, 2010

2 commits

  • 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: Daniel Mack
    Cc: Alan Stern
    Cc: Pedro Ribeiro
    Signed-off-by: Greg Kroah-Hartman

    Daniel Mack
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

03 Mar, 2010

2 commits

  • The id_table field of the struct usb_device_id is constant in
    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/)

    //
    @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[] = ...;
    //

    Signed-off-by: Németh Márton
    Cc: Julia Lawall
    Cc: cocci@diku.dk
    Signed-off-by: Greg Kroah-Hartman

    Németh Márton
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

12 Dec, 2009

1 commit


16 Jun, 2009

1 commit


08 Jan, 2009

1 commit


23 Oct, 2008

1 commit


26 Jul, 2008

1 commit

  • We want to use WARN() as a variant of WARN_ON(), however a few drivers are
    using WARN() internally. This patch renames these to WARNING() to avoid the
    namespace clash. A few cases were defining but not using the thing, for those
    cases I just deleted the definition.

    Signed-off-by: Arjan van de Ven
    Acked-by: Greg KH
    Cc: Karsten Keil
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

15 May, 2008

1 commit

  • 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 .

    Signed-off-by: Marcin Slusarz
    Cc: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Marcin Slusarz
     

03 May, 2008

1 commit

  • 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: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     

25 Apr, 2008

4 commits

  • urb->context code cleanup

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Signed-off-by: Greg Kroah-Hartman

    Harvey Harrison
     
  • power.power_state is scheduled for removal. This patch (as1053)
    removes all uses of that field from drivers/usb. Almost all of them
    were write-only, the most significant exceptions being sl811-hcd.c and
    u132-hcd.c.

    Part of this patch was written by Pavel Machek.

    Signed-off-by: Alan Stern
    Cc: David Brownell
    Acked-by: Pavel Machek
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
    (d)) but is perhaps more readable.

    An extract of the semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @haskernel@
    @@

    #include

    @depends on haskernel@
    expression n,d;
    @@

    (
    - (n + d - 1) / d
    + DIV_ROUND_UP(n,d)
    |
    - (n + (d - 1)) / d
    + DIV_ROUND_UP(n,d)
    )

    @depends on haskernel@
    expression n,d;
    @@

    - DIV_ROUND_UP((n),d)
    + DIV_ROUND_UP(n,d)

    @depends on haskernel@
    expression n,d;
    @@

    - DIV_ROUND_UP(n,(d))
    + DIV_ROUND_UP(n,d)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     

03 Apr, 2008

1 commit


02 Feb, 2008

4 commits