<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/chipidea, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-02-25T01:33:29Z</updated>
<entry>
<title>usb: chipidea: otg: change workqueue ci_otg as freezable</title>
<updated>2016-02-25T01:33:29Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2016-02-24T03:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d144dfea8af7108f613139623e63952ed7e69c0c'/>
<id>urn:sha1:d144dfea8af7108f613139623e63952ed7e69c0c</id>
<content type='text'>
If we use USB ID pin as wakeup source, and there is a USB block
device on this USB OTG (ID) cable, the system will be deadlock
after system resume.

The root cause for this problem is: the workqueue ci_otg may try
to remove hcd before the driver resume has finished, and hcd will
disconnect the device on it, then, it will call device_release_driver,
and holds the device lock "dev-&gt;mutex", but it is never unlocked since
it waits workqueue writeback to run to flush the block information, but
the workqueue writeback is freezable, it is not thawed before driver
resume has finished.

When the driver (device: sd 0:0:0:0:) resume goes to dpm_complete, it
tries to get its device lock "dev-&gt;mutex", but it can't get it forever,
then the deadlock occurs. Below call stacks show the situation.

So, in order to fix this problem, we need to change workqueue ci_otg
as freezable, then the work item in this workqueue will be run after
driver's resume, this workqueue will not be blocked forever like above
case since the workqueue writeback has been thawed too.

Tested at: i.mx6qdl-sabresd and i.mx6sx-sdb.

