diff options
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
| -rw-r--r-- | drivers/scsi/sata_sil24.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index 51855d3bac64..c66548025657 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
| 36 | #include <linux/interrupt.h> | 36 | #include <linux/interrupt.h> |
| 37 | #include <linux/dma-mapping.h> | 37 | #include <linux/dma-mapping.h> |
| 38 | #include <linux/device.h> | ||
| 38 | #include <scsi/scsi_host.h> | 39 | #include <scsi/scsi_host.h> |
| 39 | #include "scsi.h" | 40 | #include "scsi.h" |
| 40 | #include <linux/libata.h> | 41 | #include <linux/libata.h> |
| @@ -225,7 +226,6 @@ struct sil24_host_priv { | |||
| 225 | }; | 226 | }; |
| 226 | 227 | ||
| 227 | static u8 sil24_check_status(struct ata_port *ap); | 228 | static u8 sil24_check_status(struct ata_port *ap); |
| 228 | static u8 sil24_check_err(struct ata_port *ap); | ||
| 229 | static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg); | 229 | static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg); |
| 230 | static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val); | 230 | static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val); |
| 231 | static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf); | 231 | static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf); |
| @@ -280,7 +280,6 @@ static const struct ata_port_operations sil24_ops = { | |||
| 280 | 280 | ||
| 281 | .check_status = sil24_check_status, | 281 | .check_status = sil24_check_status, |
| 282 | .check_altstatus = sil24_check_status, | 282 | .check_altstatus = sil24_check_status, |
| 283 | .check_err = sil24_check_err, | ||
| 284 | .dev_select = ata_noop_dev_select, | 283 | .dev_select = ata_noop_dev_select, |
| 285 | 284 | ||
| 286 | .tf_read = sil24_tf_read, | 285 | .tf_read = sil24_tf_read, |
| @@ -363,12 +362,6 @@ static u8 sil24_check_status(struct ata_port *ap) | |||
| 363 | return pp->tf.command; | 362 | return pp->tf.command; |
| 364 | } | 363 | } |
| 365 | 364 | ||
| 366 | static u8 sil24_check_err(struct ata_port *ap) | ||
| 367 | { | ||
| 368 | struct sil24_port_priv *pp = ap->private_data; | ||
| 369 | return pp->tf.feature; | ||
| 370 | } | ||
| 371 | |||
| 372 | static int sil24_scr_map[] = { | 365 | static int sil24_scr_map[] = { |
| 373 | [SCR_CONTROL] = 0, | 366 | [SCR_CONTROL] = 0, |
| 374 | [SCR_STATUS] = 1, | 367 | [SCR_STATUS] = 1, |
| @@ -506,7 +499,7 @@ static void sil24_eng_timeout(struct ata_port *ap) | |||
| 506 | 499 | ||
| 507 | qc = ata_qc_from_tag(ap, ap->active_tag); | 500 | qc = ata_qc_from_tag(ap, ap->active_tag); |
| 508 | if (!qc) { | 501 | if (!qc) { |
| 509 | printk(KERN_ERR "ata%u: BUG: tiemout without command\n", | 502 | printk(KERN_ERR "ata%u: BUG: timeout without command\n", |
| 510 | ap->id); | 503 | ap->id); |
| 511 | return; | 504 | return; |
| 512 | } | 505 | } |
| @@ -520,7 +513,7 @@ static void sil24_eng_timeout(struct ata_port *ap) | |||
| 520 | */ | 513 | */ |
| 521 | printk(KERN_ERR "ata%u: command timeout\n", ap->id); | 514 | printk(KERN_ERR "ata%u: command timeout\n", ap->id); |
| 522 | qc->scsidone = scsi_finish_command; | 515 | qc->scsidone = scsi_finish_command; |
| 523 | ata_qc_complete(qc, ATA_ERR); | 516 | ata_qc_complete(qc, AC_ERR_OTHER); |
| 524 | 517 | ||
| 525 | sil24_reset_controller(ap); | 518 | sil24_reset_controller(ap); |
| 526 | } | 519 | } |
| @@ -531,6 +524,7 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) | |||
| 531 | struct sil24_port_priv *pp = ap->private_data; | 524 | struct sil24_port_priv *pp = ap->private_data; |
| 532 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; | 525 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
| 533 | u32 irq_stat, cmd_err, sstatus, serror; | 526 | u32 irq_stat, cmd_err, sstatus, serror; |
| 527 | unsigned int err_mask; | ||
| 534 | 528 | ||
| 535 | irq_stat = readl(port + PORT_IRQ_STAT); | 529 | irq_stat = readl(port + PORT_IRQ_STAT); |
| 536 | writel(irq_stat, port + PORT_IRQ_STAT); /* clear irq */ | 530 | writel(irq_stat, port + PORT_IRQ_STAT); /* clear irq */ |
| @@ -558,17 +552,18 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) | |||
| 558 | * Device is reporting error, tf registers are valid. | 552 | * Device is reporting error, tf registers are valid. |
| 559 | */ | 553 | */ |
| 560 | sil24_update_tf(ap); | 554 | sil24_update_tf(ap); |
| 555 | err_mask = ac_err_mask(pp->tf.command); | ||
| 561 | } else { | 556 | } else { |
| 562 | /* | 557 | /* |
| 563 | * Other errors. libata currently doesn't have any | 558 | * Other errors. libata currently doesn't have any |
| 564 | * mechanism to report these errors. Just turn on | 559 | * mechanism to report these errors. Just turn on |
| 565 | * ATA_ERR. | 560 | * ATA_ERR. |
| 566 | */ | 561 | */ |
| 567 | pp->tf.command = ATA_ERR; | 562 | err_mask = AC_ERR_OTHER; |
| 568 | } | 563 | } |
| 569 | 564 | ||
| 570 | if (qc) | 565 | if (qc) |
| 571 | ata_qc_complete(qc, pp->tf.command); | 566 | ata_qc_complete(qc, err_mask); |
| 572 | 567 | ||
| 573 | sil24_reset_controller(ap); | 568 | sil24_reset_controller(ap); |
| 574 | } | 569 | } |
| @@ -593,7 +588,7 @@ static inline void sil24_host_intr(struct ata_port *ap) | |||
| 593 | sil24_update_tf(ap); | 588 | sil24_update_tf(ap); |
| 594 | 589 | ||
| 595 | if (qc) | 590 | if (qc) |
| 596 | ata_qc_complete(qc, pp->tf.command); | 591 | ata_qc_complete(qc, ac_err_mask(pp->tf.command)); |
| 597 | } else | 592 | } else |
| 598 | sil24_error_intr(ap, slot_stat); | 593 | sil24_error_intr(ap, slot_stat); |
| 599 | } | 594 | } |
| @@ -696,7 +691,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 696 | int i, rc; | 691 | int i, rc; |
| 697 | 692 | ||
| 698 | if (!printed_version++) | 693 | if (!printed_version++) |
| 699 | printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); | 694 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); |
| 700 | 695 | ||
| 701 | rc = pci_enable_device(pdev); | 696 | rc = pci_enable_device(pdev); |
| 702 | if (rc) | 697 | if (rc) |
| @@ -756,14 +751,14 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 756 | */ | 751 | */ |
| 757 | rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); | 752 | rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); |
| 758 | if (rc) { | 753 | if (rc) { |
| 759 | printk(KERN_ERR DRV_NAME "(%s): 32-bit DMA enable failed\n", | 754 | dev_printk(KERN_ERR, &pdev->dev, |
| 760 | pci_name(pdev)); | 755 | "32-bit DMA enable failed\n"); |
| 761 | goto out_free; | 756 | goto out_free; |
| 762 | } | 757 | } |
| 763 | rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); | 758 | rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); |
| 764 | if (rc) { | 759 | if (rc) { |
| 765 | printk(KERN_ERR DRV_NAME "(%s): 32-bit consistent DMA enable failed\n", | 760 | dev_printk(KERN_ERR, &pdev->dev, |
| 766 | pci_name(pdev)); | 761 | "32-bit consistent DMA enable failed\n"); |
| 767 | goto out_free; | 762 | goto out_free; |
| 768 | } | 763 | } |
| 769 | 764 | ||
| @@ -799,9 +794,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 799 | break; | 794 | break; |
| 800 | } | 795 | } |
| 801 | if (tmp & PORT_CS_PORT_RST) | 796 | if (tmp & PORT_CS_PORT_RST) |
| 802 | printk(KERN_ERR DRV_NAME | 797 | dev_printk(KERN_ERR, &pdev->dev, |
| 803 | "(%s): failed to clear port RST\n", | 798 | "failed to clear port RST\n"); |
| 804 | pci_name(pdev)); | ||
| 805 | } | 799 | } |
| 806 | 800 | ||
| 807 | /* Zero error counters. */ | 801 | /* Zero error counters. */ |
| @@ -830,9 +824,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 830 | 824 | ||
| 831 | /* Reset itself */ | 825 | /* Reset itself */ |
| 832 | if (__sil24_reset_controller(port)) | 826 | if (__sil24_reset_controller(port)) |
| 833 | printk(KERN_ERR DRV_NAME | 827 | dev_printk(KERN_ERR, &pdev->dev, |
| 834 | "(%s): failed to reset controller\n", | 828 | "failed to reset controller\n"); |
| 835 | pci_name(pdev)); | ||
| 836 | } | 829 | } |
| 837 | 830 | ||
| 838 | /* Turn on interrupts */ | 831 | /* Turn on interrupts */ |
