aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/sata_promise.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 9d73cb9de42a..551644a94861 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -448,7 +448,7 @@ static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg,
448 writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4)); 448 writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
449} 449}
450 450
451static void pdc_atapi_dma_pkt(struct ata_queued_cmd *qc) 451static void pdc_atapi_pkt(struct ata_queued_cmd *qc)
452{ 452{
453 struct ata_port *ap = qc->ap; 453 struct ata_port *ap = qc->ap;
454 dma_addr_t sg_table = ap->prd_dma; 454 dma_addr_t sg_table = ap->prd_dma;
@@ -462,10 +462,20 @@ static void pdc_atapi_dma_pkt(struct ata_queued_cmd *qc)
462 /* set control bits (byte 0), zero delay seq id (byte 3), 462 /* set control bits (byte 0), zero delay seq id (byte 3),
463 * and seq id (byte 2) 463 * and seq id (byte 2)
464 */ 464 */
465 if (!(qc->tf.flags & ATA_TFLAG_WRITE)) 465 switch (qc->tf.protocol) {
466 buf32[0] = cpu_to_le32(PDC_PKT_READ); 466 case ATA_PROT_ATAPI_DMA:
467 else 467 if (!(qc->tf.flags & ATA_TFLAG_WRITE))
468 buf32[0] = 0; 468 buf32[0] = cpu_to_le32(PDC_PKT_READ);
469 else
470 buf32[0] = 0;
471 break;
472 case ATA_PROT_ATAPI_NODATA:
473 buf32[0] = cpu_to_le32(PDC_PKT_NODATA);
474 break;
475 default:
476 BUG();
477 break;
478 }
469 buf32[1] = cpu_to_le32(sg_table); /* S/G table addr */ 479 buf32[1] = cpu_to_le32(sg_table); /* S/G table addr */
470 buf32[2] = 0; /* no next-packet */ 480 buf32[2] = 0; /* no next-packet */
471 481
@@ -549,13 +559,14 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc)
549 break; 559 break;
550 560
551 case ATA_PROT_ATAPI: 561 case ATA_PROT_ATAPI:
552 case ATA_PROT_ATAPI_NODATA:
553 ata_qc_prep(qc); 562 ata_qc_prep(qc);
554 break; 563 break;
555 564
556 case ATA_PROT_ATAPI_DMA: 565 case ATA_PROT_ATAPI_DMA:
557 ata_qc_prep(qc); 566 ata_qc_prep(qc);
558 pdc_atapi_dma_pkt(qc); 567 /*FALLTHROUGH*/
568 case ATA_PROT_ATAPI_NODATA:
569 pdc_atapi_pkt(qc);
559 break; 570 break;
560 571
561 default: 572 default:
@@ -672,6 +683,7 @@ static inline unsigned int pdc_host_intr( struct ata_port *ap,
672 case ATA_PROT_DMA: 683 case ATA_PROT_DMA:
673 case ATA_PROT_NODATA: 684 case ATA_PROT_NODATA:
674 case ATA_PROT_ATAPI_DMA: 685 case ATA_PROT_ATAPI_DMA:
686 case ATA_PROT_ATAPI_NODATA:
675 qc->err_mask |= ac_err_mask(ata_wait_idle(ap)); 687 qc->err_mask |= ac_err_mask(ata_wait_idle(ap));
676 ata_qc_complete(qc); 688 ata_qc_complete(qc);
677 handled = 1; 689 handled = 1;
@@ -771,6 +783,10 @@ static inline void pdc_packet_start(struct ata_queued_cmd *qc)
771static unsigned int pdc_qc_issue_prot(struct ata_queued_cmd *qc) 783static unsigned int pdc_qc_issue_prot(struct ata_queued_cmd *qc)
772{ 784{
773 switch (qc->tf.protocol) { 785 switch (qc->tf.protocol) {
786 case ATA_PROT_ATAPI_NODATA:
787 if (qc->dev->flags & ATA_DFLAG_CDB_INTR)
788 break;
789 /*FALLTHROUGH*/
774 case ATA_PROT_ATAPI_DMA: 790 case ATA_PROT_ATAPI_DMA:
775 case ATA_PROT_DMA: 791 case ATA_PROT_DMA:
776 case ATA_PROT_NODATA: 792 case ATA_PROT_NODATA: