From 669367a9a16fe10c78701957461156a1e2c4edf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Sat, 21 Jan 2006 17:38:10 +0000 Subject: [PATCH] Fix panic on boot due to not all SATA chipsets having SSTATUS registeri resources set. --- sys/dev/ata/ata-chipset.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index f75154376c2d..2f0e11fd50da 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -339,15 +339,15 @@ ata_sata_setmode(device_t dev, int mode) if (atadev->param.satacapabilities != 0x0000 && atadev->param.satacapabilities != 0xffff) { struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - int status; /* on some drives we need to set the transfer mode */ ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, ata_limit_mode(dev, mode, ATA_UDMA6)); /* query SATA STATUS for the speed */ - status = ATA_IDX_INL(ch, ATA_SSTATUS); - if ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) + if (ch->r_io[ATA_SSTATUS].res && + ((ATA_IDX_INL(ch, ATA_SSTATUS) & ATA_SS_CONWELL_MASK) == + ATA_SS_CONWELL_GEN2)) atadev->mode = ATA_SA300; else atadev->mode = ATA_SA150;