15 Aug, 2016

1 commit

  • alloc_ordered_workqueue replaces the deprecated
    create_singlethread_workqueue.

    The workqueue "workqueue" has multiple workitems which may require
    ordering. Hence, a dedicated ordered workqueue has been used.
    Since the workqueue is not being used on a memory reclaim path,
    WQ_MEM_RECLAIM has not been set.

    Signed-off-by: Bhaktipriya Shridhar
    Signed-off-by: Greg Kroah-Hartman

    Bhaktipriya Shridhar
     

27 Apr, 2016

1 commit

  • whc_init already calls whc_clean_up if an error occurs during
    the initialization, so calling it again if whc_init fails at
    the end of wch_probe will cause double free errors. Fix this
    by bailing out on an whc_init failure to a new label that avoids
    doing the duplicated whc_clean_up.

    Signed-off-by: Colin Ian King
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

19 Apr, 2016

1 commit

  • Fixing checks for dma mapping error in qset_fill_page_list(),
    I have missed two similar problems in qset_add_urb_sg() and
    in qset_add_urb_sg_linearize().

    v2: check validity of dma_addr with dma_mapping_error()
    in qset_free_std() as suggested by Vladimir Zapolskiy.

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov
    Reviewed-by: Vladimir Zapolskiy
    Signed-off-by: Greg Kroah-Hartman

    Alexey Khoroshilov
     

14 Dec, 2015

1 commit


05 Dec, 2015

1 commit


02 Dec, 2015

2 commits


04 Oct, 2015

1 commit

  • Remove unneeded NULL test.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@ expression x; @@
    -if (x != NULL)
    \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
    //

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

    Julia Lawall
     

18 Mar, 2015

1 commit


14 Feb, 2015

1 commit

  • printk and friends can now format bitmaps using '%*pb[l]'. cpumask
    and nodemask also provide cpumask_pr_args() and nodemask_pr_args()
    respectively which can be used to generate the two printf arguments
    necessary to format the specified cpu/nodemask.

    * drivers/uwb/drp.c::uwb_drp_handle_alien_drp() was formatting mas.bm
    into a buffer but never used it. Removed.

    Signed-off-by: Tejun Heo
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

09 Jan, 2014

1 commit


09 Dec, 2013

1 commit

  • Individual controller driver has different requirement for wakeup
    setting, so move it from core to itself. In order to align with
    current etting the default wakeup setting is enabled (except for
    chipidea host).

    Pass compile test with below commands:
    make O=outout/all allmodconfig
    make -j$CPU_NUM O=outout/all drivers/usb

    Signed-off-by: Peter Chen
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Peter Chen
     

12 Oct, 2013

1 commit


07 Jun, 2013

1 commit


16 Aug, 2012

1 commit

  • If usb_create_hcd() fails here then we dereference "whc" inside the call
    to whc_clean_up() before it has been set. The compiler would have
    warned about this if we hadn't initialized all the pointers to NULL at
    the start of the function. I've cleaned that up as well.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

11 Aug, 2012

1 commit

  • Do not leak memory by updating pointer with potentially
    NULL realloc return value.

    By the way remove unused local variable:
    struct whc_page_list_entry *entry;
    More precisely, it was used to increment uninitialized value within one of cycles.

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov
    Signed-off-by: Greg Kroah-Hartman

    Alexey Khoroshilov
     

13 Dec, 2011

1 commit

  • …lbi/usb into usb-next

    * 'for-next/dwc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (392 commits)
    usb: dwc3: ep0: fix for possible early delayed_status
    usb: dwc3: gadget: fix stream enable bit
    usb: dwc3: ep0: fix GetStatus handling (again)
    usb: dwc3: ep0: use dwc3_request for ep0 requsts instead of usb_request
    usb: dwc3: use correct hwparam register for power mgm check
    usb: dwc3: omap: move to module_platform_driver
    usb: dwc3: workaround: missing disconnect event
    usb: dwc3: workaround: missing USB3 Reset event
    usb: dwc3: workaround: U1/U2 -> U0 transiton
    usb: dwc3: gadget: return early in dwc3_cleanup_done_reqs()
    usb: dwc3: ep0: handle delayed_status again
    usb: dwc3: ep0: push ep0state into xfernotready processing
    usb: dwc3: fix sparse errors
    usb: dwc3: fix few coding style problems
    usb: dwc3: move generic dwc3 code from gadget into core
    usb: dwc3: use a helper function for operation mode setting
    usb: dwc3: ep0: don't use ep0in for transfers
    usb: dwc3: ep0: use proper endianess in SetFeature for wIndex
    usb: dwc3: core: drop DWC3_EVENT_BUFFERS_MAX
    usb: dwc3: omap: add multiple instances support to OMAP
    ...

    Greg Kroah-Hartman
     

10 Dec, 2011

