diff options
-rw-r--r-- | sys/dev/ata/ata-all.c | 10 | ||||
-rw-r--r-- | sys/dev/ata/ata-disk.c | 6 | ||||
-rw-r--r-- | sys/dev/ata/atapi-all.c | 1 | ||||
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 1 | ||||
-rw-r--r-- | sys/dev/ata/atapi-tape.c | 1 |
5 files changed, 4 insertions, 15 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 359bfd3..4dc6508 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -421,17 +421,9 @@ ata_getparam(struct ata_device *atadev, u_int8_t command) struct ata_params *ata_parm; int retry = 0; - /* select drive */ - ATA_OUTB(atadev->channel->r_io, ATA_DRIVE, ATA_D_IBM | atadev->unit); - DELAY(1); - - /* enable interrupt */ - ATA_OUTB(atadev->channel->r_altio, ATA_ALTSTAT, ATA_A_4BIT); - DELAY(1); - /* apparently some devices needs this repeated */ do { - if (ata_command(atadev, command, 0, 0, 0, ATA_WAIT_INTR)) { + if (ata_command(atadev, command, 0, 0, 0, ATA_WAIT_READY)) { ata_prtdev(atadev, "%s identify failed\n", command == ATA_C_ATAPI_IDENTIFY ? "ATAPI" : "ATA"); return -1; diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 4bbce23..b97b009 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -28,7 +28,6 @@ * $FreeBSD$ */ -#include "opt_global.h" #include "opt_ata.h" #include <sys/param.h> #include <sys/systm.h> @@ -617,6 +616,7 @@ ad_interrupt(struct ad_request *request) ata_dmainit(adp->device->channel, adp->device->unit, ata_pmode(adp->device->param), -1, -1); request->flags |= ADR_F_FORCE_PIO; + printf(" trying PIO mode\n"); TAILQ_INSERT_HEAD(&adp->device->channel->ata_queue, request, chain); return ATA_OP_FINISHED; } @@ -627,7 +627,7 @@ ad_interrupt(struct ad_request *request) } /* if we arrived here with forced PIO mode, DMA doesn't work right */ - if (request->flags & ADR_F_FORCE_PIO) + if (request->flags & ADR_F_FORCE_PIO && !(request->flags & ADR_F_ERROR)) ata_prtdev(adp->device, "DMA problem fallback to PIO mode\n"); /* if this was a PIO read operation, get the data */ @@ -890,7 +890,7 @@ ad_reinit(struct ata_device *atadev) /* reinit disk parameters */ ad_invalidatequeue(atadev->driver, NULL); ata_command(atadev, ATA_C_SET_MULTI, 0, - adp->transfersize / DEV_BSIZE, 0, ATA_WAIT_INTR); + adp->transfersize / DEV_BSIZE, 0, ATA_WAIT_READY); if (adp->device->mode >= ATA_DMA) ata_dmainit(atadev->channel, atadev->unit, ata_pmode(adp->device->param), diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c index 73c520f..794db5d 100644 --- a/sys/dev/ata/atapi-all.c +++ b/sys/dev/ata/atapi-all.c @@ -28,7 +28,6 @@ * $FreeBSD$ */ -#include "opt_global.h" #include "opt_ata.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index d7bc3e3..b9dc7e5 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -29,7 +29,6 @@ */ #include "opt_ata.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/ata.h> diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index 00af24a..03130ad 100644 --- a/sys/dev/ata/atapi-tape.c +++ b/sys/dev/ata/atapi-tape.c @@ -29,7 +29,6 @@ */ #include "opt_ata.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/ata.h> |