<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/usb/chipidea/udc.c, branch v3.15-rc1</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>usb: chipidea: udc: refine isr_tr_complete_handler</title>
<updated>2014-03-12T19:32:21+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2014-03-11T05:47:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d7b00e310b3342a6c5b8f648283ea55665614b67'/>
<id>d7b00e310b3342a6c5b8f648283ea55665614b67</id>
<content type='text'>
Matthieu CASTET and Michael Grzeschik mentioned isr_tr_complete_handler
is a bit messy at below:
http://marc.info/?l=linux-usb&amp;m=139047775001152&amp;w=2

This commit creates a new function isr_setup_packet_handler to handle
setup packet, it makes isr_tr_complete_handler easy to read.

This is no functional change at this commit, tested with g_mass_storage
and g_ether.

Cc: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Cc: Matthieu CASTET &lt;matthieu.castet@parrot.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Matthieu CASTET and Michael Grzeschik mentioned isr_tr_complete_handler
is a bit messy at below:
http://marc.info/?l=linux-usb&amp;m=139047775001152&amp;w=2

This commit creates a new function isr_setup_packet_handler to handle
setup packet, it makes isr_tr_complete_handler easy to read.

This is no functional change at this commit, tested with g_mass_storage
and g_ether.

Cc: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Cc: Matthieu CASTET &lt;matthieu.castet@parrot.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: chipidea: udc: refine ep operation at isr_tr_complete_handler</title>
<updated>2014-02-25T01:07:52+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2014-02-19T05:41:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=64fc06c40e01aa8129f5bc4c51567b5e205126b0'/>
<id>64fc06c40e01aa8129f5bc4c51567b5e205126b0</id>
<content type='text'>
- delete the warning message at interrupt handler, and adds judgement at
ep_enable, if non-ep0 requests ctrl transfer, it will indicate an error.
- delete hw_test_and_clear_setup_status which is a broken code
- Tested with g_mass_storage, g_ncm, g_ether

Cc: matthieu.castet@parrot.com
Reported-by: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Acked-by: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Tested-by: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- delete the warning message at interrupt handler, and adds judgement at
ep_enable, if non-ep0 requests ctrl transfer, it will indicate an error.
- delete hw_test_and_clear_setup_status which is a broken code
- Tested with g_mass_storage, g_ncm, g_ether

Cc: matthieu.castet@parrot.com
Reported-by: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Acked-by: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Tested-by: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: chipidea: refine PHY operation</title>
<updated>2014-02-25T01:07:52+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2014-02-19T05:41:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c859aa65a7ec40c02f435f14fa71de2a87c64513'/>
<id>c859aa65a7ec40c02f435f14fa71de2a87c64513</id>
<content type='text'>
- Delete global_phy due to we can get the phy from phy layer now
- using devm_usb_get_phy to instead of usb_get_phy
- delete the otg_set_peripheral, which should be handled by otg layer

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Delete global_phy due to we can get the phy from phy layer now
- using devm_usb_get_phy to instead of usb_get_phy
- delete the otg_set_peripheral, which should be handled by otg layer

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: chipidea: need to mask when writting endptflush and endptprime</title>
<updated>2014-02-21T20:34:45+00:00</updated>
<author>
<name>Matthieu CASTET</name>
<email>matthieu.castet@parrot.com</email>
</author>
<published>2014-02-19T05:46:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5bf5dbeda2454296f1984adfbfc8e6f5965ac389'/>
<id>5bf5dbeda2454296f1984adfbfc8e6f5965ac389</id>
<content type='text'>
ENDPTFLUSH and ENDPTPRIME registers are set by software and clear
by hardware. There is a bit for each endpoint. When we are setting
a bit for an endpoint we should make sure we do not touch other
endpoint bit. There is a race condition if the hardware clear the
bit between the read and the write in hw_write.

Cc: stable &lt;stable@vger.kernel.org&gt; # 3.11+
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Matthieu CASTET &lt;matthieu.castet@parrot.com&gt;
Tested-by: Michael Grzeschik &lt;mgrzeschik@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ENDPTFLUSH and ENDPTPRIME registers are set by software and clear
by hardware. There is a bit for each endpoint. When we are setting
a bit for an endpoint we should make sure we do not touch other
endpoint bit. There is a race condition if the hardware clear the
bit between the read and the write in hw_write.

Cc: stable &lt;stable@vger.kernel.org&gt; # 3.11+
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Matthieu CASTET &lt;matthieu.castet@parrot.com&gt;
Tested-by: Michael Grzeschik &lt;mgrzeschik@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: chipidea: udc: using MultO at TD as real mult value for ISO-TX</title>
<updated>2014-01-13T23:55:19+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2014-01-10T05:51:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2fc5a7dace3c43e62402ab4e8800a8f1834ffe2a'/>
<id>2fc5a7dace3c43e62402ab4e8800a8f1834ffe2a</id>
<content type='text'>
We have met a bug that the high bandwidth ISO-TX transfer has failed
at the last packet if it is less than 1024, the TD status shows it
is "Transaction Error".

