linux/drivers
Sudeep Holla 798523973d usb: isp1760: fix possible deadlock in isp1760_udc_irq
Use spin_{un,}lock_irq{save,restore} in isp1760_udc_{start,stop} to
prevent following potentially deadlock scenario between
isp1760_udc_{start,stop} and isp1760_udc_irq :

=================================
[ INFO: inconsistent lock state ]
4.0.0-rc2-00004-gf7bb2ef60173 #51 Not tainted
---------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
in:imklog/2118 [HC1[1]:SC0[0]:HE0:SE1] takes:
 (&(&udc->lock)->rlock){?.+...}, at: [<c0397a93>] isp1760_udc_irq+0x367/0x9dc
{HARDIRQ-ON-W} state was registered at:
  [<c05135b3>] _raw_spin_lock+0x23/0x30
  [<c0396b87>] isp1760_udc_start+0x23/0xf8
  [<c039dc21>] udc_bind_to_driver+0x71/0xb0
  [<c039de4f>] usb_gadget_probe_driver+0x53/0x9c
  [<bf80d0df>] usb_composite_probe+0x8a/0xa4 [libcomposite]
  [<bf8311a7>] 0xbf8311a7
  [<c00088c5>] do_one_initcall+0x8d/0x17c
  [<c050b92d>] do_init_module+0x49/0x148
  [<c0087323>] load_module+0xb7f/0xbc4
  [<c0087471>] SyS_finit_module+0x51/0x74
  [<c000d8c1>] ret_fast_syscall+0x1/0x68
irq event stamp: 4966
hardirqs last  enabled at (4965): [<c05137df>] _raw_spin_unlock_irq+0x1f/0x24
hardirqs last disabled at (4966): [<c00110b3>] __irq_svc+0x33/0x64
softirqs last  enabled at (4458): [<c0023475>] __do_softirq+0x23d/0x2d0
softirqs last disabled at (4389): [<c002380b>] irq_exit+0xef/0x15c

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(&udc->lock)->rlock);
  <Interrupt>
    lock(&(&udc->lock)->rlock);

 *** DEADLOCK ***

