]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] 2.5.19 IDE 82
authorMartin Dalecki <dalecki@evision-ventures.com>
Sun, 2 Jun 2002 09:43:00 +0000 (02:43 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 2 Jun 2002 09:43:00 +0000 (02:43 -0700)
 - PPC compilation fix by Paul Mackerras.

 - Various fixes by Bartek:

   fix ata_irq_enable() and ata_reset() for legacy ATA-1 devices

   in start_request() for REQ_DRIVE_ACB
   a) don't run ->prehandler() twice
   b) return ata_taskfile() value

drivers/ide/device.c
drivers/ide/ide-pmac.c
drivers/ide/ide.c

index 652d8d49a8d9135515c417fb3f67171771ae7972..2fed30d01ff7d26a3c6cd55bf9ea6f34c81f7347 100644 (file)
@@ -105,11 +105,12 @@ int ata_irq_enable(struct ata_device *drive, int on)
        if (!ch->io_ports[IDE_CONTROL_OFFSET])
                return 0;
 
+       /* 0x08 is for legacy ATA-1 devices */
        if (on)
-               OUT_BYTE(0x00, ch->io_ports[IDE_CONTROL_OFFSET]);
+               OUT_BYTE(0x08 | 0x00, ch->io_ports[IDE_CONTROL_OFFSET]);
        else {
                if (!ch->intrproc)
-                       OUT_BYTE(0x02, ch->io_ports[IDE_CONTROL_OFFSET]);
+                       OUT_BYTE(0x08 | 0x02, ch->io_ports[IDE_CONTROL_OFFSET]);
                else
                        ch->intrproc(drive);
        }
@@ -131,9 +132,11 @@ void ata_reset(struct ata_channel *ch)
                return;
 
        printk("%s: reset\n", ch->name);
-       OUT_BYTE(0x04, ch->io_ports[IDE_CONTROL_OFFSET]);
+       /* 0x08 is for legacy ATA-1 devices */
+       OUT_BYTE(0x08 | 0x04, ch->io_ports[IDE_CONTROL_OFFSET]);
        udelay(10);
-       OUT_BYTE(0x00, ch->io_ports[IDE_CONTROL_OFFSET]);
+       /* 0x08 is for legacy ATA-1 devices */
+       OUT_BYTE(0x08 | 0x00, ch->io_ports[IDE_CONTROL_OFFSET]);
        do {
                mdelay(50);
                stat = IN_BYTE(ch->io_ports[IDE_STATUS_OFFSET]);
index 56631392f93359a57e2f2ec7a744fd45047b550b..6341efffd062a425996e40ac07ebb1fb3696e69f 100644 (file)
@@ -431,7 +431,7 @@ pmac_ide_do_setfeature(struct ata_device *drive, u8 command)
                goto out;
        }
        udelay(10);
-       ata_irq_enale(drive, 0);
+       ata_irq_enable(drive, 0);
        OUT_BYTE(command, IDE_NSECTOR_REG);
        OUT_BYTE(SETFEATURES_XFER, IDE_FEATURE_REG);
        OUT_BYTE(WIN_SETFEATURES, IDE_COMMAND_REG);
@@ -1577,9 +1577,9 @@ idepmac_wake_device(struct ata_device *drive, int used_dma)
         */
        if (used_dma && !ide_spin_wait_hwgroup(drive)) {
                /* Lock HW group */
-               set_bit(IDE_BUSY, &drive->channel->active);
+               set_bit(IDE_BUSY, drive->channel->active);
                pmac_ide_check_dma(drive);
-               clear_bit(IDE_BUSY, &drive->channel->active);
+               clear_bit(IDE_BUSY, drive->channel->active);
                spin_unlock_irq(drive->channel->lock);
        }
 #endif
@@ -1626,7 +1626,7 @@ idepmac_sleep_drive(struct ata_device *drive, int idx, unsigned long base)
                return;
        else {
                /* Lock HW group */
-               set_bit(IDE_BUSY, &drive->channel->active);
+               set_bit(IDE_BUSY, drive->channel->active);
                /* Stop the device */
                idepmac_sleep_device(drive, idx, base);
                spin_unlock_irq(drive->channel->lock);
@@ -1656,7 +1656,7 @@ idepmac_wake_drive(struct ata_device *drive, unsigned long base)
 
        /* We resume processing on the lock group */
        spin_lock_irq(drive->channel->lock);
-       clear_bit(IDE_BUSY, &drive->channel->active);
+       clear_bit(IDE_BUSY, drive->channel->active);
        if (!list_empty(&drive->queue.queue_head))
                do_ide_request(&drive->queue);
        spin_unlock_irq(drive->channel->lock);
index b3245c977552f1c8f69c6d8af35caef766cfc9d3..26023c342d8aa21cb21bce071d90940bcc9b7c68 100644 (file)
@@ -754,14 +754,7 @@ static ide_startstop_t start_request(struct ata_device *drive, struct request *r
                if (!(ar))
                        goto args_error;
 
-               ata_taskfile(drive, ar, NULL);
-
-               if (((ar->command_type == IDE_DRIVE_TASK_RAW_WRITE) ||
-                    (ar->command_type == IDE_DRIVE_TASK_OUT)) &&
-                               ar->prehandler && ar->handler)
-                       return ar->prehandler(drive, rq);
-
-               return ide_started;
+               return ata_taskfile(drive, ar, NULL);
        }
 
        /* The normal way of execution is to pass and execute the request