The root cause of this problem is: the mult value at qh is not correct
for current TD's transfer length. We use TD list to queue un-transfer
TDs, and change mult for new adding TDs. If new adding TDs transfer length
less than 1024, but the queued un-transfer TDs transfer length is larger
than 1024, the transfer error will occur, and vice versa.
Usually, this problem occurs at the last packet, and the first packet for
new frame.

We fixed this problem by setting Mult at QH as the largest value (3), and
set MultO (Multiplier Override) at TD according to every transfer length.
It can cover both hardware version less than 2.3 (the real mult is MultO
if it is not 0) and 2.3+ (the real mult is min(qh.mult, td.multo)).

Since the MultO bits are only existed at TX TD, we keep the ISO-RX behavior
unchanged.

For stable tree: 3.11+.

Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Reported-by: Matthieu Vanin &lt;b47495@freescale.com&gt;
Tested-by: Matthieu Vanin &lt;b47495@freescale.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have met a bug that the high bandwidth ISO-TX transfer has failed
at the last packet if it is less than 1024, the TD status shows it
is "Transaction Error".

The root cause of this problem is: the mult value at qh is not correct
for current TD's transfer length. We use TD list to queue un-transfer
TDs, and change mult for new adding TDs. If new adding TDs transfer length
less than 1024, but the queued un-transfer TDs transfer length is larger
than 1024, the transfer error will occur, and vice versa.
Usually, this problem occurs at the last packet, and the first packet for
new frame.

We fixed this problem by setting Mult at QH as the largest value (3), and
set MultO (Multiplier Override) at TD according to every transfer length.
It can cover both hardware version less than 2.3 (the real mult is MultO
if it is not 0) and 2.3+ (the real mult is min(qh.mult, td.multo)).

Since the MultO bits are only existed at TX TD, we keep the ISO-RX behavior
unchanged.

For stable tree: 3.11+.

Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Reported-by: Matthieu Vanin &lt;b47495@freescale.com&gt;
Tested-by: Matthieu Vanin &lt;b47495@freescale.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'v3.13-rc5' into next</title>
<updated>2013-12-23T17:22:46+00:00</updated>
<author>
<name>Felipe Balbi</name>
<email>balbi@ti.com</email>
</author>
<published>2013-12-23T17:22:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e90b8417af0d01cf8c64da6937c914c89ccf6dc1'/>
<id>e90b8417af0d01cf8c64da6937c914c89ccf6dc1</id>
<content type='text'>
Linux 3.13-rc5

* tag 'v3.13-rc5': (231 commits)
  Linux 3.13-rc5
  aio: clean up and fix aio_setup_ring page mapping
  aio/migratepages: make aio migrate pages sane
  aio: fix kioctx leak introduced by "aio: Fix a trinity splat"
  Don't set the INITRD_COMPRESS environment variable automatically
  mm: fix build of split ptlock code
  pstore: Don't allow high traffic options on fragile devices
  mm: do not allocate page-&gt;ptl dynamically, if spinlock_t fits to long
  mm: page_alloc: revert NUMA aspect of fair allocation policy
  Revert "mm: page_alloc: exclude unreclaimable allocations from zone fairness policy"
  mm: Fix NULL pointer dereference in madvise(MADV_WILLNEED) support
  qla2xxx: Fix scsi_host leak on qlt_lport_register callback failure
  target: Remove extra percpu_ref_init
  arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
  ARC: Allow conditional multiple inclusion of uapi/asm/unistd.h
  target/file: Update hw_max_sectors based on current block_size
  iser-target: Move INIT_WORK setup into isert_create_device_ib_res
  iscsi-target: Fix incorrect np-&gt;np_thread NULL assignment
  mm/hugetlb: check for pte NULL pointer in __page_check_address()
  fix build with make 3.80
  ...

Conflicts:
	drivers/usb/phy/Kconfig
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Linux 3.13-rc5

* tag 'v3.13-rc5': (231 commits)
  Linux 3.13-rc5
  aio: clean up and fix aio_setup_ring page mapping
  aio/migratepages: make aio migrate pages sane
  aio: fix kioctx leak introduced by "aio: Fix a trinity splat"
  Don't set the INITRD_COMPRESS environment variable automatically
  mm: fix build of split ptlock code
  pstore: Don't allow high traffic options on fragile devices
  mm: do not allocate page-&gt;ptl dynamically, if spinlock_t fits to long
  mm: page_alloc: revert NUMA aspect of fair allocation policy
  Revert "mm: page_alloc: exclude unreclaimable allocations from zone fairness policy"
  mm: Fix NULL pointer dereference in madvise(MADV_WILLNEED) support
  qla2xxx: Fix scsi_host leak on qlt_lport_register callback failure
  target: Remove extra percpu_ref_init
  arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
  ARC: Allow conditional multiple inclusion of uapi/asm/unistd.h
  target/file: Update hw_max_sectors based on current block_size
  iser-target: Move INIT_WORK setup into isert_create_device_ib_res
  iscsi-target: Fix incorrect np-&gt;np_thread NULL assignment
  mm/hugetlb: check for pte NULL pointer in __page_check_address()
  fix build with make 3.80
  ...

