aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_mv.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-06-25 09:02:59 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-08-01 19:46:48 -0400
commit752e386c247664152f2cce37915d1f50631d7f42 (patch)
tree790193f1320094acbf2584d5a890703ce8c6fb7e /drivers/ata/sata_mv.c
parentaf4d6e257dc36646bb62adececdd10ad83323788 (diff)
sata_fsl,mv,nv: prepare for NCQ command completion update
Make the following changes to prepare for NCQ command completion update. Changes made by this patch don't cause any functional difference. * sata_fsl_host_intr(): rename the local variable qc_active to done_mask as that's what it is. * mv_process_crpb_response(): restructure if clause for easier update. * nv_adma_interrupt(): drop unnecessary error variable. * nv_swncq_sdbfis(): drop unnecessary nr_done and return 0 on success. Typo fix. * nv_swncq_dmafis(): drop unused return value and return void. * nv_swncq_host_interrupt(): drop unnecessary return value handling. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Ashish Kalra <ashish.kalra@freescale.com> Cc: Saeed Bishara <saeed@marvell.com> Cc: Mark Lord <liml@rtr.ca> Cc: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r--drivers/ata/sata_mv.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index a476cd99b95d..9463c71dd38e 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2716,34 +2716,35 @@ static void mv_err_intr(struct ata_port *ap)
2716static void mv_process_crpb_response(struct ata_port *ap, 2716static void mv_process_crpb_response(struct ata_port *ap,
2717 struct mv_crpb *response, unsigned int tag, int ncq_enabled) 2717 struct mv_crpb *response, unsigned int tag, int ncq_enabled)
2718{ 2718{
2719 u8 ata_status;
2720 u16 edma_status = le16_to_cpu(response->flags);
2719 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag); 2721 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag);
2720 2722
2721 if (qc) { 2723 if (unlikely(!qc)) {
2722 u8 ata_status;
2723 u16 edma_status = le16_to_cpu(response->flags);
2724 /*
2725 * edma_status from a response queue entry:
2726 * LSB is from EDMA_ERR_IRQ_CAUSE (non-NCQ only).
2727 * MSB is saved ATA status from command completion.
2728 */
2729 if (!ncq_enabled) {
2730 u8 err_cause = edma_status & 0xff & ~EDMA_ERR_DEV;
2731 if (err_cause) {
2732 /*
2733 * Error will be seen/handled by mv_err_intr().
2734 * So do nothing at all here.
2735 */
2736 return;
2737 }
2738 }
2739 ata_status = edma_status >> CRPB_FLAG_STATUS_SHIFT;
2740 if (!ac_err_mask(ata_status))
2741 ata_qc_complete(qc);
2742 /* else: leave it for mv_err_intr() */
2743 } else {
2744 ata_port_printk(ap, KERN_ERR, "%s: no qc for tag=%d\n", 2724 ata_port_printk(ap, KERN_ERR, "%s: no qc for tag=%d\n",
2745 __func__, tag); 2725 __func__, tag);
2726 return;
2727 }
2728
2729 /*
2730 * edma_status from a response queue entry:
2731 * LSB is from EDMA_ERR_IRQ_CAUSE (non-NCQ only).
2732 * MSB is saved ATA status from command completion.
2733 */
2734 if (!ncq_enabled) {
2735 u8 err_cause = edma_status & 0xff & ~EDMA_ERR_DEV;
2736 if (err_cause) {
2737 /*
2738 * Error will be seen/handled by
2739 * mv_err_intr(). So do nothing at all here.
2740 */
2741 return;
2742 }
2746 } 2743 }
2744 ata_status = edma_status >> CRPB_FLAG_STATUS_SHIFT;
2745 if (!ac_err_mask(ata_status))
2746 ata_qc_complete(qc);
2747 /* else: leave it for mv_err_intr() */
2747} 2748}
2748 2749
2749static void mv_process_crpb_entries(struct ata_port *ap, struct mv_port_priv *pp) 2750static void mv_process_crpb_entries(struct ata_port *ap, struct mv_port_priv *pp)