1 commit

  • Add a new field num_mapped_sgs to struct urb so that we have a place to
    store the number of mapped entries and can also retain the original
    value of entries in num_sgs. Previously, usb_hcd_map_urb_for_dma()
    would overwrite this with the number of mapped entries, which would
    break dma_unmap_sg() because it requires the original number of entries.

    This fixes warnings like the following when using USB storage devices:
    ------------[ cut here ]------------
    WARNING: at lib/dma-debug.c:902 check_unmap+0x4e4/0x695()
    ehci_hcd 0000:00:12.2: DMA-API: device driver frees DMA sg list with different entry count [map count=4] [unmap count=1]
    Modules linked in: ohci_hcd ehci_hcd
    Pid: 0, comm: kworker/0:1 Not tainted 3.2.0-rc2+ #319
    Call Trace:
    [] warn_slowpath_common+0x80/0x98
    [] warn_slowpath_fmt+0x41/0x43
    [] check_unmap+0x4e4/0x695
    [] ? trace_hardirqs_off+0xd/0xf
    [] ? _raw_spin_unlock_irqrestore+0x33/0x50
    [] debug_dma_unmap_sg+0xeb/0x117
    [] usb_hcd_unmap_urb_for_dma+0x71/0x188
    [] unmap_urb_for_dma+0x20/0x22
    [] usb_hcd_giveback_urb+0x5d/0xc0
    [] ehci_urb_done+0xf7/0x10c [ehci_hcd]
    [] qh_completions+0x429/0x4bd [ehci_hcd]
    [] ehci_work+0x95/0x9c0 [ehci_hcd]
    ...
    ---[ end trace f29ac88a5a48c580 ]---
    Mapped at:
    [] debug_dma_map_sg+0x45/0x139
    [] usb_hcd_map_urb_for_dma+0x22e/0x478
    [] usb_hcd_submit_urb+0x63f/0x6fa
    [] usb_submit_urb+0x2c7/0x2de
    [] usb_sg_wait+0x55/0x161

    Signed-off-by: Clemens Ladisch
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Clemens Ladisch
     

27 Nov, 2011

1 commit


01 Nov, 2011

2 commits


10 Jun, 2011

1 commit


31 Mar, 2011

1 commit


11 Dec, 2010

1 commit

  • Annotate whci_hcd_id_table as '__used' to fix following warning:

    CC drivers/usb/host/whci/hcd.o
    drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

    Signed-off-by: Namhyung Kim
    Signed-off-by: Greg Kroah-Hartman

    Namhyung Kim
     

23 Oct, 2010

1 commit

  • For all modules, change -objs to -y; remove
    if-statements and replace with lists using the kbuild idiom; move
    flags to the top of the file; and fix alignment while trying to
    maintain the original scheme in each file.

    None of the dependencies are modified.

    Signed-off-by: matt mooney
    Acked-by: Sam Ravnborg
    Acked-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    matt mooney
     

11 Aug, 2010

2 commits

  • This patch (as1393) converts several of the single-bit fields in
    struct usb_hcd to atomic flags. This is for safety's sake; not all
    CPUs can update bitfield values atomically, and these flags are used
    in multiple contexts.

    The flag fields that are set only during registration or removal can
    remain as they are, since non-atomic accesses at those times will not
    cause any problems.

    (Strictly speaking, the authorized_default flag should become atomic
    as well. I didn't bother with it because it gets changed only via
    sysfs. It can be done later, if anyone wants.)

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • The test above allows std to be NULL, so check that std is not NULL before
    doing the dereference.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @r exists@
    expression E,E1;
    identifier f;
    statement S1,S2,S3;
    @@

    if ((E == NULL && ...) || ...)
    {
    ... when != if (...) S1 else S2
    when != E = E1
    * E->f
    ... when any
    }
    else S3
    //

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

    Julia Lawall
     

21 May, 2010

3 commits

  • Change the type of the URB's 'sg' pointer from a usb_sg_request to
    a scatterlist. This allows drivers to submit scatter-gather lists
    without using the usb_sg_wait() interface. It has the added benefit
    of removing the typecasts that were added as part of patch as1368 (and
    slightly decreasing the number of pointer dereferences).

    Signed-off-by: Matthew Wilcox
    Reviewed-by: Alan Stern
    Tested-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     
  • qset_print() was not declared static although it is not used
    outside of debug.c

    Signed-off-by: Bill Pemberton
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • This patch (as1368) fixes a rather obscure bug in usbmon: When tracing
    URBs sent by the scatter-gather library, it accesses the data buffers
    while they are still mapped for DMA.

    The solution is to move the mapping and unmapping out of the s-g
    library and into the usual place in hcd.c. This requires the addition
    of new URB flag bits to describe the kind of mapping needed, since we
    have to call dma_map_sg() if the HCD supports native scatter-gather
    operation and dma_map_page() if it doesn't. The nice thing about
    having the new flags is that they simplify the testing for unmapping.

    The patch removes the only caller of usb_buffer_[un]map_sg(), so those
    functions are #if'ed out. A later patch will remove them entirely.

    As a result of this change, urb->sg will be set in situations where
    it wasn't set previously. Hence the xhci and whci drivers are
    adjusted to test urb->num_sgs instead, which retains its original
    meaning and is nonzero only when the HCD has to handle a scatterlist.

    Finally, even when a submission error occurs we don't want to hand
    URBs to usbmon before they are unmapped. The submission path is
    rearranged so that map_urb_for_dma() is called only for non-root-hub
    URBs and unmap_urb_for_dma() is called immediately after a submission
    error. This simplifies the error handling.

    Signed-off-by: Alan Stern
    CC:
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

12 Dec, 2009

5 commits


15 Oct, 2009

2 commits


02 Oct, 2009

1 commit


23 Sep, 2009

1 commit

  • usb_hcd_endpoint_reset() may be called in atomic context and must not
    sleep. So make whci-hcd's endpoint_reset() asynchronous. URBs
    submitted while the reset is in progress will be queued (on the std
    list) and transfers will resume once the reset is complete.

    Signed-off-by: David Vrabel
    Signed-off-by: Greg Kroah-Hartman

    David Vrabel