Conflicts:
	drivers/usb/phy/Kconfig
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: add "maxpacket_limit" field to struct usb_ep</title>
<updated>2013-12-17T19:17:41+00:00</updated>
<author>
<name>Robert Baldyga</name>
<email>r.baldyga@samsung.com</email>
</author>
<published>2013-12-13T11:23:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e117e742d310683b410951faeab4b13b6c3c609f'/>
<id>e117e742d310683b410951faeab4b13b6c3c609f</id>
<content type='text'>
This patch adds "maxpacket_limit" to struct usb_ep. This field contains
maximum value of maxpacket supported by driver, and is set in driver probe.
This value should be used by autoconfig() function, because value of field
"maxpacket" is set to value from endpoint descriptor when endpoint becomes
enabled. So when autoconfig() function will be called again for this endpoint,
"maxpacket" value will contain wMaxPacketSize from descriptior instead of
maximum packet size for this endpoint.

For this reason this patch adds new field "maxpacket_limit" which contains
value of maximum packet size (which defines maximum endpoint capabilities).
This value is used in ep_matches() function used by autoconfig().

Value of "maxpacket_limit" should be set in UDC driver probe function, using
usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function
set choosen value to both "maxpacket_limit" and "maxpacket" fields.

This patch modifies UDC drivers by adding support for maxpacket_limit.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds "maxpacket_limit" to struct usb_ep. This field contains
maximum value of maxpacket supported by driver, and is set in driver probe.
This value should be used by autoconfig() function, because value of field
"maxpacket" is set to value from endpoint descriptor when endpoint becomes
enabled. So when autoconfig() function will be called again for this endpoint,
"maxpacket" value will contain wMaxPacketSize from descriptior instead of
maximum packet size for this endpoint.

For this reason this patch adds new field "maxpacket_limit" which contains
value of maximum packet size (which defines maximum endpoint capabilities).
This value is used in ep_matches() function used by autoconfig().

Value of "maxpacket_limit" should be set in UDC driver probe function, using
usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function
set choosen value to both "maxpacket_limit" and "maxpacket" fields.

This patch modifies UDC drivers by adding support for maxpacket_limit.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: chipidea: fix nobody cared IRQ when booting with host role</title>
<updated>2013-12-09T21:14:12+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2013-12-05T07:20:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5a1e1456fc633da5291285b1fff75d2a7507375b'/>
<id>5a1e1456fc633da5291285b1fff75d2a7507375b</id>
<content type='text'>
If we connect Male-A-To-Male-A cable between otg-host and host pc,
the ci-&gt;vbus_active is set wrongly, and cause the controller run
at peripheral mode when we load gadget module (ci_udc_start will be run),
but the software runs at host mode due to id = 0. The ehci_irq
can't handle suspend (USBi_SLI) interrupt which is enabled for
peripheral mode, it causes no one will handle irq error.

This patch is needed for 3.12 stable

Cc: stable &lt;stable@vger.kernel.org&gt;
Acked-by: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Reported-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Tested-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we connect Male-A-To-Male-A cable between otg-host and host pc,
the ci-&gt;vbus_active is set wrongly, and cause the controller run
at peripheral mode when we load gadget module (ci_udc_start will be run),
but the software runs at host mode due to id = 0. The ehci_irq
can't handle suspend (USBi_SLI) interrupt which is enabled for
peripheral mode, it causes no one will handle irq error.

This patch is needed for 3.12 stable

Cc: stable &lt;stable@vger.kernel.org&gt;
Acked-by: Michael Grzeschik &lt;mgr@pengutronix.de&gt;
Reported-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Tested-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: chipidea: udc: Fix calling spin_lock_irqsave at sleep context</title>
<updated>2013-10-11T23:25:15+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2013-10-08T02:30:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=65b2fb32b5ce53e103e026b6f95b784c5921cd2e'/>
<id>65b2fb32b5ce53e103e026b6f95b784c5921cd2e</id>
<content type='text'>
Fixing the below dump:

root@freescale ~$ modprobe g_serial
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
BUG: sleeping function called from invalid context at /home/b29397/work/projects/upstream/usb/usb/drivers/base/power/runtime.c:952
in_atomic(): 1, irqs_disabled(): 128, pid: 805, name: modprobe
2 locks held by modprobe/805:
 #0:  (udc_lock){+.+.+.}, at: [&lt;7f000a74&gt;] usb_gadget_probe_driver+0x44/0xb4 [udc_core]
 #1:  (&amp;(&amp;ci-&gt;lock)-&gt;rlock){......}, at: [&lt;7f033488&gt;] ci_udc_start+0x94/0x110 [ci_hdrc]