[  555.178869] kworker/u2:13   D c07de74c     0   826      2 0x00000000
[  555.185310] Workqueue: ci_otg ci_otg_work
[  555.189353] Backtrace:
[  555.191849] [&lt;c07de4fc&gt;] (__schedule) from [&lt;c07dec6c&gt;] (schedule+0x48/0xa0)
[  555.198912]  r10:ee471ba0 r9:00000000 r8:00000000 r7:00000002 r6:ee470000 r5:ee471ba4
[  555.206867]  r4:ee470000
[  555.209453] [&lt;c07dec24&gt;] (schedule) from [&lt;c07e2fc4&gt;] (schedule_timeout+0x15c/0x1e0)
[  555.217212]  r4:7fffffff r3:edc2b000
[  555.220862] [&lt;c07e2e68&gt;] (schedule_timeout) from [&lt;c07df6c8&gt;] (wait_for_common+0x94/0x144)
[  555.229140]  r8:00000000 r7:00000002 r6:ee470000 r5:ee471ba4 r4:7fffffff
[  555.235980] [&lt;c07df634&gt;] (wait_for_common) from [&lt;c07df790&gt;] (wait_for_completion+0x18/0x1c)
[  555.244430]  r10:00000001 r9:c0b5563c r8:c0042e48 r7:ef086000 r6:eea4372c r5:ef131b00
[  555.252383]  r4:00000000
[  555.254970] [&lt;c07df778&gt;] (wait_for_completion) from [&lt;c0043cb8&gt;] (flush_work+0x19c/0x234)
[  555.263177] [&lt;c0043b1c&gt;] (flush_work) from [&lt;c0043fac&gt;] (flush_delayed_work+0x48/0x4c)
[  555.271106]  r8:ed5b5000 r7:c0b38a3c r6:eea439cc r5:eea4372c r4:eea4372c
[  555.277958] [&lt;c0043f64&gt;] (flush_delayed_work) from [&lt;c00eae18&gt;] (bdi_unregister+0x84/0xec)
[  555.286236]  r4:eea43520 r3:20000153
[  555.289885] [&lt;c00ead94&gt;] (bdi_unregister) from [&lt;c02c2154&gt;] (blk_cleanup_queue+0x180/0x29c)
[  555.298250]  r5:eea43808 r4:eea43400
[  555.301909] [&lt;c02c1fd4&gt;] (blk_cleanup_queue) from [&lt;c0417914&gt;] (__scsi_remove_device+0x48/0xb8)
[  555.310623]  r7:00000000 r6:20000153 r5:ededa950 r4:ededa800
[  555.316403] [&lt;c04178cc&gt;] (__scsi_remove_device) from [&lt;c0415e90&gt;] (scsi_forget_host+0x64/0x68)
[  555.325028]  r5:ededa800 r4:ed5b5000
[  555.328689] [&lt;c0415e2c&gt;] (scsi_forget_host) from [&lt;c0409828&gt;] (scsi_remove_host+0x78/0x104)
[  555.337054]  r5:ed5b5068 r4:ed5b5000
[  555.340709] [&lt;c04097b0&gt;] (scsi_remove_host) from [&lt;c04cdfcc&gt;] (usb_stor_disconnect+0x50/0xb4)
[  555.349247]  r6:ed5b56e4 r5:ed5b5818 r4:ed5b5690 r3:00000008
[  555.355025] [&lt;c04cdf7c&gt;] (usb_stor_disconnect) from [&lt;c04b3bc8&gt;] (usb_unbind_interface+0x78/0x25c)
[  555.363997]  r8:c13919b4 r7:edd3c000 r6:edd3c020 r5:ee551c68 r4:ee551c00 r3:c04cdf7c
[  555.371892] [&lt;c04b3b50&gt;] (usb_unbind_interface) from [&lt;c03dc248&gt;] (__device_release_driver+0x8c/0x118)
[  555.381213]  r10:00000001 r9:edd90c00 r8:c13919b4 r7:ee551c68 r6:c0b546e0 r5:c0b5563c
[  555.389167]  r4:edd3c020
[  555.391752] [&lt;c03dc1bc&gt;] (__device_release_driver) from [&lt;c03dc2fc&gt;] (device_release_driver+0x28/0x34)
[  555.401071]  r5:edd3c020 r4:edd3c054
[  555.404721] [&lt;c03dc2d4&gt;] (device_release_driver) from [&lt;c03db304&gt;] (bus_remove_device+0xe0/0x110)
[  555.413607]  r5:edd3c020 r4:ef17f04c
[  555.417253] [&lt;c03db224&gt;] (bus_remove_device) from [&lt;c03d8128&gt;] (device_del+0x114/0x21c)
[  555.425270]  r6:edd3c028 r5:edd3c020 r4:ee551c00 r3:00000000
[  555.431045] [&lt;c03d8014&gt;] (device_del) from [&lt;c04b1560&gt;] (usb_disable_device+0xa4/0x1e8)
[  555.439061]  r8:edd3c000 r7:eded8000 r6:00000000 r5:00000001 r4:ee551c00
[  555.445906] [&lt;c04b14bc&gt;] (usb_disable_device) from [&lt;c04a8e54&gt;] (usb_disconnect+0x74/0x224)
[  555.454271]  r9:edd90c00 r8:ee551000 r7:ee551c68 r6:ee551c9c r5:ee551c00 r4:00000001
[  555.462156] [&lt;c04a8de0&gt;] (usb_disconnect) from [&lt;c04a8fb8&gt;] (usb_disconnect+0x1d8/0x224)
[  555.470259]  r10:00000001 r9:edd90000 r8:ee471e2c r7:ee551468 r6:ee55149c r5:ee551400
[  555.478213]  r4:00000001
[  555.480797] [&lt;c04a8de0&gt;] (usb_disconnect) from [&lt;c04ae5ec&gt;] (usb_remove_hcd+0xa0/0x1ac)
[  555.488813]  r10:00000001 r9:ee471eb0 r8:00000000 r7:ef3d9500 r6:eded810c r5:eded80b0
[  555.496765]  r4:eded8000
[  555.499351] [&lt;c04ae54c&gt;] (usb_remove_hcd) from [&lt;c04d4158&gt;] (host_stop+0x28/0x64)
[  555.506847]  r6:eeb50010 r5:eded8000 r4:eeb51010
[  555.511563] [&lt;c04d4130&gt;] (host_stop) from [&lt;c04d09b8&gt;] (ci_otg_work+0xc4/0x124)
[  555.518885]  r6:00000001 r5:eeb50010 r4:eeb502a0 r3:c04d4130
[  555.524665] [&lt;c04d08f4&gt;] (ci_otg_work) from [&lt;c00454f0&gt;] (process_one_work+0x194/0x420)
[  555.532682]  r6:ef086000 r5:eeb502a0 r4:edc44480
[  555.537393] [&lt;c004535c&gt;] (process_one_work) from [&lt;c00457b0&gt;] (worker_thread+0x34/0x514)
[  555.545496]  r10:edc44480 r9:ef086000 r8:c0b1a100 r7:ef086034 r6:00000088 r5:edc44498
[  555.553450]  r4:ef086000
[  555.556032] [&lt;c004577c&gt;] (worker_thread) from [&lt;c004bab4&gt;] (kthread+0xdc/0xf8)
[  555.563268]  r10:00000000 r9:00000000 r8:00000000 r7:c004577c r6:edc44480 r5:eddc15c0
[  555.571221]  r4:00000000
[  555.573804] [&lt;c004b9d8&gt;] (kthread) from [&lt;c000fef0&gt;] (ret_from_fork+0x14/0x24)
[  555.581040]  r7:00000000 r6:00000000 r5:c004b9d8 r4:eddc15c0

