linux-kernel-test/drivers
Peter Zijlstra 9a2239b117 [PATCH] lockdep: fix ide/proc interaction
rmmod/3080 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
   (proc_subdir_lock){--..}, at: [<c04a33b0>] remove_proc_entry+0x40/0x191

  and this task is already holding:
   (ide_lock){++..}, at: [<c05651a2>] ide_unregister_subdriver+0x39/0xc8
  which would create a new lock dependency:
   (ide_lock){++..} -> (proc_subdir_lock){--..}

  but this new dependency connects a hard-irq-safe lock:
   (ide_lock){++..}
  ... which became hard-irq-safe at:
    [<c043c458>] lock_acquire+0x4b/0x6b
    [<c06129d7>] _spin_lock_irqsave+0x22/0x32
    [<c0567870>] ide_intr+0x17/0x1a9
    [<c044eb31>] handle_IRQ_event+0x20/0x4d
    [<c044ebf2>] __do_IRQ+0x94/0xef
    [<c0406771>] do_IRQ+0x9e/0xbd

  to a hard-irq-unsafe lock:
   (proc_subdir_lock){--..}
  ... which became hard-irq-unsafe at:
  ...  [<c043c458>] lock_acquire+0x4b/0x6b
    [<c06126ab>] _spin_lock+0x19/0x28
    [<c04a32f2>] xlate_proc_name+0x1b/0x99
    [<c04a3547>] proc_create+0x46/0xdf
    [<c04a3642>] create_proc_entry+0x62/0xa5
    [<c07c1972>] proc_misc_init+0x1c/0x1d2
    [<c07c1844>] proc_root_init+0x4c/0xe9
    [<c07ad703>] start_kernel+0x294/0x3b3

Move ide_remove_proc_entries() out from under ide_lock; there is nothing
that indicates that this is needed.

In specific, the call to ide_add_proc_entries() is unprotected, and there
is nothing else in the file using the respective ->proc fields. Also the
lock order around destroy_proc_ide_interface() suggests this.

Alan sayeth:

  proc_ide_write_settings walks the setting list under ide_setting_sem, read
  ditto.  remove_proc_entry is doing proc side housekeeping.

  Looks fine to me, although that old code is such a mess anything could be
  going on.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:32 -08:00
..
acorn
acpi Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-05 17:01:28 +00:00
amba
ata Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-06 15:01:18 +00:00
atm [PATCH] slab: remove SLAB_DMA 2006-12-07 08:39:24 -08:00
base [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
block [PATCH] cciss: cleanup cciss_interrupt mode 2006-12-07 08:39:30 -08:00
bluetooth Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-06 15:01:18 +00:00
cdrom [PATCH] block: support larger block pc requests 2006-12-01 10:40:55 +01:00
char [PATCH] SysRq-X: show blocked tasks 2006-12-07 08:39:32 -08:00
clocksource [PATCH] clocksource: acpi_pm: add another greylist chipset 2006-10-21 13:35:05 -07:00
connector WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
cpufreq WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
crypto
dio
dma [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
edac [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
eisa [PATCH] EISA: handle sysfs errors 2006-10-11 11:14:25 -07:00
fc4 [SCSI] fc4: Conversion to struct scsi_cmnd in fc4 2006-10-25 15:12:45 -07:00
firmware [PATCH] dell_rbu: fix error check 2006-11-16 11:43:38 -08:00
hwmon [PATCH] severing fs.h, radix-tree.h -> sched.h 2006-12-04 02:00:24 -05:00
i2c [PATCH] ... and more work_struct-induced breakage (mips) 2006-12-06 14:51:14 -08:00
ide [PATCH] lockdep: fix ide/proc interaction 2006-12-07 08:39:32 -08:00
ieee1394 [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
infiniband [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
input [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
isdn [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
leds [PATCH] severing module.h->sched.h 2006-12-04 02:00:22 -05:00
macintosh [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
mca [PATCH] drivers/mca: handle sysfs errors 2006-10-11 11:14:25 -07:00
md [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
media [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
message [PATCH] I2O: more error checking 2006-12-07 08:39:31 -08:00
mfd [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
misc WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
mmc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-05 14:37:56 +00:00
mtd [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
net [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
nubus
oprofile WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
parisc Fix misc .c/.h comment typos 2006-11-30 05:24:39 +01:00
parport [PATCH] pcmcia: conf.ConfigBase and conf.Present consolidation 2006-12-04 20:12:02 -05:00
pci [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
pcmcia [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
pnp [PATCH] PNP: handle sysfs errors 2006-12-07 08:39:31 -08:00
ps3 [POWERPC] ps3: multiplatform build fixes 2006-12-04 20:41:16 +11:00
rapidio
rtc [PATCH] RTC: handle sysfs errors 2006-12-07 08:39:31 -08:00
s390 [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
sbus [SPARC]: Fix bus_id[] string overflow. 2006-10-27 01:03:31 -07:00
scsi [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
serial [PATCH] serial uartlite driver 2006-12-07 08:39:30 -08:00
sh
sn [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
spi [PATCH] SPI: improve sysfs compiler complaint handling 2006-12-07 08:39:31 -08:00
tc
telephony [PATCH] pcmcia: conf.ConfigBase and conf.Present consolidation 2006-12-04 20:12:02 -05:00
usb [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
video WorkQueue: Fix up arch-specific work items where possible 2006-12-05 19:36:26 +00:00
w1 [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
zorro
Kconfig [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
Makefile [POWERPC] ps3: Missed renames of CONFIG_PS3 to CONFIG_PPC_PS3 2006-12-04 20:41:14 +11:00