irq event stamp: 3878
hardirqs last  enabled at (3877): [&lt;806b6720&gt;] _raw_spin_unlock_irqrestore+0x40/0x6c
hardirqs last disabled at (3878): [&lt;806b6474&gt;] _raw_spin_lock_irqsave+0x2c/0xa8
softirqs last  enabled at (3872): [&lt;8002ec0c&gt;] __do_softirq+0x1c8/0x2e8
softirqs last disabled at (3857): [&lt;8002f180&gt;] irq_exit+0xbc/0x110
CPU: 0 PID: 805 Comm: modprobe Not tainted 3.11.0-next-20130910+ #85
[&lt;80016b94&gt;] (unwind_backtrace+0x0/0xf8) from [&lt;80012e0c&gt;] (show_stack+0x20/0x24)
[&lt;80012e0c&gt;] (show_stack+0x20/0x24) from [&lt;806af554&gt;] (dump_stack+0x9c/0xc4)
[&lt;806af554&gt;] (dump_stack+0x9c/0xc4) from [&lt;8005940c&gt;] (__might_sleep+0xf4/0x134)
[&lt;8005940c&gt;] (__might_sleep+0xf4/0x134) from [&lt;803a04a4&gt;] (__pm_runtime_resume+0x94/0xa0)
[&lt;803a04a4&gt;] (__pm_runtime_resume+0x94/0xa0) from [&lt;7f0334a4&gt;] (ci_udc_start+0xb0/0x110 [ci_hdrc])
[&lt;7f0334a4&gt;] (ci_udc_start+0xb0/0x110 [ci_hdrc]) from [&lt;7f0009b4&gt;] (udc_bind_to_driver+0x5c/0xd8 [udc_core])
[&lt;7f0009b4&gt;] (udc_bind_to_driver+0x5c/0xd8 [udc_core]) from [&lt;7f000ab0&gt;] (usb_gadget_probe_driver+0x80/0xb4 [udc_core])
[&lt;7f000ab0&gt;] (usb_gadget_probe_driver+0x80/0xb4 [udc_core]) from [&lt;7f008618&gt;] (usb_composite_probe+0xac/0xd8 [libcomposite])
[&lt;7f008618&gt;] (usb_composite_probe+0xac/0xd8 [libcomposite]) from [&lt;7f04b168&gt;] (init+0x8c/0xb4 [g_serial])
[&lt;7f04b168&gt;] (init+0x8c/0xb4 [g_serial]) from [&lt;800088e8&gt;] (do_one_initcall+0x108/0x16c)
[&lt;800088e8&gt;] (do_one_initcall+0x108/0x16c) from [&lt;8008e518&gt;] (load_module+0x1b00/0x20a4)
[&lt;8008e518&gt;] (load_module+0x1b00/0x20a4) from [&lt;8008eba8&gt;] (SyS_init_module+0xec/0x100)
[&lt;8008eba8&gt;] (SyS_init_module+0xec/0x100) from [&lt;8000ec40&gt;] (ret_fast_syscall+0x0/0x48)

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixing the below dump:

root@freescale ~$ modprobe g_serial
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
BUG: sleeping function called from invalid context at /home/b29397/work/projects/upstream/usb/usb/drivers/base/power/runtime.c:952
in_atomic(): 1, irqs_disabled(): 128, pid: 805, name: modprobe
2 locks held by modprobe/805:
 #0:  (udc_lock){+.+.+.}, at: [&lt;7f000a74&gt;] usb_gadget_probe_driver+0x44/0xb4 [udc_core]
 #1:  (&amp;(&amp;ci-&gt;lock)-&gt;rlock){......}, at: [&lt;7f033488&gt;] ci_udc_start+0x94/0x110 [ci_hdrc]
