aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_promise.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
commitcf9b59e9d3e008591d1f54830f570982bb307a0d (patch)
tree113478ce8fd8c832ba726ffdf59b82cb46356476 /drivers/ata/sata_promise.c
parent44504b2bebf8b5823c59484e73096a7d6574471d (diff)
parentf4b87dee923342505e1ddba8d34ce9de33e75050 (diff)
Merge remote branch 'origin' into secretlab/next-devicetree
Merging in current state of Linus' tree to deal with merge conflicts and build failures in vio.c after merge. Conflicts: drivers/i2c/busses/i2c-cpm.c drivers/i2c/busses/i2c-mpc.c drivers/net/gianfar.c Also fixed up one line in arch/powerpc/kernel/vio.c to use the correct node pointer. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/ata/sata_promise.c')
-rw-r--r--drivers/ata/sata_promise.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 5356ec00d2b4..f03ad48273ff 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -333,7 +333,8 @@ static int pdc_common_port_start(struct ata_port *ap)
333 struct pdc_port_priv *pp; 333 struct pdc_port_priv *pp;
334 int rc; 334 int rc;
335 335
336 rc = ata_port_start(ap); 336 /* we use the same prd table as bmdma, allocate it */
337 rc = ata_bmdma_port_start(ap);
337 if (rc) 338 if (rc)
338 return rc; 339 return rc;
339 340
@@ -499,7 +500,7 @@ static int pdc_sata_scr_write(struct ata_link *link,
499static void pdc_atapi_pkt(struct ata_queued_cmd *qc) 500static void pdc_atapi_pkt(struct ata_queued_cmd *qc)
500{ 501{
501 struct ata_port *ap = qc->ap; 502 struct ata_port *ap = qc->ap;
502 dma_addr_t sg_table = ap->prd_dma; 503 dma_addr_t sg_table = ap->bmdma_prd_dma;
503 unsigned int cdb_len = qc->dev->cdb_len; 504 unsigned int cdb_len = qc->dev->cdb_len;
504 u8 *cdb = qc->cdb; 505 u8 *cdb = qc->cdb;
505 struct pdc_port_priv *pp = ap->private_data; 506 struct pdc_port_priv *pp = ap->private_data;
@@ -587,6 +588,7 @@ static void pdc_atapi_pkt(struct ata_queued_cmd *qc)
587static void pdc_fill_sg(struct ata_queued_cmd *qc) 588static void pdc_fill_sg(struct ata_queued_cmd *qc)
588{ 589{
589 struct ata_port *ap = qc->ap; 590 struct ata_port *ap = qc->ap;
591 struct ata_bmdma_prd *prd = ap->bmdma_prd;
590 struct scatterlist *sg; 592 struct scatterlist *sg;
591 const u32 SG_COUNT_ASIC_BUG = 41*4; 593 const u32 SG_COUNT_ASIC_BUG = 41*4;
592 unsigned int si, idx; 594 unsigned int si, idx;
@@ -613,8 +615,8 @@ static void pdc_fill_sg(struct ata_queued_cmd *qc)
613 if ((offset + sg_len) > 0x10000) 615 if ((offset + sg_len) > 0x10000)
614 len = 0x10000 - offset; 616 len = 0x10000 - offset;
615 617
616 ap->prd[idx].addr = cpu_to_le32(addr); 618 prd[idx].addr = cpu_to_le32(addr);
617 ap->prd[idx].flags_len = cpu_to_le32(len & 0xffff); 619 prd[idx].flags_len = cpu_to_le32(len & 0xffff);
618 VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len); 620 VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len);
619 621
620 idx++; 622 idx++;
@@ -623,27 +625,27 @@ static void pdc_fill_sg(struct ata_queued_cmd *qc)
623 } 625 }
624 } 626 }
625 627
626 len = le32_to_cpu(ap->prd[idx - 1].flags_len); 628 len = le32_to_cpu(prd[idx - 1].flags_len);
627 629
628 if (len > SG_COUNT_ASIC_BUG) { 630 if (len > SG_COUNT_ASIC_BUG) {
629 u32 addr; 631 u32 addr;
630 632
631 VPRINTK("Splitting last PRD.\n"); 633 VPRINTK("Splitting last PRD.\n");
632 634
633 addr = le32_to_cpu(ap->prd[idx - 1].addr); 635 addr = le32_to_cpu(prd[idx - 1].addr);
634 ap->prd[idx - 1].flags_len = cpu_to_le32(len - SG_COUNT_ASIC_BUG); 636 prd[idx - 1].flags_len = cpu_to_le32(len - SG_COUNT_ASIC_BUG);
635 VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx - 1, addr, SG_COUNT_ASIC_BUG); 637 VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx - 1, addr, SG_COUNT_ASIC_BUG);
636 638
637 addr = addr + len - SG_COUNT_ASIC_BUG; 639 addr = addr + len - SG_COUNT_ASIC_BUG;
638 len = SG_COUNT_ASIC_BUG; 640 len = SG_COUNT_ASIC_BUG;
639 ap->prd[idx].addr = cpu_to_le32(addr); 641 prd[idx].addr = cpu_to_le32(addr);
640 ap->prd[idx].flags_len = cpu_to_le32(len); 642 prd[idx].flags_len = cpu_to_le32(len);
641 VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len); 643 VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len);
642 644
643 idx++; 645 idx++;
644 } 646 }
645 647
646 ap->prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); 648 prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT);
647} 649}
648 650
649static void pdc_qc_prep(struct ata_queued_cmd *qc) 651static void pdc_qc_prep(struct ata_queued_cmd *qc)
@@ -658,7 +660,7 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc)
658 pdc_fill_sg(qc); 660 pdc_fill_sg(qc);
659 /*FALLTHROUGH*/ 661 /*FALLTHROUGH*/
660 case ATA_PROT_NODATA: 662 case ATA_PROT_NODATA:
661 i = pdc_pkt_header(&qc->tf, qc->ap->prd_dma, 663 i = pdc_pkt_header(&qc->tf, qc->ap->bmdma_prd_dma,
662 qc->dev->devno, pp->pkt); 664 qc->dev->devno, pp->pkt);
663 if (qc->tf.flags & ATA_TFLAG_LBA48) 665 if (qc->tf.flags & ATA_TFLAG_LBA48)
664 i = pdc_prep_lba48(&qc->tf, pp->pkt, i); 666 i = pdc_prep_lba48(&qc->tf, pp->pkt, i);
@@ -838,7 +840,7 @@ static void pdc_error_handler(struct ata_port *ap)
838 if (!(ap->pflags & ATA_PFLAG_FROZEN)) 840 if (!(ap->pflags & ATA_PFLAG_FROZEN))
839 pdc_reset_port(ap); 841 pdc_reset_port(ap);
840 842
841 ata_std_error_handler(ap); 843 ata_sff_error_handler(ap);
842} 844}
843 845
844static void pdc_post_internal_cmd(struct ata_queued_cmd *qc) 846static void pdc_post_internal_cmd(struct ata_queued_cmd *qc)
@@ -984,8 +986,7 @@ static irqreturn_t pdc_interrupt(int irq, void *dev_instance)
984 /* check for a plug or unplug event */ 986 /* check for a plug or unplug event */
985 ata_no = pdc_port_no_to_ata_no(i, is_sataii_tx4); 987 ata_no = pdc_port_no_to_ata_no(i, is_sataii_tx4);
986 tmp = hotplug_status & (0x11 << ata_no); 988 tmp = hotplug_status & (0x11 << ata_no);
987 if (tmp && ap && 989 if (tmp) {
988 !(ap->flags & ATA_FLAG_DISABLED)) {
989 struct ata_eh_info *ehi = &ap->link.eh_info; 990 struct ata_eh_info *ehi = &ap->link.eh_info;
990 ata_ehi_clear_desc(ehi); 991 ata_ehi_clear_desc(ehi);
991 ata_ehi_hotplugged(ehi); 992 ata_ehi_hotplugged(ehi);
@@ -997,8 +998,7 @@ static irqreturn_t pdc_interrupt(int irq, void *dev_instance)
997 998
998 /* check for a packet interrupt */ 999 /* check for a packet interrupt */
999 tmp = mask & (1 << (i + 1)); 1000 tmp = mask & (1 << (i + 1));
1000 if (tmp && ap && 1001 if (tmp) {
1001 !(ap->flags & ATA_FLAG_DISABLED)) {
1002 struct ata_queued_cmd *qc; 1002 struct ata_queued_cmd *qc;
1003 1003
1004 qc = ata_qc_from_tag(ap, ap->link.active_tag); 1004 qc = ata_qc_from_tag(ap, ap->link.active_tag);