diff options
Diffstat (limited to 'drivers/scsi/sata_sx4.c')
-rw-r--r-- | drivers/scsi/sata_sx4.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index bc87c16c80d2..9f8a76815402 100644 --- a/drivers/scsi/sata_sx4.c +++ b/drivers/scsi/sata_sx4.c | |||
@@ -174,7 +174,7 @@ static void pdc20621_get_from_dimm(struct ata_probe_ent *pe, | |||
174 | static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, | 174 | static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, |
175 | void *psource, u32 offset, u32 size); | 175 | void *psource, u32 offset, u32 size); |
176 | static void pdc20621_irq_clear(struct ata_port *ap); | 176 | static void pdc20621_irq_clear(struct ata_port *ap); |
177 | static int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc); | 177 | static unsigned int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc); |
178 | 178 | ||
179 | 179 | ||
180 | static struct scsi_host_template pdc_sata_sht = { | 180 | static struct scsi_host_template pdc_sata_sht = { |
@@ -182,11 +182,11 @@ static struct scsi_host_template pdc_sata_sht = { | |||
182 | .name = DRV_NAME, | 182 | .name = DRV_NAME, |
183 | .ioctl = ata_scsi_ioctl, | 183 | .ioctl = ata_scsi_ioctl, |
184 | .queuecommand = ata_scsi_queuecmd, | 184 | .queuecommand = ata_scsi_queuecmd, |
185 | .eh_timed_out = ata_scsi_timed_out, | ||
185 | .eh_strategy_handler = ata_scsi_error, | 186 | .eh_strategy_handler = ata_scsi_error, |
186 | .can_queue = ATA_DEF_QUEUE, | 187 | .can_queue = ATA_DEF_QUEUE, |
187 | .this_id = ATA_SHT_THIS_ID, | 188 | .this_id = ATA_SHT_THIS_ID, |
188 | .sg_tablesize = LIBATA_MAX_PRD, | 189 | .sg_tablesize = LIBATA_MAX_PRD, |
189 | .max_sectors = ATA_MAX_SECTORS, | ||
190 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | 190 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, |
191 | .emulated = ATA_SHT_EMULATED, | 191 | .emulated = ATA_SHT_EMULATED, |
192 | .use_clustering = ATA_SHT_USE_CLUSTERING, | 192 | .use_clustering = ATA_SHT_USE_CLUSTERING, |
@@ -460,7 +460,7 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc) | |||
460 | unsigned int i, idx, total_len = 0, sgt_len; | 460 | unsigned int i, idx, total_len = 0, sgt_len; |
461 | u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; | 461 | u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; |
462 | 462 | ||
463 | assert(qc->flags & ATA_QCFLAG_DMAMAP); | 463 | WARN_ON(!(qc->flags & ATA_QCFLAG_DMAMAP)); |
464 | 464 | ||
465 | VPRINTK("ata%u: ENTER\n", ap->id); | 465 | VPRINTK("ata%u: ENTER\n", ap->id); |
466 | 466 | ||
@@ -678,7 +678,7 @@ static void pdc20621_packet_start(struct ata_queued_cmd *qc) | |||
678 | } | 678 | } |
679 | } | 679 | } |
680 | 680 | ||
681 | static int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc) | 681 | static unsigned int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc) |
682 | { | 682 | { |
683 | switch (qc->tf.protocol) { | 683 | switch (qc->tf.protocol) { |
684 | case ATA_PROT_DMA: | 684 | case ATA_PROT_DMA: |
@@ -866,26 +866,12 @@ static void pdc_eng_timeout(struct ata_port *ap) | |||
866 | spin_lock_irqsave(&host_set->lock, flags); | 866 | spin_lock_irqsave(&host_set->lock, flags); |
867 | 867 | ||
868 | qc = ata_qc_from_tag(ap, ap->active_tag); | 868 | qc = ata_qc_from_tag(ap, ap->active_tag); |
869 | if (!qc) { | ||
870 | printk(KERN_ERR "ata%u: BUG: timeout without command\n", | ||
871 | ap->id); | ||
872 | goto out; | ||
873 | } | ||
874 | |||
875 | /* hack alert! We cannot use the supplied completion | ||
876 | * function from inside the ->eh_strategy_handler() thread. | ||
877 | * libata is the only user of ->eh_strategy_handler() in | ||
878 | * any kernel, so the default scsi_done() assumes it is | ||
879 | * not being called from the SCSI EH. | ||
880 | */ | ||
881 | qc->scsidone = scsi_finish_command; | ||
882 | 869 | ||
883 | switch (qc->tf.protocol) { | 870 | switch (qc->tf.protocol) { |
884 | case ATA_PROT_DMA: | 871 | case ATA_PROT_DMA: |
885 | case ATA_PROT_NODATA: | 872 | case ATA_PROT_NODATA: |
886 | printk(KERN_ERR "ata%u: command timeout\n", ap->id); | 873 | printk(KERN_ERR "ata%u: command timeout\n", ap->id); |
887 | qc->err_mask |= __ac_err_mask(ata_wait_idle(ap)); | 874 | qc->err_mask |= __ac_err_mask(ata_wait_idle(ap)); |
888 | ata_qc_complete(qc); | ||
889 | break; | 875 | break; |
890 | 876 | ||
891 | default: | 877 | default: |
@@ -895,12 +881,11 @@ static void pdc_eng_timeout(struct ata_port *ap) | |||
895 | ap->id, qc->tf.command, drv_stat); | 881 | ap->id, qc->tf.command, drv_stat); |
896 | 882 | ||
897 | qc->err_mask |= ac_err_mask(drv_stat); | 883 | qc->err_mask |= ac_err_mask(drv_stat); |
898 | ata_qc_complete(qc); | ||
899 | break; | 884 | break; |
900 | } | 885 | } |
901 | 886 | ||
902 | out: | ||
903 | spin_unlock_irqrestore(&host_set->lock, flags); | 887 | spin_unlock_irqrestore(&host_set->lock, flags); |
888 | ata_eh_qc_complete(qc); | ||
904 | DPRINTK("EXIT\n"); | 889 | DPRINTK("EXIT\n"); |
905 | } | 890 | } |
906 | 891 | ||