irq event stamp: 3878
hardirqs last  enabled at (3877): [&lt;806b6720&gt;] _raw_spin_unlock_irqrestore+0x40/0x6c
hardirqs last disabled at (3878): [&lt;806b6474&gt;] _raw_spin_lock_irqsave+0x2c/0xa8
softirqs last  enabled at (3872): [&lt;8002ec0c&gt;] __do_softirq+0x1c8/0x2e8
softirqs last disabled at (3857): [&lt;8002f180&gt;] irq_exit+0xbc/0x110
CPU: 0 PID: 805 Comm: modprobe Not tainted 3.11.0-next-20130910+ #85
[&lt;80016b94&gt;] (unwind_backtrace+0x0/0xf8) from [&lt;80012e0c&gt;] (show_stack+0x20/0x24)
[&lt;80012e0c&gt;] (show_stack+0x20/0x24) from [&lt;806af554&gt;] (dump_stack+0x9c/0xc4)
[&lt;806af554&gt;] (dump_stack+0x9c/0xc4) from [&lt;8005940c&gt;] (__might_sleep+0xf4/0x134)
[&lt;8005940c&gt;] (__might_sleep+0xf4/0x134) from [&lt;803a04a4&gt;] (__pm_runtime_resume+0x94/0xa0)
[&lt;803a04a4&gt;] (__pm_runtime_resume+0x94/0xa0) from [&lt;7f0334a4&gt;] (ci_udc_start+0xb0/0x110 [ci_hdrc])
[&lt;7f0334a4&gt;] (ci_udc_start+0xb0/0x110 [ci_hdrc]) from [&lt;7f0009b4&gt;] (udc_bind_to_driver+0x5c/0xd8 [udc_core])
[&lt;7f0009b4&gt;] (udc_bind_to_driver+0x5c/0xd8 [udc_core]) from [&lt;7f000ab0&gt;] (usb_gadget_probe_driver+0x80/0xb4 [udc_core])
[&lt;7f000ab0&gt;] (usb_gadget_probe_driver+0x80/0xb4 [udc_core]) from [&lt;7f008618&gt;] (usb_composite_probe+0xac/0xd8 [libcomposite])
[&lt;7f008618&gt;] (usb_composite_probe+0xac/0xd8 [libcomposite]) from [&lt;7f04b168&gt;] (init+0x8c/0xb4 [g_serial])
[&lt;7f04b168&gt;] (init+0x8c/0xb4 [g_serial]) from [&lt;800088e8&gt;] (do_one_initcall+0x108/0x16c)
[&lt;800088e8&gt;] (do_one_initcall+0x108/0x16c) from [&lt;8008e518&gt;] (load_module+0x1b00/0x20a4)
[&lt;8008e518&gt;] (load_module+0x1b00/0x20a4) from [&lt;8008eba8&gt;] (SyS_init_module+0xec/0x100)
[&lt;8008eba8&gt;] (SyS_init_module+0xec/0x100) from [&lt;8000ec40&gt;] (ret_fast_syscall+0x0/0x48)

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: chipidea: udc: Fix spinlock recursion during bus reset</title>
<updated>2013-10-11T23:25:14+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2013-10-09T06:39:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a3aee3687d4707a96fa49da2914dcced18760c29'/>
<id>a3aee3687d4707a96fa49da2914dcced18760c29</id>
<content type='text'>
After configuration, the host also possible sends bus reset
at any time, at such situation, it will trigger below spinlock
recursion dump. This commit unlocks the spinlock before calling
gadget's disconnect.

BUG: spinlock recursion on CPU#0, swapper/0/0
 lock: 0xbf128014, .magic: dead4ead, .owner: swapper/0/0, .owner_cpu: 0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-next-20130910+ #106
[&lt;80014e20&gt;] (unwind_backtrace+0x0/0xec) from [&lt;80011a6c&gt;] (show_stack+0x10/0x14)
[&lt;80011a6c&gt;] (show_stack+0x10/0x14) from [&lt;805c143c&gt;] (dump_stack+0x94/0xbc)
[&lt;805c143c&gt;] (dump_stack+0x94/0xbc) from [&lt;80282cf8&gt;] (do_raw_spin_lock+0x16c/0x18c)
[&lt;80282cf8&gt;] (do_raw_spin_lock+0x16c/0x18c) from [&lt;805c77e0&gt;] (_raw_spin_lock_irqsave+0x50/0x5c)
[&lt;805c77e0&gt;] (_raw_spin_lock_irqsave+0x50/0x5c) from [&lt;803cff88&gt;] (ep_disable+0x24/0x110)
[&lt;803cff88&gt;] (ep_disable+0x24/0x110) from [&lt;7f015d50&gt;] (gserial_disconnect+0xa0/0x15c [u_serial])
[&lt;7f015d50&gt;] (gserial_disconnect+0xa0/0x15c [u_serial]) from [&lt;7f01c06c&gt;] (acm_disable+0xc/0x30 [usb_f_acm])
[&lt;7f01c06c&gt;] (acm_disable+0xc/0x30 [usb_f_acm]) from [&lt;7f001478&gt;] (reset_config.isra.10+0x34/0x5c [libcomposite])
[&lt;7f001478&gt;] (reset_config.isra.10+0x34/0x5c [libcomposite]) from [&lt;7f0014d4&gt;] (composite_disconnect+0x34/0x5c [libcomposite])
[&lt;7f0014d4&gt;] (composite_disconnect+0x34/0x5c [libcomposite]) from [&lt;803d1024&gt;] (udc_irq+0x770/0xce4)
[&lt;803d1024&gt;] (udc_irq+0x770/0xce4) from [&lt;803cdcc0&gt;] (ci_irq+0x98/0x164)
[&lt;803cdcc0&gt;] (ci_irq+0x98/0x164) from [&lt;8007edfc&gt;] (handle_irq_event_percpu+0x50/0x17c)
[&lt;8007edfc&gt;] (handle_irq_event_percpu+0x50/0x17c) from [&lt;8007ef64&gt;] (handle_irq_event+0x3c/0x5c)
[&lt;8007ef64&gt;] (handle_irq_event+0x3c/0x5c) from [&lt;80081e98&gt;] (handle_fasteoi_irq+0x98/0x168)
[&lt;80081e98&gt;] (handle_fasteoi_irq+0x98/0x168) from [&lt;8007e598&gt;] (generic_handle_irq+0x28/0x3c)
[&lt;8007e598&gt;] (generic_handle_irq+0x28/0x3c) from [&lt;8000edf4&gt;] (handle_IRQ+0x4c/0xb4)
[&lt;8000edf4&gt;] (handle_IRQ+0x4c/0xb4) from [&lt;800085bc&gt;] (gic_handle_irq+0x28/0x5c)
[&lt;800085bc&gt;] (gic_handle_irq+0x28/0x5c) from [&lt;800125c0&gt;] (__irq_svc+0x40/0x54)
Exception stack(0x8083bf68 to 0x8083bfb0)
bf60:                   81533b80 00000000 00096234 8001d760 8088e12c 00000000
bf80: 8083a000 8083a000 8084290c 805cb414 808428ac 8083a000 00000001 8083bfb0
bfa0: 8000f138 8000f13c 60000013 ffffffff
[&lt;800125c0&gt;] (__irq_svc+0x40/0x54) from [&lt;8000f13c&gt;] (arch_cpu_idle+0x30/0x3c)
[&lt;8000f13c&gt;] (arch_cpu_idle+0x30/0x3c) from [&lt;8005eb94&gt;] (cpu_startup_entry+0xf4/0x148)
[&lt;8005eb94&gt;] (cpu_startup_entry+0xf4/0x148) from [&lt;807f1a2c&gt;] (start_kernel+0x2c4/0x318)
BUG: spinlock lockup suspected on CPU#0, swapper/0/0
 lock: 0xbf128014, .magic: dead4ead, .owner: swapper/0/0, .owner_cpu: 0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-next-20130910+ #106