1 lock held by in:imklog/2118:
 #0:  (&f->f_pos_lock){+.+.+.}, at: [<c010a101>] __fdget_pos+0x31/0x34

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-09 10:44:08 -05:00
..
accessibility
acpi Merge branch 'acpi-video' 2015-03-06 01:29:16 +01:00
amba ARM: 8256/1: driver coamba: add device binding path 'driver_override' 2015-02-10 10:23:15 +00:00
android android: binder: fix binder mmap failures 2015-03-01 18:43:51 -08:00
ata Merge branch 'for-3.20/drivers' of git://git.kernel.dk/linux-block 2015-02-12 14:30:53 -08:00
atm
auxdisplay
base Merge branches 'pm-domains' and 'pm-cpufreq' 2015-03-06 01:29:31 +01:00
bcma bcma: implement host code support for PCIe Gen 2 devices 2015-01-29 10:54:43 +02:00
block Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2015-02-28 10:21:57 -08:00
bluetooth Bluetooth: btusb: Fix issue with CSR based Intel Wireless controllers 2015-02-23 09:30:35 +02:00
bus ARM: SoC platform changes 2015-02-17 09:27:54 -08:00
cdrom
char ipmi: Fix a memory ordering issue 2015-02-19 20:58:42 -06:00
clk clk: at91: implement suspend/resume for the PMC irqchip 2015-03-04 22:11:17 +01:00
clocksource clocksource: pxa: Fix section mismatch 2015-02-25 10:28:55 +01:00
connector
coresight coresight: fix function etm_writel_cp14() parameter order 2015-02-04 10:42:55 -08:00
cpufreq Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal 2015-03-06 13:43:33 -08:00
cpuidle cpuidle / sleep: Use broadcast timer for states that stop local timer 2015-03-05 23:13:19 +01:00
crypto Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-02-18 08:49:20 -08:00
dca
devfreq Merge branches 'pm-cpufreq', 'pm-cpuidle', 'pm-devfreq', 'pm-opp' and 'pm-tools' 2015-02-13 21:39:06 +01:00
dio
dma dmaengine: mmp_pdma: fix warning about slave caps 2015-03-05 22:15:35 +05:30
dma-buf
edac * A fix to sb_edac for proper detection on SNB machines 2015-02-19 11:18:14 -08:00
eisa
extcon
firewire firewire: core: use correct vendor/model IDs 2015-02-02 21:56:03 +01:00
firmware * Fix regression in DMI sysfs code for handling "End of Table" entry 2015-03-02 14:18:57 +01:00
fmc
gpio gpio: tps65912: fix wrong container_of arguments 2015-02-23 15:40:32 +01:00
gpu Merge tag 'drm-intel-fixes-2015-03-05' of git://anongit.freedesktop.org/drm-intel into drm-fixes 2015-03-07 07:40:17 +10:00
hid HID: microsoft: Add ID for NE7K wireless keyboard 2015-02-23 15:28:40 +01:00
hsi
hv Char / Misc patches for 3.20-rc1 2015-02-15 10:48:44 -08:00
hwmon hwmon: (ads7828) Check return value of devm_regmap_init_i2c 2015-02-22 20:10:30 -08:00
hwspinlock
i2c i2c: designware-baytrail: baytrail_i2c_acquire() might sleep 2015-03-07 01:08:26 +01:00
ide
idle intel_idle: Add ->enter_freeze callbacks 2015-02-15 19:40:09 +01:00
iio Second round of IIO fixes for the 4.0 cycle (or round one part two really!) 2015-02-28 07:19:27 -08:00
infiniband Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-02-22 17:42:14 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-02-21 12:59:04 -08:00
iommu IOMMU Updates for Linux v3.20 2015-02-12 09:16:56 -08:00
ipack
irqchip Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-02-21 19:41:38 -08:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-03 15:30:07 -08:00
leds leds: leds-gpio: Pass on error codes unmodified 2015-02-02 14:36:10 -08:00
lguest OK, this has the big virtio 1.0 implementation, as specified by OASIS. 2015-02-18 09:24:01 -08:00
macintosh
mailbox Merge branch 'mailbox-devel' of git://git.linaro.org/landing-teams/working/fujitsu/integration 2015-02-11 12:56:40 -08:00
mcb mcb: Fix error path of mcb_pci_probe 2015-02-03 15:48:51 -08:00
md md: mark some attributes as pre-alloc 2015-02-25 11:38:46 +11:00
media mm: gup: use get_user_pages_unlocked 2015-02-11 17:06:05 -08:00
memory memory/fsl-corenet-cf: Add t1040 support 2015-01-29 22:57:43 -06:00
memstick
message i2o: move to staging 2015-02-03 15:58:39 -08:00
mfd Changes to existing drivers: 2015-02-18 09:05:48 -08:00
misc mei: make device disabled on stop unconditionally 2015-03-01 19:34:50 -08:00
mmc The clock framework changes for 3.20 contain the usual driver additions, 2015-02-21 12:30:30 -08:00
mtd MTD updates for 3.20-rc1 2015-02-18 08:01:44 -08:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-03 15:30:07 -08:00
nfc NFC: nci: Move NFCEE discovery logic 2015-02-04 09:15:18 +01:00
ntb
nubus
of PCI updates for v3.20: 2015-02-18 09:43:46 -08:00
oprofile
parisc
parport
pci PCI: versatile: Update for list_for_each_entry() API change 2015-02-28 00:47:00 +01:00
pcmcia ARM: SoC driver updates 2015-02-17 09:38:59 -08:00
phy USB patches for 3.20-rc1 2015-02-15 10:24:55 -08:00
pinctrl This is the bulk of pin control changes for the v3.20 cycle: 2015-02-11 11:23:13 -08:00
platform Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-02-21 11:12:07 -08:00
pnp Merge branches 'pnp', 'pm-cpuidle' and 'pm-cpufreq' 2015-02-21 04:29:16 +01:00
power power_supply: 88pm860x: Fix leaked power supply on probe fail 2015-01-28 15:08:10 +01:00
powercap
pps
ps3
ptp
pwm pwm: tegra: Use NSEC_PER_SEC 2015-02-18 08:40:29 +01:00
rapidio Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-02-18 08:49:20 -08:00
ras
regulator Changes to existing drivers: 2015-02-18 09:05:48 -08:00
remoteproc
reset
rpmsg
rtc Merge branch 'irq-pm' 2015-03-06 01:29:05 +01:00
s390 Fairly small update, but there are some interesting new features. 2015-02-13 09:55:09 -08:00
sbus
scsi SCSI misc on 20150221 2015-02-21 19:16:42 -08:00
sfi
sh drivers: sh: Disable PM runtime for multi-platform r8a7740 with genpd 2015-02-24 07:26:12 +09:00
sn
soc ARM: SoC driver updates 2015-02-17 09:38:59 -08:00
spi Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-02-19 10:36:45 -08:00
spmi
ssb treewide: Remove unnecessary SSB_DEVTABLE_END macro 2015-02-11 14:38:29 -08:00
staging staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel 2015-03-01 19:25:59 -08:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-02-21 13:21:19 -08:00
tc
thermal thermal: Make sysfs attributes of cooling devices default attributes 2015-03-05 01:47:57 -04:00
thunderbolt
tty TTY/Serial fixes for 4.0-rc3 2015-03-08 12:25:40 -07:00
uio
usb usb: isp1760: fix possible deadlock in isp1760_udc_irq 2015-03-09 10:44:08 -05:00
uwb USB patches for 3.20-rc1 2015-02-15 10:24:55 -08:00
vfio vfio-pci: Add device request interface 2015-02-10 12:38:14 -07:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-03 15:30:07 -08:00
video mm: gup: use get_user_pages_unlocked 2015-02-11 17:06:05 -08:00
virt
virtio virtio: don't set VIRTIO_CONFIG_S_DRIVER_OK twice. 2015-02-17 16:19:29 +10:30
vlynq
vme
w1
watchdog watchdog: at91sam9: request the irq with IRQF_NO_SUSPEND 2015-03-06 00:46:31 +01:00
xen xen-scsiback: mark pvscsi frontend request consumed only after last read 2015-02-23 16:30:25 +00:00
zorro
Kconfig i2o: move to staging 2015-02-03 15:58:39 -08:00
Makefile