diff options
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r-- | drivers/ata/sata_mv.c | 47 |
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) | |||
2716 | static void mv_process_crpb_response(struct ata_port *ap, | 2716 | static 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 | ||
2749 | static void mv_process_crpb_entries(struct ata_port *ap, struct mv_port_priv *pp) | 2750 | static void mv_process_crpb_entries(struct ata_port *ap, struct mv_port_priv *pp) |