summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2001-03-19 13:31:58 +0000
committersos <sos@FreeBSD.org>2001-03-19 13:31:58 +0000
commitd98c5293d7c959bbef954c5c8e9c97d67138634f (patch)
treeecac49ad1aa70bacc25e53f66fb7ef3ae6853ae3
parentf67e4a8fc7fc95c74bd6c09d3453200de47faea5 (diff)
downloadFreeBSD-src-d98c5293d7c959bbef954c5c8e9c97d67138634f.zip
FreeBSD-src-d98c5293d7c959bbef954c5c8e9c97d67138634f.tar.gz
Try not to engage to ATA channels that are disabled by the BIOS.
-rw-r--r--sys/dev/ata/ata-pci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index 280c476..4968fd9 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -245,6 +245,11 @@ ata_pci_attach(device_t dev)
subclass = pci_get_subclass(dev);
cmd = pci_read_config(dev, PCIR_COMMAND, 4);
+ if (!(cmd & PCIM_CMD_PORTEN)) {
+ device_printf(dev, "ATA channel disabled by BIOS\n");
+ return 0;
+ }
+
/* is busmastering supported ? */
if ((cmd & (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN)) ==
(PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN)) {
OpenPOWER on IntegriCloud