diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 01:58:41 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 01:58:41 -0500 |
commit | fce45c1c8a6b5334fa88bbb9b1496b0699d3fef0 (patch) | |
tree | cba2597077cf33d122f8d771bf84618cc5374cf6 /drivers/scsi/pdc_adma.c | |
parent | 15dbb5a3f971a28040ae6cbcd8bbdf19b629fa83 (diff) | |
parent | 81cfb8864c73230eb1c37753aba517db15cf4d8f (diff) |
Merge branch 'upstream'
Diffstat (limited to 'drivers/scsi/pdc_adma.c')
-rw-r--r-- | drivers/scsi/pdc_adma.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/scsi/pdc_adma.c b/drivers/scsi/pdc_adma.c index 1701e318a9f0..309b205820a4 100644 --- a/drivers/scsi/pdc_adma.c +++ b/drivers/scsi/pdc_adma.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <linux/libata.h> | 46 | #include <linux/libata.h> |
47 | 47 | ||
48 | #define DRV_NAME "pdc_adma" | 48 | #define DRV_NAME "pdc_adma" |
49 | #define DRV_VERSION "0.01" | 49 | #define DRV_VERSION "0.03" |
50 | 50 | ||
51 | /* macro to calculate base address for ATA regs */ | 51 | /* macro to calculate base address for ATA regs */ |
52 | #define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40)) | 52 | #define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40)) |
@@ -79,7 +79,6 @@ enum { | |||
79 | aNIEN = (1 << 8), /* irq mask: 1==masked */ | 79 | aNIEN = (1 << 8), /* irq mask: 1==masked */ |
80 | aGO = (1 << 7), /* packet trigger ("Go!") */ | 80 | aGO = (1 << 7), /* packet trigger ("Go!") */ |
81 | aRSTADM = (1 << 5), /* ADMA logic reset */ | 81 | aRSTADM = (1 << 5), /* ADMA logic reset */ |
82 | aRSTA = (1 << 2), /* ATA hard reset */ | ||
83 | aPIOMD4 = 0x0003, /* PIO mode 4 */ | 82 | aPIOMD4 = 0x0003, /* PIO mode 4 */ |
84 | 83 | ||
85 | /* ADMA_STATUS register bits */ | 84 | /* ADMA_STATUS register bits */ |
@@ -452,24 +451,25 @@ static inline unsigned int adma_intr_pkt(struct ata_host_set *host_set) | |||
452 | struct adma_port_priv *pp; | 451 | struct adma_port_priv *pp; |
453 | struct ata_queued_cmd *qc; | 452 | struct ata_queued_cmd *qc; |
454 | void __iomem *chan = ADMA_REGS(mmio_base, port_no); | 453 | void __iomem *chan = ADMA_REGS(mmio_base, port_no); |
455 | u8 drv_stat, status = readb(chan + ADMA_STATUS); | 454 | u8 drv_stat = 0, status = readb(chan + ADMA_STATUS); |
456 | 455 | ||
457 | if (status == 0) | 456 | if (status == 0) |
458 | continue; | 457 | continue; |
459 | handled = 1; | 458 | handled = 1; |
460 | adma_enter_reg_mode(ap); | 459 | adma_enter_reg_mode(ap); |
461 | if ((ap->flags & ATA_FLAG_PORT_DISABLED)) | 460 | if (ap->flags & (ATA_FLAG_PORT_DISABLED | ATA_FLAG_NOINTR)) |
462 | continue; | 461 | continue; |
463 | pp = ap->private_data; | 462 | pp = ap->private_data; |
464 | if (!pp || pp->state != adma_state_pkt) | 463 | if (!pp || pp->state != adma_state_pkt) |
465 | continue; | 464 | continue; |
466 | qc = ata_qc_from_tag(ap, ap->active_tag); | 465 | qc = ata_qc_from_tag(ap, ap->active_tag); |
467 | drv_stat = 0; | 466 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) { |
468 | if ((status & (aPERR | aPSD | aUIRQ))) | 467 | if ((status & (aPERR | aPSD | aUIRQ))) |
469 | drv_stat = ATA_ERR; | 468 | drv_stat = ATA_ERR; |
470 | else if (pp->pkt[0] != cDONE) | 469 | else if (pp->pkt[0] != cDONE) |
471 | drv_stat = ATA_ERR; | 470 | drv_stat = ATA_ERR; |
472 | ata_qc_complete(qc, drv_stat); | 471 | ata_qc_complete(qc, drv_stat); |
472 | } | ||
473 | } | 473 | } |
474 | return handled; | 474 | return handled; |
475 | } | 475 | } |
@@ -490,7 +490,7 @@ static inline unsigned int adma_intr_mmio(struct ata_host_set *host_set) | |||
490 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) { | 490 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) { |
491 | 491 | ||
492 | /* check main status, clearing INTRQ */ | 492 | /* check main status, clearing INTRQ */ |
493 | u8 status = ata_chk_status(ap); | 493 | u8 status = ata_check_status(ap); |
494 | if ((status & ATA_BUSY)) | 494 | if ((status & ATA_BUSY)) |
495 | continue; | 495 | continue; |
496 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", | 496 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", |
@@ -561,15 +561,15 @@ static int adma_port_start(struct ata_port *ap) | |||
561 | if ((pp->pkt_dma & 7) != 0) { | 561 | if ((pp->pkt_dma & 7) != 0) { |
562 | printk("bad alignment for pp->pkt_dma: %08x\n", | 562 | printk("bad alignment for pp->pkt_dma: %08x\n", |
563 | (u32)pp->pkt_dma); | 563 | (u32)pp->pkt_dma); |
564 | goto err_out_kfree2; | 564 | dma_free_coherent(dev, ADMA_PKT_BYTES, |
565 | pp->pkt, pp->pkt_dma); | ||
566 | goto err_out_kfree; | ||
565 | } | 567 | } |
566 | memset(pp->pkt, 0, ADMA_PKT_BYTES); | 568 | memset(pp->pkt, 0, ADMA_PKT_BYTES); |
567 | ap->private_data = pp; | 569 | ap->private_data = pp; |
568 | adma_reinit_engine(ap); | 570 | adma_reinit_engine(ap); |
569 | return 0; | 571 | return 0; |
570 | 572 | ||
571 | err_out_kfree2: | ||
572 | kfree(pp); | ||
573 | err_out_kfree: | 573 | err_out_kfree: |
574 | kfree(pp); | 574 | kfree(pp); |
575 | err_out: | 575 | err_out: |