28 Jan, 2015
1 commit
-
commit f40afdddeb6c54ffd1e2920a5e93e363d6748db6 upstream.
According to the datasheet, when transfer using DMA, the control
setting for IN packet only need END_BUF_EN, END_BUF_IE, CH_EN,
while for OUT packet, need more two bits END_TR_EN and END_TR_IE
to be configured.Fixes: 914a3f3b3754 (USB: add atmel_usba_udc driver)
Acked-by: Nicolas Ferre
Signed-off-by: Bo Shen
Signed-off-by: Felipe Balbi
Signed-off-by: Greg Kroah-Hartman
16 Jan, 2015
1 commit
-
commit b2ba27a5c56ff7204d8a8684893d64d4afe2cee5 upstream.
Commit 7628083227b6bc4a7e33d7c381d7a4e558424b6b (usb: gadget: at91_udc:
prepare clk before calling enable) added clock preparation in interrupt
context. This is not allowed as it might sleep. Also setting the clock
rate is unsafe to call from there for the same reason. Move clock
preparation and setting clock rate into process context (at91udc_probe).Signed-off-by: Ronald Wahl
Acked-by: Alexandre Belloni
Acked-by: Boris Brezillon
Acked-by: Nicolas Ferre
Cc: Felipe Balbi
Signed-off-by: Felipe Balbi
Signed-off-by: Greg Kroah-Hartman
23 Oct, 2014
2 commits
-
Currently, there's no guarantee that udc->driver
will be valid when using soft_connect sysfs
interface. In fact, we can very easily trigger
a NULL pointer dereference by trying to disconnect
when a gadget driver isn't loaded.Fix this bug:
~# echo disconnect > soft_connect
[ 33.685743] Unable to handle kernel NULL pointer dereference at virtual address 00000014
[ 33.694221] pgd = ed0cc000
[ 33.697174] [00000014] *pgd=ae351831, *pte=00000000, *ppte=00000000
[ 33.703766] Internal error: Oops: 17 [#1] SMP ARM
[ 33.708697] Modules linked in: xhci_plat_hcd xhci_hcd snd_soc_davinci_mcasp snd_soc_tlv320aic3x snd_soc_edma snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd lis3lv02d_i2c matrix_keypad lis3lv02d dwc3_omap input_polldev soundcore
[ 33.734372] CPU: 0 PID: 1457 Comm: bash Not tainted 3.17.0-09740-ga93416e-dirty #345
[ 33.742457] task: ee71ce00 ti: ee68a000 task.ti: ee68a000
[ 33.748116] PC is at usb_udc_softconn_store+0xa4/0xec
[ 33.753416] LR is at mark_held_locks+0x78/0x90
[ 33.758057] pc : [] lr : [] psr: 20000013
[ 33.758057] sp : ee68bec8 ip : c0c00008 fp : ee68bee4
[ 33.770050] r10: ee6b394c r9 : ee68bf80 r8 : ee6062c0
[ 33.775508] r7 : 00000000 r6 : ee6062c0 r5 : 0000000b r4 : ee739408
[ 33.782346] r3 : 00000000 r2 : 00000000 r1 : ee71d390 r0 : ee664170
[ 33.789168] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 33.796636] Control: 10c5387d Table: ad0cc059 DAC: 00000015
[ 33.802638] Process bash (pid: 1457, stack limit = 0xee68a248)
[ 33.808740] Stack: (0xee68bec8 to 0xee68c000)
[ 33.813299] bec0: 0000000b c0411284 ee6062c0 00000000 ee68bef4 ee68bee8
[ 33.821862] bee0: c04112ac c04df090 ee68bf14 ee68bef8 c01c2868 c0411290 0000000b ee6b3940
[ 33.830419] bf00: 00000000 00000000 ee68bf4c ee68bf18 c01c1a24 c01c2818 00000000 00000000
[ 33.838990] bf20: ee61b940 ee2f47c0 0000000b 000ce408 ee68bf80 c000f304 ee68a000 00000000
[ 33.847544] bf40: ee68bf7c ee68bf50 c0152dd8 c01c1960 ee68bf7c c0170af8 ee68bf7c ee2f47c0
[ 33.856099] bf60: ee2f47c0 000ce408 0000000b c000f304 ee68bfa4 ee68bf80 c0153330 c0152d34
[ 33.864653] bf80: 00000000 00000000 0000000b 000ce408 b6e7fb50 00000004 00000000 ee68bfa8
[ 33.873204] bfa0: c000f080 c01532e8 0000000b 000ce408 00000001 000ce408 0000000b 00000000
[ 33.881763] bfc0: 0000000b 000ce408 b6e7fb50 00000004 0000000b 00000000 000c5758 00000000
[ 33.890319] bfe0: 00000000 bec2c924 b6de422d b6e1d226 40000030 00000001 75716d2f 00657565
[ 33.898890] [] (usb_udc_softconn_store) from [] (dev_attr_store+0x28/0x34)
[ 33.907920] [] (dev_attr_store) from [] (sysfs_kf_write+0x5c/0x60)
[ 33.916200] [] (sysfs_kf_write) from [] (kernfs_fop_write+0xd0/0x194)
[ 33.924773] [] (kernfs_fop_write) from [] (vfs_write+0xb0/0x1bc)
[ 33.932874] [] (vfs_write) from [] (SyS_write+0x54/0xb0)
[ 33.940247] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x48)
[ 33.948160] Code: e1a01007 e12fff33 e5140004 e5143008 (e5933014)
[ 33.954625] ---[ end trace f849bead94eab7ea ]---Fixes: 2ccea03 (usb: gadget: introduce UDC Class)
Cc: # v3.1+
Signed-off-by: Felipe Balbi -
If NO_DMA=y:
drivers/built-in.o: In function `xudc_done':
udc-xilinx.c:(.text+0x54f4d2): undefined reference to `usb_gadget_unmap_request'
drivers/built-in.o: In function `xudc_dma_send':
udc-xilinx.c:(.text+0x54f9f8): undefined reference to `dma_sync_single_for_cpu'
drivers/built-in.o: In function `xudc_read_fifo':
udc-xilinx.c:(.text+0x54ff4a): undefined reference to `dma_sync_single_for_cpu'
drivers/built-in.o: In function `xudc_ep_queue':
udc-xilinx.c:(.text+0x550e7c): undefined reference to `usb_gadget_map_request'Signed-off-by: Geert Uytterhoeven
Signed-off-by: Felipe Balbi
25 Sep, 2014
3 commits
-
With this patch, USB activity can be signaled by blinking a LED. There
are two triggers, one for activity on USB host and one for USB gadget.Both triggers should work with all host/device controllers. Tested only
with musb.Performace: I measured performance overheads on ARM Cortex-A8 (TI
AM335x) running on 600 MHz.Duration of usb_led_activity():
- with no LED attached to the trigger: 2 ± 1 µs
- with one GPIO LED attached to the trigger: 2 ± 1 µs or 8 ± 2 µs (two peaks in histogram)Duration of functions calling usb_led_activity() (with this patch
applied and no LED attached to the trigger):
- __usb_hcd_giveback_urb(): 10 - 25 µs
- usb_gadget_giveback_request(): 2 - 6 µsSigned-off-by: Michal Sojka
Acked-by: Felipe Balbi
Tested-by: Felipe Balbi
Signed-off-by: Greg Kroah-Hartman -
Use the recently introduced usb_gadget_giveback_request() in favor of
direct invocation of the completion routine.All places in drivers/usb/ matching "[-.]complete(" were replaced with a
call to usb_gadget_giveback_request(). This was compile-tested with all
ARM drivers enabled and runtime-tested for musb.Signed-off-by: Michal Sojka
Acked-by: Felipe Balbi
Tested-by: Felipe Balbi
Signed-off-by: Greg Kroah-Hartman -
All USB peripheral controller drivers call completion routines directly.
This patch adds usb_gadget_giveback_request() which will be used instead
of direct invocation in the next patch. The goal here is to have a place
where common functionality can be added.Signed-off-by: Michal Sojka
Acked-by: Felipe Balbi
Tested-by: Felipe Balbi
Signed-off-by: Greg Kroah-Hartman
16 Sep, 2014
3 commits
-
This adds a bounce buffer that handles the end of OUT requests where
req.length is not divisible by ep->ep.maxpacket.Before this, such requests were rejected as the DMA engine cannot
restrict itself to buffers that are smaller than ep->ep.maxpacket.Signed-off-by: Andreas Larsson
Signed-off-by: Felipe Balbi -
The state attribute is connected to the kobj of the udc, not the gadget.
Signed-off-by: Andreas Larsson
Signed-off-by: Felipe Balbi -
Linux 3.17-rc5
Signed-off-by: Felipe Balbi
Conflicts:
Documentation/devicetree/bindings/usb/mxs-phy.txt
drivers/usb/phy/phy-mxs-usb.c
12 Sep, 2014
2 commits
-
The udc driver can notify the udc core that bus reset occurs by
calling this utility, the core will notify gadget driver this
information and update gadget state accordingly.Signed-off-by: Peter Chen
Signed-off-by: Felipe Balbi -
Xilinx USB2 device is a soft IP which supports both full
and high speed USB 2.0 data transfers. This patch adds
xilinx usb2 device driver support.Signed-off-by: Subbaraya Sundeep Bhatta
Signed-off-by: Felipe Balbi
09 Sep, 2014
1 commit
-
Merge Linux 3.17-rc4 here so we have all the latest
fixes on next too. This also cleans up a few conflicts
when applying patches.Signed-off-by: Felipe Balbi
Conflicts:
drivers/usb/gadget/Makefile
drivers/usb/gadget/function/Makefile
drivers/usb/gadget/legacy/Makefile
drivers/usb/phy/phy-samsung-usb.h
03 Sep, 2014
2 commits
-
Clearly this was meant to be an include guard, but a trailing
underscore was missing. It has been this way since the file was
introduced in 0fe6f1d1 ("usb: udc: add Faraday fusb300 driver").Fixes: 0fe6f1d1 ("usb: udc: add Faraday fusb300 driver")
Cc:
Signed-off-by: Rasmus Villemoes
Signed-off-by: Felipe Balbi -
Without this patch, some hosts keep restarting indefinitely the target.
Fixes: ae8e530 (usb: gadget: net2280: Code Cleanup)
Signed-off-by: Ricardo Ribalda Delgado
Signed-off-by: Felipe Balbi
02 Sep, 2014
1 commit
-
If NO_DMA=y:
drivers/built-in.o: In function `usbhsg_dma_map_ctrl':
mod_gadget.c:(.text+0x53b226): undefined reference to `usb_gadget_map_request'
mod_gadget.c:(.text+0x53b242): undefined reference to `usb_gadget_unmap_request'Signed-off-by: Geert Uytterhoeven
Signed-off-by: Felipe Balbi
30 Aug, 2014
1 commit
-
This patch introduces the use of the functions usb_endpoint_type and
usb_endpoint_num.The Coccinelle semantic patch that makes these changes is as follows:
@@ struct usb_endpoint_descriptor *epd; @@
- (epd->bEndpointAddress & \(USB_ENDPOINT_NUMBER_MASK\|0x0f\))
+ usb_endpoint_num(epd)@@ struct usb_endpoint_descriptor *epd; @@
- (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\))
+ usb_endpoint_type(epd)Signed-off-by: Himangi Saraogi
Acked-by: Julia Lawall
Signed-off-by: Felipe Balbi
21 Aug, 2014
1 commit
-
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.Acked-by: Laurent Pinchart
Signed-off-by: Wei Yongjun
Signed-off-by: Felipe Balbi
20 Aug, 2014
1 commit
-
This patch is to enable the USB gadget device for Intel Quark X1000
Signed-off-by: Bryan O'Donoghue
Signed-off-by: Bing Niu
Signed-off-by: Alvin (Weike) Chen
Signed-off-by: Felipe Balbi
19 Aug, 2014
3 commits
-
In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().Acked-by: Laurent Pinchart
Signed-off-by: Wei Yongjun
Signed-off-by: Felipe Balbi -
As, the interrupt for DMA is counted from 1, so need to checked
the USBA_NR_DMAS, in old way, it only check (USBA_NR_DMAS - 1),
so fix it.Reported-by: Max Liao
Signed-off-by: Bo Shen
Signed-off-by: Felipe Balbi -
Convert a zero return value on error to a negative one, as returned
elsewhere in the function.A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)//
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
//Reviewed-by: Jeff Moyer
Signed-off-by: Julia Lawall
Signed-off-by: Felipe Balbi
22 Jul, 2014
1 commit
-
Felipe writes:
usb: patches for v3.17 merge window
Surprisingly enough, while a big set of patches, the majority is
composed of cleanups (using devm_*, fixing sparse errors, moving
code around, adding const, etc).The highlights are addition of new support for PLX USB338x devices,
and support for USB 2.0-only configurations of the DWC3 IP core.Signed-of-by: Felipe Balbi
17 Jul, 2014
4 commits
-
No functional changes, just fixing one easy to spot
sparse error.While fixing that sparse error, I had to add two
includes to a header to avoid a build error.Signed-off-by: Felipe Balbi
-
No functional changes, just fixing one easy
to spot sparse error.Signed-off-by: Felipe Balbi
-
No functional changes, just fixing some easy
to spot sparse errors.Signed-off-by: Felipe Balbi
-
The drivers/usb/gadget directory contains many files.
Files which are related can be distributed into separate directories.
This patch moves the UDC drivers into a separate directory.Signed-off-by: Andrzej Pietrasiewicz
Signed-off-by: Felipe Balbi