diff options
author | Tejun Heo <htejun@gmail.com> | 2007-07-16 01:29:39 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-20 08:02:10 -0400 |
commit | e59f0dad33176a13803ff8a41cc639a06c43d381 (patch) | |
tree | 3828b0d6b6bd2fd959c70aad338c17f7c0b178e0 /drivers/ata/sata_sil24.c | |
parent | a9cf5e858100b2f82ad61028c26a1a3de11c4839 (diff) |
sata_sil24: replace sil24_update_tf() with sil24_read_tf()
Replace sil24_update_tf() to sil24_read_tf() which reads TF into
passed int result TF argument and can read TFs of PMP links. This
will be used by PMP support.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/sata_sil24.c')
-rw-r--r-- | drivers/ata/sata_sil24.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index a11007b5071e..5f8afa950043 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -464,15 +464,15 @@ static void sil24_dev_config(struct ata_device *dev) | |||
464 | writel(PORT_CS_CDB16, port + PORT_CTRL_CLR); | 464 | writel(PORT_CS_CDB16, port + PORT_CTRL_CLR); |
465 | } | 465 | } |
466 | 466 | ||
467 | static inline void sil24_update_tf(struct ata_port *ap) | 467 | static void sil24_read_tf(struct ata_port *ap, int tag, struct ata_taskfile *tf) |
468 | { | 468 | { |
469 | struct sil24_port_priv *pp = ap->private_data; | ||
470 | void __iomem *port = ap->ioaddr.cmd_addr; | 469 | void __iomem *port = ap->ioaddr.cmd_addr; |
471 | struct sil24_prb __iomem *prb = port; | 470 | struct sil24_prb __iomem *prb; |
472 | u8 fis[6 * 4]; | 471 | u8 fis[6 * 4]; |
473 | 472 | ||
474 | memcpy_fromio(fis, prb->fis, 6 * 4); | 473 | prb = port + PORT_LRAM + sil24_tag(tag) * PORT_LRAM_SLOT_SZ; |
475 | ata_tf_from_fis(fis, &pp->tf); | 474 | memcpy_fromio(fis, prb->fis, sizeof(fis)); |
475 | ata_tf_from_fis(fis, tf); | ||
476 | } | 476 | } |
477 | 477 | ||
478 | static u8 sil24_check_status(struct ata_port *ap) | 478 | static u8 sil24_check_status(struct ata_port *ap) |
@@ -538,6 +538,7 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class, | |||
538 | struct sil24_port_priv *pp = ap->private_data; | 538 | struct sil24_port_priv *pp = ap->private_data; |
539 | struct sil24_prb *prb = &pp->cmd_block[0].ata.prb; | 539 | struct sil24_prb *prb = &pp->cmd_block[0].ata.prb; |
540 | dma_addr_t paddr = pp->cmd_block_dma; | 540 | dma_addr_t paddr = pp->cmd_block_dma; |
541 | struct ata_taskfile tf; | ||
541 | u32 mask, irq_stat; | 542 | u32 mask, irq_stat; |
542 | const char *reason; | 543 | const char *reason; |
543 | 544 | ||
@@ -577,8 +578,8 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class, | |||
577 | goto err; | 578 | goto err; |
578 | } | 579 | } |
579 | 580 | ||
580 | sil24_update_tf(ap); | 581 | sil24_read_tf(ap, 0, &tf); |
581 | *class = ata_dev_classify(&pp->tf); | 582 | *class = ata_dev_classify(&tf); |
582 | 583 | ||
583 | if (*class == ATA_DEV_UNKNOWN) | 584 | if (*class == ATA_DEV_UNKNOWN) |
584 | *class = ATA_DEV_NONE; | 585 | *class = ATA_DEV_NONE; |
@@ -754,6 +755,7 @@ static void sil24_thaw(struct ata_port *ap) | |||
754 | static void sil24_error_intr(struct ata_port *ap) | 755 | static void sil24_error_intr(struct ata_port *ap) |
755 | { | 756 | { |
756 | void __iomem *port = ap->ioaddr.cmd_addr; | 757 | void __iomem *port = ap->ioaddr.cmd_addr; |
758 | struct sil24_port_priv *pp = ap->private_data; | ||
757 | struct ata_eh_info *ehi = &ap->eh_info; | 759 | struct ata_eh_info *ehi = &ap->eh_info; |
758 | int freeze = 0; | 760 | int freeze = 0; |
759 | u32 irq_stat; | 761 | u32 irq_stat; |
@@ -808,7 +810,7 @@ static void sil24_error_intr(struct ata_port *ap) | |||
808 | /* record error info */ | 810 | /* record error info */ |
809 | qc = ata_qc_from_tag(ap, ap->active_tag); | 811 | qc = ata_qc_from_tag(ap, ap->active_tag); |
810 | if (qc) { | 812 | if (qc) { |
811 | sil24_update_tf(ap); | 813 | sil24_read_tf(ap, qc->tag, &pp->tf); |
812 | qc->err_mask |= err_mask; | 814 | qc->err_mask |= err_mask; |
813 | } else | 815 | } else |
814 | ehi->err_mask |= err_mask; | 816 | ehi->err_mask |= err_mask; |
@@ -825,8 +827,11 @@ static void sil24_error_intr(struct ata_port *ap) | |||
825 | 827 | ||
826 | static void sil24_finish_qc(struct ata_queued_cmd *qc) | 828 | static void sil24_finish_qc(struct ata_queued_cmd *qc) |
827 | { | 829 | { |
830 | struct ata_port *ap = qc->ap; | ||
831 | struct sil24_port_priv *pp = ap->private_data; | ||
832 | |||
828 | if (qc->flags & ATA_QCFLAG_RESULT_TF) | 833 | if (qc->flags & ATA_QCFLAG_RESULT_TF) |
829 | sil24_update_tf(qc->ap); | 834 | sil24_read_tf(ap, qc->tag, &pp->tf); |
830 | } | 835 | } |
831 | 836 | ||
832 | static inline void sil24_host_intr(struct ata_port *ap) | 837 | static inline void sil24_host_intr(struct ata_port *ap) |