[&lt;80014e20&gt;] (unwind_backtrace+0x0/0xec) from [&lt;80011a6c&gt;] (show_stack+0x10/0x14)
[&lt;80011a6c&gt;] (show_stack+0x10/0x14) from [&lt;805c143c&gt;] (dump_stack+0x94/0xbc)
[&lt;805c143c&gt;] (dump_stack+0x94/0xbc) from [&lt;80282c94&gt;] (do_raw_spin_lock+0x108/0x18c)
[&lt;80282c94&gt;] (do_raw_spin_lock+0x108/0x18c) from [&lt;805c77e0&gt;] (_raw_spin_lock_irqsave+0x50/0x5c)
[&lt;805c77e0&gt;] (_raw_spin_lock_irqsave+0x50/0x5c) from [&lt;803cff88&gt;] (ep_disable+0x24/0x110)
[&lt;803cff88&gt;] (ep_disable+0x24/0x110) from [&lt;7f015d50&gt;] (gserial_disconnect+0xa0/0x15c [u_serial])
[&lt;7f015d50&gt;] (gserial_disconnect+0xa0/0x15c [u_serial]) from [&lt;7f01c06c&gt;] (acm_disable+0xc/0x30 [usb_f_acm])
[&lt;7f01c06c&gt;] (acm_disable+0xc/0x30 [usb_f_acm]) from [&lt;7f001478&gt;] (reset_config.isra.10+0x34/0x5c [libcomposite])
[&lt;7f001478&gt;] (reset_config.isra.10+0x34/0x5c [libcomposite]) from [&lt;7f0014d4&gt;] (composite_disconnect+0x34/0x5c [libcomposite])
[&lt;7f0014d4&gt;] (composite_disconnect+0x34/0x5c [libcomposite]) from [&lt;803d1024&gt;] (udc_irq+0x770/0xce4)
[&lt;803d1024&gt;] (udc_irq+0x770/0xce4) from [&lt;803cdcc0&gt;] (ci_irq+0x98/0x164)
[&lt;803cdcc0&gt;] (ci_irq+0x98/0x164) from [&lt;8007edfc&gt;] (handle_irq_event_percpu+0x50/0x17c)
[&lt;8007edfc&gt;] (handle_irq_event_percpu+0x50/0x17c) from [&lt;8007ef64&gt;] (handle_irq_event+0x3c/0x5c)
[&lt;8007ef64&gt;] (handle_irq_event+0x3c/0x5c) from [&lt;80081e98&gt;] (handle_fasteoi_irq+0x98/0x168)
[&lt;80081e98&gt;] (handle_fasteoi_irq+0x98/0x168) from [&lt;8007e598&gt;] (generic_handle_irq+0x28/0x3c)
[&lt;8007e598&gt;] (generic_handle_irq+0x28/0x3c) from [&lt;8000edf4&gt;] (handle_IRQ+0x4c/0xb4)
[&lt;8000edf4&gt;] (handle_IRQ+0x4c/0xb4) from [&lt;800085bc&gt;] (gic_handle_irq+0x28/0x5c)
[&lt;800085bc&gt;] (gic_handle_irq+0x28/0x5c) from [&lt;800125c0&gt;] (__irq_svc+0x40/0x54)
Exception stack(0x8083bf68 to 0x8083bfb0)
bf60:                   81533b80 00000000 00096234 8001d760 8088e12c 00000000
bf80: 8083a000 8083a000 8084290c 805cb414 808428ac 8083a000 00000001 8083bfb0
bfa0: 8000f138 8000f13c 60000013 ffffffff
[&lt;800125c0&gt;] (__irq_svc+0x40/0x54) from [&lt;8000f13c&gt;] (arch_cpu_idle+0x30/0x3c)
[&lt;8000f13c&gt;] (arch_cpu_idle+0x30/0x3c) from [&lt;8005eb94&gt;] (cpu_startup_entry+0xf4/0x148)
[&lt;8005eb94&gt;] (cpu_startup_entry+0xf4/0x148) from [&lt;807f1a2c&gt;] (start_kernel+0x2c4/0x318)

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After configuration, the host also possible sends bus reset
at any time, at such situation, it will trigger below spinlock
recursion dump. This commit unlocks the spinlock before calling
gadget's disconnect.