[  553.429383] sh              D c07de74c     0   694    691 0x00000000
[  553.435801] Backtrace:
[  553.438295] [&lt;c07de4fc&gt;] (__schedule) from [&lt;c07dec6c&gt;] (schedule+0x48/0xa0)
[  553.445358]  r10:edd3c054 r9:edd3c078 r8:edddbd50 r7:edcbbc00 r6:c1377c34 r5:60000153
[  553.453313]  r4:eddda000
[  553.455896] [&lt;c07dec24&gt;] (schedule) from [&lt;c07deff8&gt;] (schedule_preempt_disabled+0x10/0x14)
[  553.464261]  r4:edd3c058 r3:0000000a
[  553.467910] [&lt;c07defe8&gt;] (schedule_preempt_disabled) from [&lt;c07e0bbc&gt;] (mutex_lock_nested+0x1a0/0x3e8)
[  553.477254] [&lt;c07e0a1c&gt;] (mutex_lock_nested) from [&lt;c03e927c&gt;] (dpm_complete+0xc0/0x1b0)
[  553.485358]  r10:00561408 r9:edd3c054 r8:c0b4863c r7:edddbd90 r6:c0b485d8 r5:edd3c020
[  553.493313]  r4:edd3c0d0
[  553.495896] [&lt;c03e91bc&gt;] (dpm_complete) from [&lt;c03e9388&gt;] (dpm_resume_end+0x1c/0x20)
[  553.503652]  r9:00000000 r8:c0b1a9d0 r7:c1334ec0 r6:c1334edc r5:00000003 r4:00000010
[  553.511544] [&lt;c03e936c&gt;] (dpm_resume_end) from [&lt;c0079894&gt;] (suspend_devices_and_enter+0x158/0x504)
[  553.520604]  r4:00000000 r3:c1334efc
[  553.524250] [&lt;c007973c&gt;] (suspend_devices_and_enter) from [&lt;c0079e74&gt;] (pm_suspend+0x234/0x2cc)
[  553.532961]  r10:00561408 r9:ed6b7300 r8:00000004 r7:c1334eec r6:00000000 r5:c1334ee8
[  553.540914]  r4:00000003
[  553.543493] [&lt;c0079c40&gt;] (pm_suspend) from [&lt;c0078a6c&gt;] (state_store+0x6c/0xc0)

[  555.703684] 7 locks held by kworker/u2:13/826:
[  555.708140]  #0:  ("%s""ci_otg"){++++.+}, at: [&lt;c0045484&gt;] process_one_work+0x128/0x420
[  555.716277]  #1:  ((&amp;ci-&gt;work)){+.+.+.}, at: [&lt;c0045484&gt;] process_one_work+0x128/0x420
[  555.724317]  #2:  (usb_bus_list_lock){+.+.+.}, at: [&lt;c04ae5e4&gt;] usb_remove_hcd+0x98/0x1ac
[  555.732626]  #3:  (&amp;dev-&gt;mutex){......}, at: [&lt;c04a8e28&gt;] usb_disconnect+0x48/0x224
[  555.740403]  #4:  (&amp;dev-&gt;mutex){......}, at: [&lt;c04a8e28&gt;] usb_disconnect+0x48/0x224
[  555.748179]  #5:  (&amp;dev-&gt;mutex){......}, at: [&lt;c03dc2f4&gt;] device_release_driver+0x20/0x34
[  555.756487]  #6:  (&amp;shost-&gt;scan_mutex){+.+.+.}, at: [&lt;c04097d0&gt;] scsi_remove_host+0x20/0x104

Cc: &lt;stable@vger.kernel.org&gt; #v3.14+
Cc: Jun Li &lt;jun.li@nxp.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: fix return value check in ci_hdrc_pci_probe()</title>
<updated>2016-02-19T06:13:44Z</updated>
<author>
<name>Wei Yongjun</name>
<email>yongjun_wei@trendmicro.com.cn</email>
</author>
<published>2016-02-06T14:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8c0614ca312c847ca5409ea11c39434dec69631d'/>
<id>urn:sha1:8c0614ca312c847ca5409ea11c39434dec69631d</id>
<content type='text'>
In case of error, the function usb_phy_generic_register()
returns ERR_PTR() and never returns NULL. The NULL test in
the return value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: error on overflow for port_test_write</title>
<updated>2016-02-19T06:12:39Z</updated>
<author>
<name>Alan</name>
<email>gnomes@lxorguk.ukuu.org.uk</email>
</author>
<published>2016-02-15T19:09:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a4de018d2b0364e40a626fa521ec21e31a10ac84'/>
<id>urn:sha1:a4de018d2b0364e40a626fa521ec21e31a10ac84</id>
<content type='text'>
The write value is 8bit, but currently writing a larger number
(eg a doubled digit) is not errored but instead gets cast and
sets off an action probably undesired.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
(Change the style of commit log to fix checkpatch.pl warning)
</content>
</entry>
<entry>
<title>Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild</title>
<updated>2016-01-20T17:45:43Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-01-20T17:45:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d9569f003cfc0228e132749ae6fd81cb29dc6c70'/>
<id>urn:sha1:d9569f003cfc0228e132749ae6fd81cb29dc6c70</id>
<content type='text'>
Pull kbuild updates from Michal Marek:
 - Make &lt;modname&gt;-m in makefiles work like &lt;modname&gt;-y and fix the
   fallout
 - Minor genksyms fix
 - Fix race with make -j install modules_install
 - Move -Wsign-compare from make W=1 to W=2
 - Other minor fixes

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: Demote 'sign-compare' warning to W=2
  Makefile: revert "Makefile: Document ability to make file.lst and file.S" partially
  kbuild: Do not run modules_install and install in paralel
  genksyms: Handle string literals with spaces in reference files
  fixdep: constify strrcmp arguments
  ath10k: Fix build with CONFIG_THERMAL=m
  Revert "drm: Hack around CONFIG_AGP=m build failures"
  kbuild: Allow to specify composite modules with modname-m
  staging/ad7606: Actually build the interface modules
