linux/drivers
Alexander Stein 70f1891584 pch_dma: Fix channel locking
Fix for the following INFO message

=================================
[ INFO: inconsistent lock state ]
2.6.39+ #89
---------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
rs232/822 [HC1[1]:SC0[0]:HE0:SE1] takes:
 (&(&pd_chan->lock)->rlock){?.....}, at: [<c123b9a1>] pdc_desc_get+0x16/0xab
{HARDIRQ-ON-W} state was registered at:
  [<c104fe28>] mark_irqflags+0xbd/0x11a
  [<c1050386>] __lock_acquire+0x501/0x6bb
  [<c1050945>] lock_acquire+0x63/0x7b
  [<c131c51d>] _raw_spin_lock_bh+0x43/0x51
  [<c123bee4>] pd_alloc_chan_resources+0x92/0x11e
  [<c123ad62>] dma_chan_get+0x9b/0x107
  [<c123b2d1>] __dma_request_channel+0x61/0xdc
  [<c11ba24b>] pch_request_dma+0x61/0x19e
  [<c11bb3b8>] pch_uart_startup+0x16a/0x1a2
  [<c11b8446>] uart_startup+0x87/0x147
  [<c11b9183>] uart_open+0x117/0x13e
  [<c11a5c7d>] tty_open+0x23c/0x34c
  [<c1097705>] chrdev_open+0x140/0x15f
  [<c10930a6>] __dentry_open.clone.14+0x14a/0x22b
  [<c1093dfb>] nameidata_to_filp+0x36/0x40
  [<c109f28b>] do_last+0x513/0x635
  [<c109f4af>] path_openat+0x9c/0x2aa
  [<c109f6e4>] do_filp_open+0x27/0x69
  [<c1093f02>] do_sys_open+0xfd/0x184
  [<c1093fad>] sys_open+0x24/0x2a
  [<c131d58c>] sysenter_do_call+0x12/0x32
irq event stamp: 2522
hardirqs last  enabled at (2521): [<c131ca3b>] _raw_spin_unlock_irqrestore+0x36/0x52
hardirqs last disabled at (2522): [<c131db27>] common_interrupt+0x27/0x34
softirqs last  enabled at (2354): [<c102fa11>] __do_softirq+0x10a/0x11a
softirqs last disabled at (2299): [<c10041a4>] do_softirq+0x57/0xa4

other info that might help us debug this:
2 locks held by rs232/822:
 #0:  (&tty->atomic_write_lock){+.+.+.}, at: [<c11a4b7a>] tty_write_lock+0x14/0x3c
 #1:  (&port_lock_key){-.....}, at: [<c11bad72>] pch_uart_interrupt+0x17/0x1e9

