diff options
author | thomas <thomas@FreeBSD.org> | 2002-12-01 14:20:08 +0000 |
---|---|---|
committer | thomas <thomas@FreeBSD.org> | 2002-12-01 14:20:08 +0000 |
commit | 076b3c495b33a8f240b14857e848b3460f6519a0 (patch) | |
tree | a7f63d045cf37188772490a43514935b99e4e126 /sys | |
parent | f65e3497aa3049df9bddaaa7fe44890c951114f3 (diff) | |
download | FreeBSD-src-076b3c495b33a8f240b14857e848b3460f6519a0.zip FreeBSD-src-076b3c495b33a8f240b14857e848b3460f6519a0.tar.gz |
In ata_reinit, when ata_getparam fails for a new device (indicating that
the device is not actually present), clear the corresponding bit in
the ch->devices bitmap. This resolves a panic that occurred with ATAPI/CAM
after an APM suspend/resume, when the ATA hardware would erroneously
report an extra ATAPI device.
Approved by: re, sos
Reviewed by: roberto
MFC after: 7 days
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ata/ata-all.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index c7cc11f..17f3dc3 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -877,17 +877,18 @@ ata_reinit(struct ata_channel *ch) if ((newdev = ~devices & ch->devices)) { if (newdev & ATA_ATA_MASTER) if (ata_getparam(&ch->device[MASTER], ATA_C_ATA_IDENTIFY)) - newdev &= ~ATA_ATA_MASTER; + ch->devices &= ~ATA_ATA_MASTER; if (newdev & ATA_ATA_SLAVE) if (ata_getparam(&ch->device[SLAVE], ATA_C_ATA_IDENTIFY)) - newdev &= ~ATA_ATA_SLAVE; + ch->devices &= ~ATA_ATA_SLAVE; if (newdev & ATA_ATAPI_MASTER) if (ata_getparam(&ch->device[MASTER], ATA_C_ATAPI_IDENTIFY)) - newdev &= ~ATA_ATAPI_MASTER; + ch->devices &= ~ATA_ATAPI_MASTER; if (newdev & ATA_ATAPI_SLAVE) if (ata_getparam(&ch->device[SLAVE], ATA_C_ATAPI_IDENTIFY)) - newdev &= ~ATA_ATAPI_SLAVE; + ch->devices &= ~ATA_ATAPI_SLAVE; } + newdev = ~devices & ch->devices; #ifdef DEV_ATADISK if (newdev & ATA_ATA_MASTER && !ch->device[MASTER].driver) ad_attach(&ch->device[MASTER]); |