summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-all.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2001-10-03 08:25:11 +0000
committersos <sos@FreeBSD.org>2001-10-03 08:25:11 +0000
commit8f9173fea7eccb822bd620082c8212de2ef545ab (patch)
tree335a23a89d85aa0f2eb3f153dbd59b33c2b90e25 /sys/dev/ata/ata-all.c
parent25f2ac914070dee5156f9a28177ec2b0a9315c9e (diff)
downloadFreeBSD-src-8f9173fea7eccb822bd620082c8212de2ef545ab.zip
FreeBSD-src-8f9173fea7eccb822bd620082c8212de2ef545ab.tar.gz
Hopefully fix the identify failed on ATAPI slaves on some notebooks.
Diffstat (limited to 'sys/dev/ata/ata-all.c')
-rw-r--r--sys/dev/ata/ata-all.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index 1aac355..da275d4 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -460,11 +460,13 @@ ata_getparam(struct ata_softc *scp, int device, u_int8_t command)
/* apparently some devices needs this repeated */
do {
if (ata_command(scp, device, command, 0, 0, 0, 0, 0, ATA_WAIT_INTR)) {
- ata_printf(scp, device, "identify failed\n");
+ ata_printf(scp, device, "%s identify failed\n",
+ command == ATA_C_ATAPI_IDENTIFY ? "ATAPI" : "ATA");
return -1;
}
if (retry++ > 4) {
- ata_printf(scp, device, "identify retries exceeded\n");
+ ata_printf(scp, device, "%s identify retries exceeded\n",
+ command == ATA_C_ATAPI_IDENTIFY ? "ATAPI" : "ATA");
return -1;
}
} while (ata_wait(scp, device,
@@ -711,6 +713,8 @@ ata_reset(struct ata_softc *scp)
mask, ostat0, ostat1);
/* reset channel */
+ ATA_OUTB(scp->r_io, ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
+ DELAY(10);
ATA_OUTB(scp->r_altio, ATA_ALTSTAT, ATA_A_IDS | ATA_A_RESET);
DELAY(10000);
ATA_OUTB(scp->r_altio, ATA_ALTSTAT, ATA_A_IDS);
@@ -1066,6 +1070,7 @@ ata_free_name(struct ata_softc *scp, int device)
{
if (scp->dev_name[ATA_DEV(device)])
free(scp->dev_name[ATA_DEV(device)], M_ATA);
+ scp->dev_name[ATA_DEV(device)] = NULL;
}
int
OpenPOWER on IntegriCloud