From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-ide@vger.kernel.org, Forrest Zhao <forrest.zhao@gmail.com>
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 05/15] sata_sil24: replace sil24_update_tf() with sil24_read_tf()
Date: Sun, 1 Jul 2007 19:54:15 +0900 [thread overview]
Message-ID: <11832872543545-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <1183287253677-git-send-email-htejun@gmail.com>
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>
---
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 e2a41ff..65dbfd4 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -468,15 +468,15 @@ static void sil24_dev_config(struct ata_device *dev)
writel(PORT_CS_CDB16, port + PORT_CTRL_CLR);
}
-static inline void sil24_update_tf(struct ata_port *ap)
+static void sil24_read_tf(struct ata_port *ap, int tag, struct ata_taskfile *tf)
{
- struct sil24_port_priv *pp = ap->private_data;
void __iomem *port = ap->ioaddr.cmd_addr;
- struct sil24_prb __iomem *prb = port;
+ struct sil24_prb __iomem *prb;
u8 fis[6 * 4];
- memcpy_fromio(fis, prb->fis, 6 * 4);
- ata_tf_from_fis(fis, &pp->tf);
+ prb = port + PORT_LRAM + sil24_tag(tag) * PORT_LRAM_SLOT_SZ;
+ memcpy_fromio(fis, prb->fis, sizeof(fis));
+ ata_tf_from_fis(fis, tf);
}
static u8 sil24_check_status(struct ata_port *ap)
@@ -548,6 +548,7 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class,
struct sil24_port_priv *pp = ap->private_data;
struct sil24_prb *prb = &pp->cmd_block[0].ata.prb;
dma_addr_t paddr = pp->cmd_block_dma;
+ struct ata_taskfile tf;
u32 mask, irq_stat;
const char *reason;
@@ -587,8 +588,8 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class,
goto err;
}
- sil24_update_tf(ap);
- *class = ata_dev_classify(&pp->tf);
+ sil24_read_tf(ap, 0, &tf);
+ *class = ata_dev_classify(&tf);
if (*class == ATA_DEV_UNKNOWN)
*class = ATA_DEV_NONE;
@@ -765,6 +766,7 @@ static void sil24_thaw(struct ata_port *ap)
static void sil24_error_intr(struct ata_port *ap)
{
void __iomem *port = ap->ioaddr.cmd_addr;
+ struct sil24_port_priv *pp = ap->private_data;
struct ata_eh_info *ehi = &ap->link.eh_info;
int freeze = 0;
u32 irq_stat;
@@ -819,7 +821,7 @@ static void sil24_error_intr(struct ata_port *ap)
/* record error info */
qc = ata_qc_from_tag(ap, ap->link.active_tag);
if (qc) {
- sil24_update_tf(ap);
+ sil24_read_tf(ap, qc->tag, &pp->tf);
qc->err_mask |= err_mask;
} else
ehi->err_mask |= err_mask;
@@ -836,8 +838,11 @@ static void sil24_error_intr(struct ata_port *ap)
static void sil24_finish_qc(struct ata_queued_cmd *qc)
{
+ struct ata_port *ap = qc->ap;
+ struct sil24_port_priv *pp = ap->private_data;
+
if (qc->flags & ATA_QCFLAG_RESULT_TF)
- sil24_update_tf(qc->ap);
+ sil24_read_tf(ap, qc->tag, &pp->tf);
}
static inline void sil24_host_intr(struct ata_port *ap)
--
1.5.0.3
next prev parent reply other threads:[~2007-07-01 10:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-01 10:54 [PATCHSET 4/4] implement PMP support, take 4 Tejun Heo
2007-07-01 10:54 ` [PATCH 01/15] libata-pmp: update ata_eh_reset() for PMP Tejun Heo
2007-07-01 10:54 ` [PATCH 02/15] libata-pmp: implement Port Multiplier support Tejun Heo
2007-07-01 10:54 ` [PATCH 03/15] libata-pmp: hook PMP support and enable it Tejun Heo
2007-07-01 10:54 ` [PATCH 04/15] libata-pmp: extend ACPI support to cover PMP Tejun Heo
2007-07-12 20:24 ` Jeff Garzik
2007-07-13 3:05 ` Tejun Heo
2007-07-01 10:54 ` [PATCH 09/15] sata_sil24: implement PORT_RST Tejun Heo
2007-07-01 10:54 ` [PATCH 07/15] sata_sil24: separate out sil24_do_softreset() Tejun Heo
2007-07-12 20:26 ` Jeff Garzik
2007-07-01 10:54 ` [PATCH 06/15] sata_sil24: separate out sil24_exec_polled_cmd() Tejun Heo
2007-07-12 20:25 ` Jeff Garzik
2007-07-13 3:06 ` Tejun Heo
2007-07-01 10:54 ` [PATCH 08/15] sata_sil24: implement PMP support Tejun Heo
2007-07-01 10:54 ` Tejun Heo [this message]
2007-07-01 10:54 ` [PATCH 14/15] ahci: separate out ahci_do_softreset() Tejun Heo
2007-07-12 20:26 ` Jeff Garzik
2007-07-01 10:54 ` [PATCH 10/15] libata-pmp: implement qc_defer for command switching PMP support Tejun Heo
2007-07-01 10:54 ` [PATCH 11/15] ahci: use deadline instead of fixed timeout for 1st FIS for SRST Tejun Heo
2007-07-01 10:54 ` [PATCH 12/15] ahci: separate out ahci_kick_engine() Tejun Heo
2007-07-12 20:26 ` Jeff Garzik
2007-07-01 10:54 ` [PATCH 13/15] ahci: separate out ahci_exec_polled_cmd() Tejun Heo
2007-07-12 20:26 ` Jeff Garzik
2007-07-01 10:54 ` [PATCH 15/15] ahci: implement PMP support Tejun Heo
2007-07-03 7:39 ` [PATCHSET 4/4] implement PMP support, take 4 Jim Paris
2007-07-03 9:34 ` Tejun Heo
2007-07-03 19:40 ` Jim Paris
2007-07-12 20:27 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11832872543545-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=forrest.zhao@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).