stack backtrace:
Pid: 822, comm: rs232 Not tainted 2.6.39+ #89
Call Trace:
 [<c1319f90>] ? printk+0x19/0x1b
 [<c104f893>] print_usage_bug+0x184/0x18f
 [<c104e5b1>] ? print_irq_inversion_bug+0x10e/0x10e
 [<c104f943>] mark_lock_irq+0xa5/0x1f6
 [<c104fc9c>] mark_lock+0x208/0x2d7
 [<c104fdc0>] mark_irqflags+0x55/0x11a
 [<c1050386>] __lock_acquire+0x501/0x6bb
 [<c10042ee>] ? dump_trace+0x92/0xb6
 [<c1050945>] lock_acquire+0x63/0x7b
 [<c123b9a1>] ? pdc_desc_get+0x16/0xab
 [<c131c2d0>] _raw_spin_lock+0x3e/0x4c
 [<c123b9a1>] ? pdc_desc_get+0x16/0xab
 [<c123b9a1>] pdc_desc_get+0x16/0xab
 [<c10504d8>] ? __lock_acquire+0x653/0x6bb
 [<c123bb2c>] pd_prep_slave_sg+0x7c/0x1cb
 [<c1006c3f>] ? nommu_map_sg+0x6e/0x81
 [<c11bace6>] dma_handle_tx+0x2cf/0x344
 [<c11bad72>] ? pch_uart_interrupt+0x17/0x1e9
 [<c11baebb>] pch_uart_interrupt+0x160/0x1e9
 [<c10642fb>] handle_irq_event_percpu+0x25/0x127
 [<c1064429>] handle_irq_event+0x2c/0x43
 [<c1065e0d>] ? handle_fasteoi_irq+0x84/0x84
 [<c1065eb9>] handle_edge_irq+0xac/0xce
 <IRQ>  [<c1003ecb>] ? do_IRQ+0x38/0x9d
 [<c131db2e>] ? common_interrupt+0x2e/0x34
 [<c105007b>] ? __lock_acquire+0x1f6/0x6bb
 [<c131ca3d>] ? _raw_spin_unlock_irqrestore+0x38/0x52
 [<c11b798b>] ? uart_start+0x2d/0x32
 [<c11b7998>] ? uart_flush_chars+0x8/0xa
 [<c11a7962>] ? n_tty_write+0x12c/0x1c6
 [<c1027a73>] ? try_to_wake_up+0x251/0x251
 [<c11a4d0b>] ? tty_write+0x169/0x1dc
 [<c11a7836>] ? n_tty_ioctl+0xb7/0xb7
 [<c1094841>] ? vfs_write+0x91/0x10d
 [<c11a4ba2>] ? tty_write_lock+0x3c/0x3c
 [<c1094a69>] ? sys_write+0x3e/0x63
 [<c131d58c>] ? sysenter_do_call+0x12/0x32

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Tested-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2011-07-14 03:40:08 +05:30
..
accessibility
acpi Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2011-05-29 11:19:16 -07:00
amba ARM: 6829/1: amba: make hardcoded periphid override hardware 2011-05-26 10:33:34 +01:00
ata Merge branch 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block 2011-05-25 09:14:07 -07:00
atm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2011-05-20 13:43:21 -07:00
auxdisplay
base mm: per-node vmstat: show proper vmstats 2011-05-25 08:39:07 -07:00
bcma drivers/bcma/host_pci.c needs slab.h 2011-05-26 17:12:32 -07:00
block Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2011-06-04 08:11:26 +09:00
bluetooth Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
cdrom block: fix mismerge of the DISK_EVENT_MEDIA_CHANGE removal 2011-06-02 05:29:19 +09:00
char virtio console: don't manually set or finalize VIRTIO_CONSOLE_F_MULTIPORT. 2011-05-30 11:14:13 +09:30
clk
clocksource Revert "clocksource: sh_cmt: Runtime PM support" 2011-05-31 15:26:42 +09:00
connector
cpufreq cpufreq: make DB8500 cpufreq driver compile 2011-05-24 22:20:14 +02:00
cpuidle Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6 2011-05-29 11:18:09 -07:00
crypto [S390] ap: skip device registration on type probe failure 2011-05-23 10:24:29 +02:00
dca
dio
dma pch_dma: Fix channel locking 2011-07-14 03:40:08 +05:30
edac edac,rcu: use synchronize_rcu() instead of call_rcu()+rcu_barrier() 2011-05-26 17:12:37 -07:00
eisa
firewire
firmware Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
gpio arm gpio drivers: make them 'depends on ARM' 2011-05-29 14:06:42 -07:00
gpu vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
hid Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2011-05-23 12:33:02 -07:00
hwmon hwmon: (max6642): Better chip detection schema 2011-06-04 10:34:28 -07:00
hwspinlock
i2c mfd: Use mfd cell platform_data for timberdale cells platform bits 2011-05-26 19:45:05 +02:00
ide block: fix mismerge of the DISK_EVENT_MEDIA_CHANGE removal 2011-06-02 05:29:19 +09:00
idle
ieee802154
infiniband Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2011-05-26 12:13:57 -07:00
input Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
isdn Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
leds leds: Add ASIC3 LED support 2011-05-26 19:45:46 +02:00
lguest
macintosh Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
mca
md dm kcopyd: return client directly and not through a pointer 2011-05-29 13:03:13 +01:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-05-27 10:14:22 -07:00
memstick
message Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
mfd mfd: Fix build breakage caused by tps65910 gpio directory move 2011-05-28 08:38:55 +02:00
misc Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
mmc Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-05-27 19:51:32 -07:00
mtd Merge git://git.infradead.org/mtd-2.6 2011-05-27 20:06:53 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2011-06-04 23:16:00 +09:00
nfc
nubus
of Merge branch 'devicetree/arm-next' of git://git.secretlab.ca/git/linux-2.6 into devel-stable 2011-05-25 00:08:17 +01:00
oprofile oprofile: Use linux/mutex.h 2011-05-24 12:45:59 +02:00
parisc
parport Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-05-26 13:19:00 -07:00
pci Merge git://git.infradead.org/iommu-2.6 2011-06-02 05:48:50 +09:00
pcmcia
platform Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86 2011-05-29 11:44:33 -07:00
pnp
power Merge git://git.infradead.org/battery-2.6 2011-05-27 10:12:35 -07:00
pps
ps3
ptp ptp: Added a clock driver for the National Semiconductor PHYTER. 2011-05-23 13:10:23 -07:00
rapidio rapidio: fix default routing initialization 2011-05-18 02:55:22 -07:00
regulator regulator: Fix _regulator_get_voltage if get_voltage callback is NULL 2011-05-27 10:49:30 +01:00
rtc spi/rtc-m41t93: Use spi_get_drvdata() for SPI devices 2011-06-08 14:33:48 -06:00
s390 [S390] irq: merge irq.c and s390_ext.c 2011-05-26 09:48:24 +02:00
sbus
scsi [SCSI] Fix oops caused by queue refcounting failure 2011-06-02 18:34:43 +09:00
sfi
sh Merge branch 'sh/genirq-threading' into sh-latest 2011-05-23 11:36:14 +09:00
sn
spi spi/ep93xx: add DMA support 2011-06-08 15:46:12 -06:00
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2011-05-20 13:43:21 -07:00
staging Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-05-26 13:19:00 -07:00
target [SCSI] target: Convert TASK_ATTR to scsi_tcq.h definitions 2011-05-24 13:03:56 -04:00
tc
telephony
thermal
tty Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
uio
usb Merge branch 'for-usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci 2011-05-28 12:36:15 -07:00
uwb
vhost vhost: support event index 2011-05-30 11:14:15 +09:30
video drivers/video/mb862xx/mb862xxfbdrv.c needs uaccess.h 2011-05-26 17:12:32 -07:00
virtio virtio: add api for delayed callbacks 2011-05-30 11:14:16 +09:30
vlynq
w1 w1: add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support 2011-05-26 17:12:38 -07:00
watchdog mfd: Use mfd cell platform_data for rdc321x cells platform bits 2011-05-26 19:45:06 +02:00
xen Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/djm/tmem 2011-05-26 10:50:56 -07:00
zorro
Kconfig ptp: Added a brand new class driver for ptp clocks. 2011-05-23 13:01:00 -07:00
Makefile Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2011-05-28 12:35:15 -07:00