diff options
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci.h | 1 | ||||
-rw-r--r-- | drivers/ata/libahci.c | 18 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 5 | ||||
-rw-r--r-- | drivers/ata/libata-sff.c | 7 | ||||
-rw-r--r-- | drivers/ata/pata_mpc52xx.c | 2 | ||||
-rw-r--r-- | drivers/ata/sata_via.c | 9 |
6 files changed, 29 insertions, 13 deletions
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index e5fdeebf9ef0..d1a0f5bfdfeb 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h | |||
@@ -72,6 +72,7 @@ enum { | |||
72 | AHCI_CMD_RESET = (1 << 8), | 72 | AHCI_CMD_RESET = (1 << 8), |
73 | AHCI_CMD_CLR_BUSY = (1 << 10), | 73 | AHCI_CMD_CLR_BUSY = (1 << 10), |
74 | 74 | ||
75 | RX_FIS_PIO_SETUP = 0x20, /* offset of PIO Setup FIS data */ | ||
75 | RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */ | 76 | RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */ |
76 | RX_FIS_SDB = 0x58, /* offset of SDB FIS data */ | 77 | RX_FIS_SDB = 0x58, /* offset of SDB FIS data */ |
77 | RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */ | 78 | RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */ |
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 8eea309ea212..137514dbbf65 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -1830,12 +1830,24 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) | |||
1830 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) | 1830 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) |
1831 | { | 1831 | { |
1832 | struct ahci_port_priv *pp = qc->ap->private_data; | 1832 | struct ahci_port_priv *pp = qc->ap->private_data; |
1833 | u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; | 1833 | u8 *rx_fis = pp->rx_fis; |
1834 | 1834 | ||
1835 | if (pp->fbs_enabled) | 1835 | if (pp->fbs_enabled) |
1836 | d2h_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ; | 1836 | rx_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ; |
1837 | |||
1838 | /* | ||
1839 | * After a successful execution of an ATA PIO data-in command, | ||
1840 | * the device doesn't send D2H Reg FIS to update the TF and | ||
1841 | * the host should take TF and E_Status from the preceding PIO | ||
1842 | * Setup FIS. | ||
1843 | */ | ||
1844 | if (qc->tf.protocol == ATA_PROT_PIO && qc->dma_dir == DMA_FROM_DEVICE && | ||
1845 | !(qc->flags & ATA_QCFLAG_FAILED)) { | ||
1846 | ata_tf_from_fis(rx_fis + RX_FIS_PIO_SETUP, &qc->result_tf); | ||
1847 | qc->result_tf.command = (rx_fis + RX_FIS_PIO_SETUP)[15]; | ||
1848 | } else | ||
1849 | ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf); | ||
1837 | 1850 | ||
1838 | ata_tf_from_fis(d2h_fis, &qc->result_tf); | ||
1839 | return true; | 1851 | return true; |
1840 | } | 1852 | } |
1841 | 1853 | ||
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index a89172c100f5..7bb6787de550 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2577,8 +2577,11 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) | |||
2577 | * | 2577 | * |
2578 | * If door lock fails, always clear sdev->locked to | 2578 | * If door lock fails, always clear sdev->locked to |
2579 | * avoid this infinite loop. | 2579 | * avoid this infinite loop. |
2580 | * | ||
2581 | * This may happen before SCSI scan is complete. Make | ||
2582 | * sure qc->dev->sdev isn't NULL before dereferencing. | ||
2580 | */ | 2583 | */ |
2581 | if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL) | 2584 | if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev) |
2582 | qc->dev->sdev->locked = 0; | 2585 | qc->dev->sdev->locked = 0; |
2583 | 2586 | ||
2584 | qc->scsicmd->result = SAM_STAT_CHECK_CONDITION; | 2587 | qc->scsicmd->result = SAM_STAT_CHECK_CONDITION; |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index e30c537cce32..c55988b4f900 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1532,11 +1532,10 @@ static unsigned int __ata_sff_port_intr(struct ata_port *ap, | |||
1532 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) | 1532 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) |
1533 | return ata_sff_idle_irq(ap); | 1533 | return ata_sff_idle_irq(ap); |
1534 | break; | 1534 | break; |
1535 | case HSM_ST: | 1535 | case HSM_ST_IDLE: |
1536 | case HSM_ST_LAST: | ||
1537 | break; | ||
1538 | default: | ||
1539 | return ata_sff_idle_irq(ap); | 1536 | return ata_sff_idle_irq(ap); |
1537 | default: | ||
1538 | break; | ||
1540 | } | 1539 | } |
1541 | 1540 | ||
1542 | /* check main status, clearing INTRQ if needed */ | 1541 | /* check main status, clearing INTRQ if needed */ |
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index 8cc536e49a0a..d7d8026cde99 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c | |||
@@ -610,7 +610,7 @@ static struct scsi_host_template mpc52xx_ata_sht = { | |||
610 | }; | 610 | }; |
611 | 611 | ||
612 | static struct ata_port_operations mpc52xx_ata_port_ops = { | 612 | static struct ata_port_operations mpc52xx_ata_port_ops = { |
613 | .inherits = &ata_sff_port_ops, | 613 | .inherits = &ata_bmdma_port_ops, |
614 | .sff_dev_select = mpc52xx_ata_dev_select, | 614 | .sff_dev_select = mpc52xx_ata_dev_select, |
615 | .set_piomode = mpc52xx_ata_set_piomode, | 615 | .set_piomode = mpc52xx_ata_set_piomode, |
616 | .set_dmamode = mpc52xx_ata_set_dmamode, | 616 | .set_dmamode = mpc52xx_ata_set_dmamode, |
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index 4730c42a5ee5..c51b8d25cfa8 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -538,7 +538,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) | |||
538 | return 0; | 538 | return 0; |
539 | } | 539 | } |
540 | 540 | ||
541 | static void svia_configure(struct pci_dev *pdev) | 541 | static void svia_configure(struct pci_dev *pdev, int board_id) |
542 | { | 542 | { |
543 | u8 tmp8; | 543 | u8 tmp8; |
544 | 544 | ||
@@ -577,7 +577,7 @@ static void svia_configure(struct pci_dev *pdev) | |||
577 | } | 577 | } |
578 | 578 | ||
579 | /* | 579 | /* |
580 | * vt6421 has problems talking to some drives. The following | 580 | * vt6420/1 has problems talking to some drives. The following |
581 | * is the fix from Joseph Chan <JosephChan@via.com.tw>. | 581 | * is the fix from Joseph Chan <JosephChan@via.com.tw>. |
582 | * | 582 | * |
583 | * When host issues HOLD, device may send up to 20DW of data | 583 | * When host issues HOLD, device may send up to 20DW of data |
@@ -596,8 +596,9 @@ static void svia_configure(struct pci_dev *pdev) | |||
596 | * | 596 | * |
597 | * https://bugzilla.kernel.org/show_bug.cgi?id=15173 | 597 | * https://bugzilla.kernel.org/show_bug.cgi?id=15173 |
598 | * http://article.gmane.org/gmane.linux.ide/46352 | 598 | * http://article.gmane.org/gmane.linux.ide/46352 |
599 | * http://thread.gmane.org/gmane.linux.kernel/1062139 | ||
599 | */ | 600 | */ |
600 | if (pdev->device == 0x3249) { | 601 | if (board_id == vt6420 || board_id == vt6421) { |
601 | pci_read_config_byte(pdev, 0x52, &tmp8); | 602 | pci_read_config_byte(pdev, 0x52, &tmp8); |
602 | tmp8 |= 1 << 2; | 603 | tmp8 |= 1 << 2; |
603 | pci_write_config_byte(pdev, 0x52, tmp8); | 604 | pci_write_config_byte(pdev, 0x52, tmp8); |
@@ -652,7 +653,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
652 | if (rc) | 653 | if (rc) |
653 | return rc; | 654 | return rc; |
654 | 655 | ||
655 | svia_configure(pdev); | 656 | svia_configure(pdev, board_id); |
656 | 657 | ||
657 | pci_set_master(pdev); | 658 | pci_set_master(pdev); |
658 | return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, | 659 | return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, |