aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386
diff options
context:
space:
mode:
authorZhang, Yanmin <yanmin_zhang@linux.intel.com>2007-07-16 02:39:39 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:40 -0400
commited4aaadb1a7913f509f05d3e67840541a180713f (patch)
tree7089fd2fe0f56d552ea153e2925363d0febaa952 /include/asm-i386
parent012bfdf00ce2f36a1add75a0d18303656c6294ef (diff)
fix jvc cdrom drive lockup
Before calling init_hwif_default, ide_unregister gets lock ide_lock and disables irq. init_hwif_default calls ide_default_io_base which calls pci_get_device and later pci_get_subsys tries to apply for semaphore pci_bus_sem and goes to sleep. Mostly, pci_get_device should be called when irq is turned on. ide_default_io_base just needs find if list pci_devices is empty. Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com> Cc: Greg KH <greg@kroah.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-i386')
-rw-r--r--include/asm-i386/ide.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 0fc240c80f49..e7817a3d6578 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -40,14 +40,13 @@ static __inline__ int ide_default_irq(unsigned long base)
40 40
41static __inline__ unsigned long ide_default_io_base(int index) 41static __inline__ unsigned long ide_default_io_base(int index)
42{ 42{
43 struct pci_dev *pdev;
44 /* 43 /*
45 * If PCI is present then it is not safe to poke around 44 * If PCI is present then it is not safe to poke around
46 * the other legacy IDE ports. Only 0x1f0 and 0x170 are 45 * the other legacy IDE ports. Only 0x1f0 and 0x170 are
47 * defined compatibility mode ports for PCI. A user can 46 * defined compatibility mode ports for PCI. A user can
48 * override this using ide= but we must default safe. 47 * override this using ide= but we must default safe.
49 */ 48 */
50 if ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL)) == NULL) { 49 if (no_pci_devices()) {
51 switch(index) { 50 switch(index) {
52 case 2: return 0x1e8; 51 case 2: return 0x1e8;
53 case 3: return 0x168; 52 case 3: return 0x168;
@@ -55,7 +54,6 @@ static __inline__ unsigned long ide_default_io_base(int index)
55 case 5: return 0x160; 54 case 5: return 0x160;
56 } 55 }
57 } 56 }
58 pci_dev_put(pdev);
59 switch (index) { 57 switch (index) {
60 case 0: return 0x1f0; 58 case 0: return 0x1f0;
61 case 1: return 0x170; 59 case 1: return 0x170;