summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-05-22 08:06:26 +0200
committerDenys Dmytriyenko <denys@ti.com>2012-05-29 15:49:27 -0400
commit0dc054072d133ba96cc799ef9ac4b9f37b69a139 (patch)
tree1e705fe43aab825662b3a116fddd31cf18babed7
parentca33f0eb2def9d0a8c51ef8ed8adedbcb507691d (diff)
downloadmeta-ti-0dc054072d133ba96cc799ef9ac4b9f37b69a139.tar.gz
linux-ti33x-psp 3.2: merge in 6 musb patches from PSP
Updating the SRCREV would require redoing all boardfile patches due to the EVM-SK changes. So cherry-pick the 6 patches we need. Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0001-usb-musb-cppi41-revisit-the-teardown-path-to-fix-iso.patch103
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0002-usb-musb-fix-bug-in-data-toggle-sw-workaround.patch31
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0003-usb-gadget-udc-core-stop-UDC-on-device-initiated-dis.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0004-usb-gadget-udc-core-fix-asymmetric-calls-in-remove_d.patch43
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0005-usb-gadget-udc-core-fix-wrong-call-order.patch33
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0006-usb-gadget-udc-core-fix-incompatibility-with-dummy-h.patch46
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp_3.2.bb8
7 files changed, 304 insertions, 1 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0001-usb-musb-cppi41-revisit-the-teardown-path-to-fix-iso.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0001-usb-musb-cppi41-revisit-the-teardown-path-to-fix-iso.patch
new file mode 100644
index 00000000..dd2e19ab
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0001-usb-musb-cppi41-revisit-the-teardown-path-to-fix-iso.patch
@@ -0,0 +1,103 @@
1From c2746810dc7bcaaae2dec493c501eb7213d14858 Mon Sep 17 00:00:00 2001
2From: Ajay Kumar Gupta <ajay.gupta@ti.com>
3Date: Tue, 8 May 2012 12:05:47 +0530
4Subject: [PATCH 1/6] usb: musb: cppi41: revisit the teardown path to fix isoc
5 issue
6
7Fixes the camera streaming issue when application is stopped and restarted multiple times.
8Changes:
9 - Disable DMAReq of TX/RX endpoints before teardown
10 - FIFO flush only when RxPktRdy is set
11 - Clear ReqPkt if in host mode.
12---
13 drivers/usb/musb/cppi41_dma.c | 42 ++++++++++++++++++++++++----------------
14 drivers/usb/musb/musb_host.c | 2 +-
15 2 files changed, 26 insertions(+), 18 deletions(-)
16
17diff --git a/drivers/usb/musb/cppi41_dma.c b/drivers/usb/musb/cppi41_dma.c
18index e4d3173..4761acd 100644
19--- a/drivers/usb/musb/cppi41_dma.c
20+++ b/drivers/usb/musb/cppi41_dma.c
21@@ -1206,6 +1206,11 @@ static int cppi41_channel_abort(struct dma_channel *channel)
22 if (cppi_ch->transmit) {
23 dprintk("Tx channel teardown, cppi_ch = %p\n", cppi_ch);
24
25+ /* disable the DMAreq before teardown */
26+ csr = musb_readw(epio, MUSB_TXCSR);
27+ csr &= ~MUSB_TXCSR_DMAENAB;
28+ musb_writew(epio, MUSB_TXCSR, csr);
29+
30 /* Tear down Tx DMA channel */
31 usb_tx_ch_teardown(cppi_ch);
32
33@@ -1223,11 +1228,30 @@ static int cppi41_channel_abort(struct dma_channel *channel)
34 } else { /* Rx */
35 dprintk("Rx channel teardown, cppi_ch = %p\n", cppi_ch);
36
37+ /* disable the DMAreq and remove reqpkt */
38+ csr = musb_readw(epio, MUSB_RXCSR);
39+ dev_dbg(musb->controller,
40+ "before rx-teardown: rxcsr %x rxcount %x\n", csr,
41+ musb_readw(epio, MUSB_RXCOUNT));
42+
43+ /* For host, clear (just) ReqPkt at end of current packet(s) */
44+ if (is_host_active(cppi->musb))
45+ csr &= ~MUSB_RXCSR_H_REQPKT;
46+
47+ csr &= ~MUSB_RXCSR_DMAENAB;
48+ musb_writew(epio, MUSB_RXCSR, csr);
49+
50+
51 /* Flush FIFO of the endpoint */
52 csr = musb_readw(epio, MUSB_RXCSR);
53- csr |= MUSB_RXCSR_FLUSHFIFO | MUSB_RXCSR_H_WZC_BITS;
54+
55+ if (csr & MUSB_RXCSR_RXPKTRDY)
56+ csr |= MUSB_RXCSR_FLUSHFIFO;
57+
58+ csr |= MUSB_RXCSR_H_WZC_BITS;
59 musb_writew(epio, MUSB_RXCSR, csr);
60 musb_writew(epio, MUSB_RXCSR, csr);
61+ csr = musb_readw(epio, MUSB_RXCSR);
62
63 /* Issue CPPI FIFO teardown for Rx channel */
64 td_reg = musb_readl(reg_base, cppi->teardown_reg_offs);
65@@ -1246,22 +1270,6 @@ static int cppi41_channel_abort(struct dma_channel *channel)
66
67 /* For host, ensure ReqPkt is never set again */
68 cppi41_autoreq_update(cppi_ch, USB_NO_AUTOREQ);
69-
70- /* For host, clear (just) ReqPkt at end of current packet(s) */
71- if (is_host_active(cppi->musb))
72- csr &= ~MUSB_RXCSR_H_REQPKT;
73- csr |= MUSB_RXCSR_H_WZC_BITS;
74-
75- /* Clear DMA enable */
76- csr &= ~MUSB_RXCSR_DMAENAB;
77- musb_writew(epio, MUSB_RXCSR, csr);
78-
79- /* Flush the FIFO of endpoint once again */
80- csr = musb_readw(epio, MUSB_RXCSR);
81- csr |= MUSB_RXCSR_FLUSHFIFO | MUSB_RXCSR_H_WZC_BITS;
82- musb_writew(epio, MUSB_RXCSR, csr);
83-
84- udelay(50);
85 }
86
87 /*
88diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
89index d805d1b..2195633 100644
90--- a/drivers/usb/musb/musb_host.c
91+++ b/drivers/usb/musb/musb_host.c
92@@ -2224,7 +2224,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh)
93 }
94
95 /* turn off DMA requests, discard state, stop polling ... */
96- if (is_in) {
97+ if (is_in && ep->epnum) {
98 /* giveback saves bulk toggle */
99 csr = musb_h_flush_rxfifo(ep, 0);
100
101--
1021.7.7.6
103
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0002-usb-musb-fix-bug-in-data-toggle-sw-workaround.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0002-usb-musb-fix-bug-in-data-toggle-sw-workaround.patch
new file mode 100644
index 00000000..dab230c5
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0002-usb-musb-fix-bug-in-data-toggle-sw-workaround.patch
@@ -0,0 +1,31 @@
1From a9e9e758646ee41289c0030645bbdd43c711e9c1 Mon Sep 17 00:00:00 2001
2From: Ajay Kumar Gupta <ajay.gupta@ti.com>
3Date: Fri, 18 May 2012 14:51:15 +0530
4Subject: [PATCH 2/6] usb: musb: fix bug in data toggle sw workaround
5
6Data toggle software workaround for extra IN issue introduced a bug for PIO mode
7as data toggle is getting updated even for PIO mode which should not be done.
8
9Merge to:
10usb: musb: cppi41: correct data toggle mismatch to fix extra IN token issue
11---
12 drivers/usb/musb/musb_host.c | 3 ++-
13 1 files changed, 2 insertions(+), 1 deletions(-)
14
15diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
16index 2195633..80d83bd 100644
17--- a/drivers/usb/musb/musb_host.c
18+++ b/drivers/usb/musb/musb_host.c
19@@ -359,7 +359,8 @@ static inline void musb_save_toggle(struct musb_qh *qh, int is_in,
20 curr_toggle = csr ? 1 : 0;
21
22 /* check if data toggle has gone out of sync */
23- if (curr_toggle == qh->hw_ep->prev_toggle) {
24+ if (is_dma_capable() && qh->hw_ep->rx_channel &&
25+ curr_toggle == qh->hw_ep->prev_toggle) {
26 dev_dbg(musb->controller,
27 "Data toggle same as previous (=%d) on ep%d\n",
28 curr_toggle, qh->hw_ep->epnum);
29--
301.7.7.6
31
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0003-usb-gadget-udc-core-stop-UDC-on-device-initiated-dis.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0003-usb-gadget-udc-core-stop-UDC-on-device-initiated-dis.patch
new file mode 100644
index 00000000..88a1fb91
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0003-usb-gadget-udc-core-stop-UDC-on-device-initiated-dis.patch
@@ -0,0 +1,41 @@
1From 2eac6057134bcb77edcdc462b810465850caec23 Mon Sep 17 00:00:00 2001
2From: Felipe Balbi <balbi@ti.com>
3Date: Thu, 15 Mar 2012 16:37:18 +0200
4Subject: [PATCH 3/6] usb: gadget: udc-core: stop UDC on device-initiated
5 disconnect
6
7When we want to do device-initiated disconnect,
8let's make sure we stop the UDC in order to
9e.g. allow lower power states to be achieved by
10turning off unnecessary clocks and/or stoping
11PHYs.
12
13When reconnecting, call ->udc_start() again to
14make sure UDC is reinitialized.
15
16Cc: stable@vger.kernel.org
17Signed-off-by: Felipe Balbi <balbi@ti.com>
18---
19 drivers/usb/gadget/udc-core.c | 4 ++++
20 1 files changed, 4 insertions(+), 0 deletions(-)
21
22diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
23index 0b0d12c..475c997 100644
24--- a/drivers/usb/gadget/udc-core.c
25+++ b/drivers/usb/gadget/udc-core.c
26@@ -359,8 +359,12 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
27 struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
28
29 if (sysfs_streq(buf, "connect")) {
30+ if (udc_is_newstyle(udc))
31+ usb_gadget_udc_start(udc->gadget, udc->driver);
32 usb_gadget_connect(udc->gadget);
33 } else if (sysfs_streq(buf, "disconnect")) {
34+ if (udc_is_newstyle(udc))
35+ usb_gadget_udc_stop(udc->gadget, udc->driver);
36 usb_gadget_disconnect(udc->gadget);
37 } else {
38 dev_err(dev, "unsupported command '%s'\n", buf);
39--
401.7.7.6
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0004-usb-gadget-udc-core-fix-asymmetric-calls-in-remove_d.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0004-usb-gadget-udc-core-fix-asymmetric-calls-in-remove_d.patch
new file mode 100644
index 00000000..eae1c70f
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0004-usb-gadget-udc-core-fix-asymmetric-calls-in-remove_d.patch
@@ -0,0 +1,43 @@
1From fefa8fade565b137ae3d01801196840b6ccfc98f Mon Sep 17 00:00:00 2001
2From: Kishon Vijay Abraham I <kishon@ti.com>
3Date: Wed, 21 Mar 2012 21:34:30 +0530
4Subject: [PATCH 4/6] usb: gadget: udc-core: fix asymmetric calls in
5 remove_driver
6
7During modprobe of gadget driver, pullup is called after
8udc_start. In order to make the exit path symmetric when
9removing a gadget driver, call pullup before ->udc_stop.
10
11This is needed to avoid issues with PM where udc_stop
12disables the module completely (put IP in reset state,
13cut functional and interface clocks, and so on), which
14prevents us from accessing the IP's address space,
15thus creating the possibility of an abort exception
16when we try to access IP's address space after clocks
17are off.
18
19Cc: stable@vger.kernel.org
20Signed-off-by: Partha Basak <p-basak2@ti.com>
21Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
22Signed-off-by: Felipe Balbi <balbi@ti.com>
23---
24 drivers/usb/gadget/udc-core.c | 2 +-
25 1 files changed, 1 insertions(+), 1 deletions(-)
26
27diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
28index 475c997..ec02ed0 100644
29--- a/drivers/usb/gadget/udc-core.c
30+++ b/drivers/usb/gadget/udc-core.c
31@@ -212,8 +212,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
32 if (udc_is_newstyle(udc)) {
33 udc->driver->disconnect(udc->gadget);
34 udc->driver->unbind(udc->gadget);
35- usb_gadget_udc_stop(udc->gadget, udc->driver);
36 usb_gadget_disconnect(udc->gadget);
37+ usb_gadget_udc_stop(udc->gadget, udc->driver);
38 } else {
39 usb_gadget_stop(udc->gadget, udc->driver);
40 }
41--
421.7.7.6
43
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0005-usb-gadget-udc-core-fix-wrong-call-order.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0005-usb-gadget-udc-core-fix-wrong-call-order.patch
new file mode 100644
index 00000000..ae705cf3
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0005-usb-gadget-udc-core-fix-wrong-call-order.patch
@@ -0,0 +1,33 @@
1From 7a0dcaac06bfffd4df4bf7a006c601b31acc7cb7 Mon Sep 17 00:00:00 2001
2From: Felipe Balbi <balbi@ti.com>
3Date: Fri, 27 Apr 2012 11:02:15 +0300
4Subject: [PATCH 5/6] usb: gadget: udc-core: fix wrong call order
5
6commit 6d258a4 (usb: gadget: udc-core: stop UDC on device-initiated
7disconnect) introduced another case of asymmetric calls when issuing
8a device-initiated disconnect. Fix it.
9
10Reported-by: Ben Hutchings <ben@decadent.org.uk>
11Signed-off-by: Felipe Balbi <balbi@ti.com>
12---
13 drivers/usb/gadget/udc-core.c | 2 +-
14 1 files changed, 1 insertions(+), 1 deletions(-)
15
16diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
17index ec02ed0..3ea783d 100644
18--- a/drivers/usb/gadget/udc-core.c
19+++ b/drivers/usb/gadget/udc-core.c
20@@ -363,9 +363,9 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
21 usb_gadget_udc_start(udc->gadget, udc->driver);
22 usb_gadget_connect(udc->gadget);
23 } else if (sysfs_streq(buf, "disconnect")) {
24+ usb_gadget_disconnect(udc->gadget);
25 if (udc_is_newstyle(udc))
26 usb_gadget_udc_stop(udc->gadget, udc->driver);
27- usb_gadget_disconnect(udc->gadget);
28 } else {
29 dev_err(dev, "unsupported command '%s'\n", buf);
30 return -EINVAL;
31--
321.7.7.6
33
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0006-usb-gadget-udc-core-fix-incompatibility-with-dummy-h.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0006-usb-gadget-udc-core-fix-incompatibility-with-dummy-h.patch
new file mode 100644
index 00000000..70f93984
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/usb/0006-usb-gadget-udc-core-fix-incompatibility-with-dummy-h.patch
@@ -0,0 +1,46 @@
1From 91cdc6fbc271e01e231dcf0e9403448aa19433fb Mon Sep 17 00:00:00 2001
2From: Alan Stern <stern@rowland.harvard.edu>
3Date: Thu, 26 Apr 2012 11:31:57 -0400
4Subject: [PATCH 6/6] usb: gadget: udc-core: fix incompatibility with
5 dummy-hcd
6
7This patch (as1548) fixes a recently-introduced incompatibility
8between the UDC core and the dummy-hcd driver. Commit
98ae8090c82eb407267001f75b3d256b3bd4ae691 (usb: gadget: udc-core: fix
10asymmetric calls in remove_driver) moved the usb_gadget_udc_stop()
11call in usb_gadget_remove_driver() below the usb_gadget_disconnect()
12call.
13
14As a result, usb_gadget_disconnect() gets called at a time when the
15gadget driver believes it has been unbound but dummy-hcd believes
16it has not. A nasty error ensues when dummy-hcd calls the gadget
17driver's disconnect method a second time.
18
19To fix the problem, this patch moves the gadget driver's unbind
20notification after the usb_gadget_disconnect() call. Now nothing
21happens between the two unbind notifications, so nothing goes wrong.
22
23Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
24Tested-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
25Signed-off-by: Felipe Balbi <balbi@ti.com>
26---
27 drivers/usb/gadget/udc-core.c | 2 +-
28 1 files changed, 1 insertions(+), 1 deletions(-)
29
30diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
31index 3ea783d..4e2e13e 100644
32--- a/drivers/usb/gadget/udc-core.c
33+++ b/drivers/usb/gadget/udc-core.c
34@@ -211,8 +211,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
35
36 if (udc_is_newstyle(udc)) {
37 udc->driver->disconnect(udc->gadget);
38- udc->driver->unbind(udc->gadget);
39 usb_gadget_disconnect(udc->gadget);
40+ udc->driver->unbind(udc->gadget);
41 usb_gadget_udc_stop(udc->gadget, udc->driver);
42 } else {
43 usb_gadget_stop(udc->gadget, udc->driver);
44--
451.7.7.6
46
diff --git a/recipes-kernel/linux/linux-ti33x-psp_3.2.bb b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb
index 888c7a3d..82fa5ebe 100644
--- a/recipes-kernel/linux/linux-ti33x-psp_3.2.bb
+++ b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb
@@ -12,7 +12,7 @@ MULTI_CONFIG_BASE_SUFFIX = ""
12 12
13BRANCH = "v3.2-staging" 13BRANCH = "v3.2-staging"
14SRCREV = "720e07b4c1f687b61b147b31c698cb6816d72f01" 14SRCREV = "720e07b4c1f687b61b147b31c698cb6816d72f01"
15MACHINE_KERNEL_PR_append = "m+gitr${SRCREV}" 15MACHINE_KERNEL_PR_append = "n+gitr${SRCREV}"
16 16
17COMPATIBLE_MACHINE = "(ti33x)" 17COMPATIBLE_MACHINE = "(ti33x)"
18 18
@@ -29,6 +29,12 @@ do_compile_prepend() {
29} 29}
30 30
31PATCHES_OVER_PSP = " \ 31PATCHES_OVER_PSP = " \
32 file://usb/0001-usb-musb-cppi41-revisit-the-teardown-path-to-fix-iso.patch \
33 file://usb/0002-usb-musb-fix-bug-in-data-toggle-sw-workaround.patch \
34 file://usb/0003-usb-gadget-udc-core-stop-UDC-on-device-initiated-dis.patch \
35 file://usb/0004-usb-gadget-udc-core-fix-asymmetric-calls-in-remove_d.patch \
36 file://usb/0005-usb-gadget-udc-core-fix-wrong-call-order.patch \
37 file://usb/0006-usb-gadget-udc-core-fix-incompatibility-with-dummy-h.patch \
32 file://3.2.1/0001-MAINTAINERS-stable-Update-address.patch \ 38 file://3.2.1/0001-MAINTAINERS-stable-Update-address.patch \
33 file://3.2.1/0002-Documentation-Update-stable-address.patch \ 39 file://3.2.1/0002-Documentation-Update-stable-address.patch \
34 file://3.2.1/0003-firmware-Fix-an-oops-on-reading-fw_priv-fw-in-sysfs-.patch \ 40 file://3.2.1/0003-firmware-Fix-an-oops-on-reading-fw_priv-fw-in-sysfs-.patch \