aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-04-07 09:47:20 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:23 -0400
commit79f97dadfe9b4b561634d202225ba2fa910dc225 (patch)
tree7bea39a135c7c87b7430d6c071288a05990b9309
parent22183bf569c8600ff414ac25f23134044e0ef453 (diff)
libata: drop @finish_qc from ata_qc_complete_multiple()
ata_qc_complete_multiple() took @finish_qc and called it on every qc before completing it. This was to give opportunity to update TF cache before ata_qc_complete() tries to fill result_tf. Now that result TF is a separate operation, this is no longer necessary. Update sata_sil24, which was the only user of this mechanism, such that it implements its own ops->qc_fill_rtf() and drop @finish_qc from ata_qc_complete_multiple(). Signed-off-by: Tejun Heo <htejun@gmail.com>
-rw-r--r--drivers/ata/ahci.c2
-rw-r--r--drivers/ata/libata-core.c6
-rw-r--r--drivers/ata/sata_sil24.c19
-rw-r--r--include/linux/libata.h3
4 files changed, 12 insertions, 18 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 3071a2341be3..1389c64e0027 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1696,7 +1696,7 @@ static void ahci_port_intr(struct ata_port *ap)
1696 else 1696 else
1697 qc_active = readl(port_mmio + PORT_CMD_ISSUE); 1697 qc_active = readl(port_mmio + PORT_CMD_ISSUE);
1698 1698
1699 rc = ata_qc_complete_multiple(ap, qc_active, NULL); 1699 rc = ata_qc_complete_multiple(ap, qc_active);
1700 1700
1701 /* while resetting, invalid completions are expected */ 1701 /* while resetting, invalid completions are expected */
1702 if (unlikely(rc < 0 && !resetting)) { 1702 if (unlikely(rc < 0 && !resetting)) {
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3b822124e97e..dcc5a28e26c1 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4673,7 +4673,6 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
4673 * ata_qc_complete_multiple - Complete multiple qcs successfully 4673 * ata_qc_complete_multiple - Complete multiple qcs successfully
4674 * @ap: port in question 4674 * @ap: port in question
4675 * @qc_active: new qc_active mask 4675 * @qc_active: new qc_active mask
4676 * @finish_qc: LLDD callback invoked before completing a qc
4677 * 4676 *
4678 * Complete in-flight commands. This functions is meant to be 4677 * Complete in-flight commands. This functions is meant to be
4679 * called from low-level driver's interrupt routine to complete 4678 * called from low-level driver's interrupt routine to complete
@@ -4686,8 +4685,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
4686 * RETURNS: 4685 * RETURNS:
4687 * Number of completed commands on success, -errno otherwise. 4686 * Number of completed commands on success, -errno otherwise.
4688 */ 4687 */
4689int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active, 4688int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active)
4690 void (*finish_qc)(struct ata_queued_cmd *))
4691{ 4689{
4692 int nr_done = 0; 4690 int nr_done = 0;
4693 u32 done_mask; 4691 u32 done_mask;
@@ -4708,8 +4706,6 @@ int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active,
4708 continue; 4706 continue;
4709 4707
4710 if ((qc = ata_qc_from_tag(ap, i))) { 4708 if ((qc = ata_qc_from_tag(ap, i))) {
4711 if (finish_qc)
4712 finish_qc(qc);
4713 ata_qc_complete(qc); 4709 ata_qc_complete(qc);
4714 nr_done++; 4710 nr_done++;
4715 } 4711 }
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index fc9d48cd8122..79952f825b40 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -348,6 +348,7 @@ static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
348static int sil24_qc_defer(struct ata_queued_cmd *qc); 348static int sil24_qc_defer(struct ata_queued_cmd *qc);
349static void sil24_qc_prep(struct ata_queued_cmd *qc); 349static void sil24_qc_prep(struct ata_queued_cmd *qc);
350static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc); 350static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc);
351static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc);
351static void sil24_pmp_attach(struct ata_port *ap); 352static void sil24_pmp_attach(struct ata_port *ap);
352static void sil24_pmp_detach(struct ata_port *ap); 353static void sil24_pmp_detach(struct ata_port *ap);
353static void sil24_freeze(struct ata_port *ap); 354static void sil24_freeze(struct ata_port *ap);
@@ -407,6 +408,7 @@ static struct ata_port_operations sil24_ops = {
407 .qc_defer = sil24_qc_defer, 408 .qc_defer = sil24_qc_defer,
408 .qc_prep = sil24_qc_prep, 409 .qc_prep = sil24_qc_prep,
409 .qc_issue = sil24_qc_issue, 410 .qc_issue = sil24_qc_issue,
411 .qc_fill_rtf = sil24_qc_fill_rtf,
410 412
411 .freeze = sil24_freeze, 413 .freeze = sil24_freeze,
412 .thaw = sil24_thaw, 414 .thaw = sil24_thaw,
@@ -914,6 +916,12 @@ static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc)
914 return 0; 916 return 0;
915} 917}
916 918
919static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc)
920{
921 sil24_read_tf(qc->ap, qc->tag, &qc->result_tf);
922 return true;
923}
924
917static void sil24_pmp_attach(struct ata_port *ap) 925static void sil24_pmp_attach(struct ata_port *ap)
918{ 926{
919 sil24_config_pmp(ap, 1); 927 sil24_config_pmp(ap, 1);
@@ -1098,15 +1106,6 @@ static void sil24_error_intr(struct ata_port *ap)
1098 } 1106 }
1099} 1107}
1100 1108
1101static void sil24_finish_qc(struct ata_queued_cmd *qc)
1102{
1103 struct ata_port *ap = qc->ap;
1104 struct sil24_port_priv *pp = ap->private_data;
1105
1106 if (qc->flags & ATA_QCFLAG_RESULT_TF)
1107 sil24_read_tf(ap, qc->tag, &pp->tf);
1108}
1109
1110static inline void sil24_host_intr(struct ata_port *ap) 1109static inline void sil24_host_intr(struct ata_port *ap)
1111{ 1110{
1112 void __iomem *port = ap->ioaddr.cmd_addr; 1111 void __iomem *port = ap->ioaddr.cmd_addr;
@@ -1131,7 +1130,7 @@ static inline void sil24_host_intr(struct ata_port *ap)
1131 } 1130 }
1132 1131
1133 qc_active = slot_stat & ~HOST_SSTAT_ATTN; 1132 qc_active = slot_stat & ~HOST_SSTAT_ATTN;
1134 rc = ata_qc_complete_multiple(ap, qc_active, sil24_finish_qc); 1133 rc = ata_qc_complete_multiple(ap, qc_active);
1135 if (rc > 0) 1134 if (rc > 0)
1136 return; 1135 return;
1137 if (rc < 0) { 1136 if (rc < 0) {
diff --git a/include/linux/libata.h b/include/linux/libata.h
index bb4200d42f0d..1d8b6b7de0a2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -924,8 +924,7 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
924extern void ata_id_c_string(const u16 *id, unsigned char *s, 924extern void ata_id_c_string(const u16 *id, unsigned char *s,
925 unsigned int ofs, unsigned int len); 925 unsigned int ofs, unsigned int len);
926extern void ata_qc_complete(struct ata_queued_cmd *qc); 926extern void ata_qc_complete(struct ata_queued_cmd *qc);
927extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active, 927extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active);
928 void (*finish_qc)(struct ata_queued_cmd *));
929extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, 928extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
930 void (*done)(struct scsi_cmnd *)); 929 void (*done)(struct scsi_cmnd *));
931extern int ata_std_bios_param(struct scsi_device *sdev, 930extern int ata_std_bios_param(struct scsi_device *sdev,