diff options
Diffstat (limited to 'drivers/scsi/sata_promise.c')
-rw-r--r-- | drivers/scsi/sata_promise.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c index 3c3ab866351f..b2e2f1825edb 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> |
@@ -402,7 +403,8 @@ static void pdc_eng_timeout(struct ata_port *ap) | |||
402 | case ATA_PROT_DMA: | 403 | case ATA_PROT_DMA: |
403 | case ATA_PROT_NODATA: | 404 | case ATA_PROT_NODATA: |
404 | printk(KERN_ERR "ata%u: command timeout\n", ap->id); | 405 | printk(KERN_ERR "ata%u: command timeout\n", ap->id); |
405 | ata_qc_complete(qc, ata_wait_idle(ap) | ATA_ERR); | 406 | drv_stat = ata_wait_idle(ap); |
407 | ata_qc_complete(qc, __ac_err_mask(drv_stat)); | ||
406 | break; | 408 | break; |
407 | 409 | ||
408 | default: | 410 | default: |
@@ -411,7 +413,7 @@ static void pdc_eng_timeout(struct ata_port *ap) | |||
411 | printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n", | 413 | printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n", |
412 | ap->id, qc->tf.command, drv_stat); | 414 | ap->id, qc->tf.command, drv_stat); |
413 | 415 | ||
414 | ata_qc_complete(qc, drv_stat); | 416 | ata_qc_complete(qc, ac_err_mask(drv_stat)); |
415 | break; | 417 | break; |
416 | } | 418 | } |
417 | 419 | ||
@@ -423,24 +425,21 @@ out: | |||
423 | static inline unsigned int pdc_host_intr( struct ata_port *ap, | 425 | static inline unsigned int pdc_host_intr( struct ata_port *ap, |
424 | struct ata_queued_cmd *qc) | 426 | struct ata_queued_cmd *qc) |
425 | { | 427 | { |
426 | u8 status; | 428 | unsigned int handled = 0, err_mask = 0; |
427 | unsigned int handled = 0, have_err = 0; | ||
428 | u32 tmp; | 429 | u32 tmp; |
429 | void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_GLOBAL_CTL; | 430 | void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_GLOBAL_CTL; |
430 | 431 | ||
431 | tmp = readl(mmio); | 432 | tmp = readl(mmio); |
432 | if (tmp & PDC_ERR_MASK) { | 433 | if (tmp & PDC_ERR_MASK) { |
433 | have_err = 1; | 434 | err_mask = AC_ERR_DEV; |
434 | pdc_reset_port(ap); | 435 | pdc_reset_port(ap); |
435 | } | 436 | } |
436 | 437 | ||
437 | switch (qc->tf.protocol) { | 438 | switch (qc->tf.protocol) { |
438 | case ATA_PROT_DMA: | 439 | case ATA_PROT_DMA: |
439 | case ATA_PROT_NODATA: | 440 | case ATA_PROT_NODATA: |
440 | status = ata_wait_idle(ap); | 441 | err_mask |= ac_err_mask(ata_wait_idle(ap)); |
441 | if (have_err) | 442 | ata_qc_complete(qc, err_mask); |
442 | status |= ATA_ERR; | ||
443 | ata_qc_complete(qc, status); | ||
444 | handled = 1; | 443 | handled = 1; |
445 | break; | 444 | break; |
446 | 445 | ||
@@ -638,7 +637,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e | |||
638 | int rc; | 637 | int rc; |
639 | 638 | ||
640 | if (!printed_version++) | 639 | if (!printed_version++) |
641 | printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); | 640 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); |
642 | 641 | ||
643 | /* | 642 | /* |
644 | * If this driver happens to only be useful on Apple's K2, then | 643 | * If this driver happens to only be useful on Apple's K2, then |