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
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
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
14 Dec, 2015
1 commit
-
Signed-off-by: Greg Kroah-Hartman
05 Dec, 2015
1 commit
-
Get rid of bool explicit comparisons.
Caught by Coccinelle.
Signed-off-by: Geyslan G. Bem
Signed-off-by: Greg Kroah-Hartman
02 Dec, 2015
2 commits
-
qset_fill_page_list() do not check for dma mapping errors.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
replace dma_pool_alloc and memset with a single call to dma_pool_zalloc
Signed-off-by: Saurabh Sengar
Acked-by: Peter Chen
Signed-off-by: Greg Kroah-Hartman
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
18 Mar, 2015
1 commit
-
The usb_put_hcd() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
Signed-off-by: Greg Kroah-Hartman
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
09 Jan, 2014
1 commit
-
None of these files are actually using any __init type directives
and hence don't need to include . Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.Signed-off-by: Paul Gortmaker
Signed-off-by: Greg Kroah-Hartman
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/usbSigned-off-by: Peter Chen
Acked-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman
12 Oct, 2013
1 commit
-
These aren't necessary after switch and if blocks.
Signed-off-by: Joe Perches
Signed-off-by: Greg Kroah-Hartman
07 Jun, 2013
1 commit
-
Suspend and resume are not currently supported on the wireless root hub.
Remove the suspend and resume op functions in the host controller driver
to avoid constant error messages in the system log.Signed-off-by: Thomas Pugliese
Signed-off-by: Greg Kroah-Hartman
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
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
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
...
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/0x161Signed-off-by: Clemens Ladisch
Cc: stable
Signed-off-by: Greg Kroah-Hartman
27 Nov, 2011
1 commit
-
qset->qh.link is an __le64 field and we should be using cpu_to_le64()
to fill it.Signed-off-by: Dan Carpenter
Cc: stable
Signed-off-by: Greg Kroah-Hartman
01 Nov, 2011
2 commits
-
With module.h being implicitly everywhere via device.h, the absence
of explicitly including something for EXPORT_SYMBOL went unnoticed.
Since we are heading to fix things up and clean module.h from the
device.h file, we need to explicitly include these files now.Use the lightweight version of the header that has just THIS_MODULE
and EXPORT_SYMBOL variants.Signed-off-by: Paul Gortmaker
-
The situation up to this point meant that module.h was pretty
much everywhere, regardless of whether you asked for it or not.
We are fixing that, so give the USB folks who want it an actual
include of it.Signed-off-by: Paul Gortmaker
10 Jun, 2011
1 commit
-
Several fixes as well where the +1 was missing.
Done via coccinelle scripts like:
@@
struct resource *ptr;
@@- ptr->end - ptr->start + 1
+ resource_size(ptr)and some grep and typing.
Mostly uncompiled, no cross-compilers.
Signed-off-by: Joe Perches
Signed-off-by: Jiri Kosina
31 Mar, 2011
1 commit
-
Fixes generated by 'codespell' and manually reviewed.
Signed-off-by: Lucas De Marchi
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 usedSigned-off-by: Namhyung Kim
Signed-off-by: Greg Kroah-Hartman
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
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 -
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
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 -
qset_print() was not declared static although it is not used
outside of debug.cSigned-off-by: Bill Pemberton
Signed-off-by: Greg Kroah-Hartman -
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
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 allmodconfig8. 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>
12 Dec, 2009
5 commits
-
When building qTDs (sTDs) from a scatter-gather list, the length of the
qTD must be a multiple of wMaxPacketSize if the transfer continues into
another qTD.This also fixes a link failure on configurations for 32 bit processors
with 64 bit dma_addr_t (e.g., CONFIG_HIGHMEM_64G).Signed-off-by: David Vrabel
Signed-off-by: Greg Kroah-Hartman -
Add the wusb_phy_rate sysfs file to Wireless USB host controllers. This
sets the maximum PHY rate that will be used for all connected devices.Signed-off-by: David Vrabel
Signed-off-by: Greg Kroah-Hartman -
Print ep number, direction and type; and current window in asl and pzl
debugfs files.Signed-off-by: David Vrabel
Signed-off-by: Greg Kroah-Hartman -
Fix type and format warning in the new sg code. Remove the very chatty
debug messages that were left in by mistake and use min_t() as required
(no one seems to agree on a type for buffer sizes).Reported-by: Randy Dunlap
Signed-off-by: David Vrabel
Signed-off-by: Greg Kroah-Hartman -
Support urbs with scatter-gather lists by trying to fit sg list elements
into page lists in one or more qTDs. qTDs must end on a wMaxPacketSize
boundary so if this isn't possible the urb's sg list must be copied into
bounce buffers.Signed-off-by: David Vrabel
Signed-off-by: Greg Kroah-Hartman
15 Oct, 2009
2 commits
-
A halted qTD always triggers a hardware list update because the qset was
either removed or reactivated.Signed-off-by: David Vrabel
Signed-off-by: Greg Kroah-Hartman -
If an endpoint is deleted before it's been fully added to the hardware
list, the associated qset will not be fully initialized and an oops will
occur when complete(&qset->remove_complete) is called. This can happen
if a queued URB is cancelled.Fix this by only removing the qset from the hardware list if the
cancelled URB had qTDs.Signed-off-by: David Vrabel
Signed-off-by: Greg Kroah-Hartman
02 Oct, 2009
1 commit
-
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan
Acked-by: Mike Frysinger
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
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