aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_promise.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sata_promise.c')
-rw-r--r--drivers/scsi/sata_promise.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
index 63911f16b6ec..b41c977d6fab 100644
--- a/drivers/scsi/sata_promise.c
+++ b/drivers/scsi/sata_promise.c
@@ -38,6 +38,7 @@
38#include <linux/delay.h> 38#include <linux/delay.h>
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/sched.h> 40#include <linux/sched.h>
41#include <linux/device.h>
41#include "scsi.h" 42#include "scsi.h"
42#include <scsi/scsi_host.h> 43#include <scsi/scsi_host.h>
43#include <linux/libata.h> 44#include <linux/libata.h>
@@ -399,7 +400,8 @@ static void pdc_eng_timeout(struct ata_port *ap)
399 case ATA_PROT_DMA: 400 case ATA_PROT_DMA:
400 case ATA_PROT_NODATA: 401 case ATA_PROT_NODATA:
401 printk(KERN_ERR "ata%u: command timeout\n", ap->id); 402 printk(KERN_ERR "ata%u: command timeout\n", ap->id);
402 ata_qc_complete(qc, ata_wait_idle(ap) | ATA_ERR); 403 drv_stat = ata_wait_idle(ap);
404 ata_qc_complete(qc, __ac_err_mask(drv_stat));
403 break; 405 break;
404 406
405 default: 407 default:
@@ -408,7 +410,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
408 printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n", 410 printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
409 ap->id, qc->tf.command, drv_stat); 411 ap->id, qc->tf.command, drv_stat);
410 412
411 ata_qc_complete(qc, drv_stat); 413 ata_qc_complete(qc, ac_err_mask(drv_stat));
412 break; 414 break;
413 } 415 }
414 416
@@ -420,24 +422,21 @@ out:
420static inline unsigned int pdc_host_intr( struct ata_port *ap, 422static inline unsigned int pdc_host_intr( struct ata_port *ap,
421 struct ata_queued_cmd *qc) 423 struct ata_queued_cmd *qc)
422{ 424{
423 u8 status; 425 unsigned int handled = 0, err_mask = 0;
424 unsigned int handled = 0, have_err = 0;
425 u32 tmp; 426 u32 tmp;
426 void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_GLOBAL_CTL; 427 void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_GLOBAL_CTL;
427 428
428 tmp = readl(mmio); 429 tmp = readl(mmio);
429 if (tmp & PDC_ERR_MASK) { 430 if (tmp & PDC_ERR_MASK) {
430 have_err = 1; 431 err_mask = AC_ERR_DEV;
431 pdc_reset_port(ap); 432 pdc_reset_port(ap);
432 } 433 }
433 434
434 switch (qc->tf.protocol) { 435 switch (qc->tf.protocol) {
435 case ATA_PROT_DMA: 436 case ATA_PROT_DMA:
436 case ATA_PROT_NODATA: 437 case ATA_PROT_NODATA:
437 status = ata_wait_idle(ap); 438 err_mask |= ac_err_mask(ata_wait_idle(ap));
438 if (have_err) 439 ata_qc_complete(qc, err_mask);
439 status |= ATA_ERR;
440 ata_qc_complete(qc, status);
441 handled = 1; 440 handled = 1;
442 break; 441 break;
443 442
@@ -635,7 +634,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
635 int rc; 634 int rc;
636 635
637 if (!printed_version++) 636 if (!printed_version++)
638 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); 637 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
639 638
640 /* 639 /*
641 * If this driver happens to only be useful on Apple's K2, then 640 * If this driver happens to only be useful on Apple's K2, then