BUG: spinlock recursion on CPU#0, swapper/0/0
 lock: 0xbf128014, .magic: dead4ead, .owner: swapper/0/0, .owner_cpu: 0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-next-20130910+ #106
[&lt;80014e20&gt;] (unwind_backtrace+0x0/0xec) from [&lt;80011a6c&gt;] (show_stack+0x10/0x14)
[&lt;80011a6c&gt;] (show_stack+0x10/0x14) from [&lt;805c143c&gt;] (dump_stack+0x94/0xbc)
[&lt;805c143c&gt;] (dump_stack+0x94/0xbc) from [&lt;80282cf8&gt;] (do_raw_spin_lock+0x16c/0x18c)
[&lt;80282cf8&gt;] (do_raw_spin_lock+0x16c/0x18c) from [&lt;805c77e0&gt;] (_raw_spin_lock_irqsave+0x50/0x5c)
[&lt;805c77e0&gt;] (_raw_spin_lock_irqsave+0x50/0x5c) from [&lt;803cff88&gt;] (ep_disable+0x24/0x110)
[&lt;803cff88&gt;] (ep_disable+0x24/0x110) from [&lt;7f015d50&gt;] (gserial_disconnect+0xa0/0x15c [u_serial])
[&lt;7f015d50&gt;] (gserial_disconnect+0xa0/0x15c [u_serial]) from [&lt;7f01c06c&gt;] (acm_disable+0xc/0x30 [usb_f_acm])
[&lt;7f01c06c&gt;] (acm_disable+0xc/0x30 [usb_f_acm]) from [&lt;7f001478&gt;] (reset_config.isra.10+0x34/0x5c [libcomposite])
[&lt;7f001478&gt;] (reset_config.isra.10+0x34/0x5c [libcomposite]) from [&lt;7f0014d4&gt;] (composite_disconnect+0x34/0x5c [libcomposite])
[&lt;7f0014d4&gt;] (composite_disconnect+0x34/0x5c [libcomposite]) from [&lt;803d1024&gt;] (udc_irq+0x770/0xce4)
[&lt;803d1024&gt;] (udc_irq+0x770/0xce4) from [&lt;803cdcc0&gt;] (ci_irq+0x98/0x164)
[&lt;803cdcc0&gt;] (ci_irq+0x98/0x164) from [&lt;8007edfc&gt;] (handle_irq_event_percpu+0x50/0x17c)
[&lt;8007edfc&gt;] (handle_irq_event_percpu+0x50/0x17c) from [&lt;8007ef64&gt;] (handle_irq_event+0x3c/0x5c)
[&lt;8007ef64&gt;] (handle_irq_event+0x3c/0x5c) from [&lt;80081e98&gt;] (handle_fasteoi_irq+0x98/0x168)
[&lt;80081e98&gt;] (handle_fasteoi_irq+0x98/0x168) from [&lt;8007e598&gt;] (generic_handle_irq+0x28/0x3c)
[&lt;8007e598&gt;] (generic_handle_irq+0x28/0x3c) from [&lt;8000edf4&gt;] (handle_IRQ+0x4c/0xb4)
[&lt;8000edf4&gt;] (handle_IRQ+0x4c/0xb4) from [&lt;800085bc&gt;] (gic_handle_irq+0x28/0x5c)
[&lt;800085bc&gt;] (gic_handle_irq+0x28/0x5c) from [&lt;800125c0&gt;] (__irq_svc+0x40/0x54)
Exception stack(0x8083bf68 to 0x8083bfb0)
bf60:                   81533b80 00000000 00096234 8001d760 8088e12c 00000000
bf80: 8083a000 8083a000 8084290c 805cb414 808428ac 8083a000 00000001 8083bfb0
bfa0: 8000f138 8000f13c 60000013 ffffffff
[&lt;800125c0&gt;] (__irq_svc+0x40/0x54) from [&lt;8000f13c&gt;] (arch_cpu_idle+0x30/0x3c)
[&lt;8000f13c&gt;] (arch_cpu_idle+0x30/0x3c) from [&lt;8005eb94&gt;] (cpu_startup_entry+0xf4/0x148)
[&lt;8005eb94&gt;] (cpu_startup_entry+0xf4/0x148) from [&lt;807f1a2c&gt;] (start_kernel+0x2c4/0x318)
BUG: spinlock lockup suspected on CPU#0, swapper/0/0
 lock: 0xbf128014, .magic: dead4ead, .owner: swapper/0/0, .owner_cpu: 0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-next-20130910+ #106