</content>
</entry>
<entry>
<title>usb: chipidea: otg: use usb autosuspend to suspend bus for HNP</title>
<updated>2015-12-24T06:18:07Z</updated>
<author>
<name>Li Jun</name>
<email>jun.li@freescale.com</email>
</author>
<published>2015-12-15T09:51:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8c100e74409ad3bbcb8a1ccdff4540fc0aa7a0fc'/>
<id>urn:sha1:8c100e74409ad3bbcb8a1ccdff4540fc0aa7a0fc</id>
<content type='text'>
Directly manipulate the controller regsiter to suspend the usb bus
for HNP is not the proper way, this should be done through the usbcore
by usb autosuspend. So to start HNP, autosuspend support should be
added for OTG devices interface driver if it's not enabled.

Signed-off-by: Li Jun &lt;jun.li@freescale.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: host: set host to be null after hcd is freed</title>
<updated>2015-12-24T06:17:58Z</updated>
<author>
<name>Li Jun</name>
<email>jun.li@freescale.com</email>
</author>
<published>2015-12-15T09:47:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43a404577a93d236913b67e41758adf5b9a8f45d'/>
<id>urn:sha1:43a404577a93d236913b67e41758adf5b9a8f45d</id>
<content type='text'>
Set ci-&gt;hcd and ci-&gt;otg.host to be null in host_stop since the
hcd already freed.

Signed-off-by: Li Jun &lt;jun.li@freescale.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: removing of_find_property</title>
<updated>2015-12-24T06:15:27Z</updated>
<author>
<name>Saurabh Sengar</name>
<email>saurabh.truth@gmail.com</email>
</author>
<published>2015-11-18T04:10:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b19b78aa6f1f57a997d93fa05df6724792a85ba'/>
<id>urn:sha1:4b19b78aa6f1f57a997d93fa05df6724792a85ba</id>
<content type='text'>
call to of_find_property() before of_property_read_u32() is unnecessary.
of_property_read_u32() anyway calls to of_find_property() only.

Signed-off-by: Saurabh Sengar &lt;saurabh.truth@gmail.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: implement platform shutdown callback</title>
<updated>2015-12-24T06:15:27Z</updated>
<author>
<name>Andreas Fenkart</name>
<email>afenkart@gmail.com</email>
</author>
<published>2015-11-12T13:14:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b09b5224fe86b3c9adef1bd9f0bd81800e8ff0b3'/>
<id>urn:sha1:b09b5224fe86b3c9adef1bd9f0bd81800e8ff0b3</id>
<content type='text'>
disable wakeup irq during shutdown, otherwise kexec fails for
kernels that setup irq handlers before resetting the hardware

Signed-off-by: Andreas Fenkart &lt;andreas.fenkart@dev.digitalstrom.org&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: clean up CONFIG_USB_CHIPIDEA_DEBUG reference</title>
<updated>2015-12-24T06:15:27Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-11-03T08:21:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3a35d59a69398b3b522d449404669624486d2b68'/>
<id>urn:sha1:3a35d59a69398b3b522d449404669624486d2b68</id>
<content type='text'>
Since this configuration option has deleted, cleans up all
its references.

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Reported-by: Valentin Rothberg &lt;valentinrothberg@gmail.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: delete static debug support</title>
<updated>2015-12-24T06:15:26Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-10-27T08:08:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=383da2450c7150b4c470dab3759ab86532c65b78'/>
<id>urn:sha1:383da2450c7150b4c470dab3759ab86532c65b78</id>
<content type='text'>
Since we have dynamic debug support, delete static debug for chipidea

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
</content>
</entry>
</feed>
