linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/4] ide: tighten checks on PCI BARs in ide_hwif_configure()
@ 2008-06-06 21:41 Bartlomiej Zolnierkiewicz
  2008-06-07  0:12 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-06 21:41 UTC (permalink / raw)
  To: linux-ide; +Cc: linux-kernel

Alan has fixed PCI layer handling of PCI IDE in Compatibility mode so
PCI BAR 0/1 (and/or 2/3) content reported by kernel should never be zero.

Tighten checks on PCI BARs and also fix printk() message while on it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/setup-pci.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Index: b/drivers/ide/setup-pci.c
===================================================================
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -319,18 +319,18 @@ static ide_hwif_t *ide_hwif_configure(st
 
 		ctl  = pci_resource_start(dev, 2*port+1);
 		base = pci_resource_start(dev, 2*port);
-		if ((ctl && !base) || (base && !ctl)) {
-			printk(KERN_ERR "%s: inconsistent baseregs (BIOS) "
-				"for port %d, skipping\n", d->name, port);
-			return NULL;
-		}
-	}
-	if (!ctl) {
+	} else {
 		/* Use default values */
 		ctl = port ? 0x374 : 0x3f4;
 		base = port ? 0x170 : 0x1f0;
 	}
 
+	if (!base || !ctl) {
+		printk(KERN_ERR "%s: bad PCI BARs for port %d, skipping\n",
+				d->name, port);
+		return NULL;
+	}
+
 	hwif = ide_find_port_slot(d);
 	if (hwif == NULL) {
 		printk(KERN_ERR "%s: too many IDE interfaces, no room in "

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-07  0:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06 21:41 [PATCH 4/4] ide: tighten checks on PCI BARs in ide_hwif_configure() Bartlomiej Zolnierkiewicz
2008-06-07  0:12 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).