[&lt;80014e20&gt;] (unwind_backtrace+0x0/0xec) from [&lt;80011a6c&gt;] (show_stack+0x10/0x14)
[&lt;80011a6c&gt;] (show_stack+0x10/0x14) from [&lt;805c143c&gt;] (dump_stack+0x94/0xbc)
[&lt;805c143c&gt;] (dump_stack+0x94/0xbc) from [&lt;80282c94&gt;] (do_raw_spin_lock+0x108/0x18c)
[&lt;80282c94&gt;] (do_raw_spin_lock+0x108/0x18c) from [&lt;805c77e0&gt;] (_raw_spin_lock_irqsave+0x50/0x5c)
[&lt;805c77e0&gt;] (_raw_spin_lock_irqsave+0x50/0x5c) from [&lt;803cff88&gt;] (ep_disable+0x24/0x110)
[&lt;803cff88&gt;] (ep_disable+0x24/0x110) from [&lt;7f015d50&gt;] (gserial_disconnect+0xa0/0x15c [u_serial])
[&lt;7f015d50&gt;] (gserial_disconnect+0xa0/0x15c [u_serial]) from [&lt;7f01c06c&gt;] (acm_disable+0xc/0x30 [usb_f_acm])
[&lt;7f01c06c&gt;] (acm_disable+0xc/0x30 [usb_f_acm]) from [&lt;7f001478&gt;] (reset_config.isra.10+0x34/0x5c [libcomposite])
[&lt;7f001478&gt;] (reset_config.isra.10+0x34/0x5c [libcomposite]) from [&lt;7f0014d4&gt;] (composite_disconnect+0x34/0x5c [libcomposite])
[&lt;7f0014d4&gt;] (composite_disconnect+0x34/0x5c [libcomposite]) from [&lt;803d1024&gt;] (udc_irq+0x770/0xce4)
[&lt;803d1024&gt;] (udc_irq+0x770/0xce4) from [&lt;803cdcc0&gt;] (ci_irq+0x98/0x164)
[&lt;803cdcc0&gt;] (ci_irq+0x98/0x164) from [&lt;8007edfc&gt;] (handle_irq_event_percpu+0x50/0x17c)
[&lt;8007edfc&gt;] (handle_irq_event_percpu+0x50/0x17c) from [&lt;8007ef64&gt;] (handle_irq_event+0x3c/0x5c)
[&lt;8007ef64&gt;] (handle_irq_event+0x3c/0x5c) from [&lt;80081e98&gt;] (handle_fasteoi_irq+0x98/0x168)
[&lt;80081e98&gt;] (handle_fasteoi_irq+0x98/0x168) from [&lt;8007e598&gt;] (generic_handle_irq+0x28/0x3c)
[&lt;8007e598&gt;] (generic_handle_irq+0x28/0x3c) from [&lt;8000edf4&gt;] (handle_IRQ+0x4c/0xb4)
[&lt;8000edf4&gt;] (handle_IRQ+0x4c/0xb4) from [&lt;800085bc&gt;] (gic_handle_irq+0x28/0x5c)
[&lt;800085bc&gt;] (gic_handle_irq+0x28/0x5c) from [&lt;800125c0&gt;] (__irq_svc+0x40/0x54)
Exception stack(0x8083bf68 to 0x8083bfb0)
bf60:                   81533b80 00000000 00096234 8001d760 8088e12c 00000000
bf80: 8083a000 8083a000 8084290c 805cb414 808428ac 8083a000 00000001 8083bfb0
bfa0: 8000f138 8000f13c 60000013 ffffffff
[&lt;800125c0&gt;] (__irq_svc+0x40/0x54) from [&lt;8000f13c&gt;] (arch_cpu_idle+0x30/0x3c)
[&lt;8000f13c&gt;] (arch_cpu_idle+0x30/0x3c) from [&lt;8005eb94&gt;] (cpu_startup_entry+0xf4/0x148)
[&lt;8005eb94&gt;] (cpu_startup_entry+0xf4/0x148) from [&lt;807f1a2c&gt;] (start_kernel+0x2c4/0x318)

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
