diff options
Diffstat (limited to 'drivers/ieee1394/ohci1394.c')
-rw-r--r-- | drivers/ieee1394/ohci1394.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index 11f13778f139..3d278412e1ca 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c | |||
@@ -163,7 +163,7 @@ printk(level "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->id , | |||
163 | 163 | ||
164 | /* Module Parameters */ | 164 | /* Module Parameters */ |
165 | static int phys_dma = 1; | 165 | static int phys_dma = 1; |
166 | module_param(phys_dma, int, 0644); | 166 | module_param(phys_dma, int, 0444); |
167 | MODULE_PARM_DESC(phys_dma, "Enable physical dma (default = 1)."); | 167 | MODULE_PARM_DESC(phys_dma, "Enable physical dma (default = 1)."); |
168 | 168 | ||
169 | static void dma_trm_tasklet(unsigned long data); | 169 | static void dma_trm_tasklet(unsigned long data); |
@@ -553,7 +553,8 @@ static void ohci_initialize(struct ti_ohci *ohci) | |||
553 | * register content. | 553 | * register content. |
554 | * To actually enable physical responses is the job of our interrupt | 554 | * To actually enable physical responses is the job of our interrupt |
555 | * handler which programs the physical request filter. */ | 555 | * handler which programs the physical request filter. */ |
556 | reg_write(ohci, OHCI1394_PhyUpperBound, 0x01000000); | 556 | reg_write(ohci, OHCI1394_PhyUpperBound, |
557 | OHCI1394_PHYS_UPPER_BOUND_PROGRAMMED >> 16); | ||
557 | 558 | ||
558 | DBGMSG("physUpperBoundOffset=%08x", | 559 | DBGMSG("physUpperBoundOffset=%08x", |
559 | reg_read(ohci, OHCI1394_PhyUpperBound)); | 560 | reg_read(ohci, OHCI1394_PhyUpperBound)); |
@@ -580,17 +581,14 @@ static void ohci_initialize(struct ti_ohci *ohci) | |||
580 | OHCI1394_isochRx | | 581 | OHCI1394_isochRx | |
581 | OHCI1394_isochTx | | 582 | OHCI1394_isochTx | |
582 | OHCI1394_postedWriteErr | | 583 | OHCI1394_postedWriteErr | |
584 | OHCI1394_cycleTooLong | | ||
583 | OHCI1394_cycleInconsistent); | 585 | OHCI1394_cycleInconsistent); |
584 | 586 | ||
585 | /* Enable link */ | 587 | /* Enable link */ |
586 | reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable); | 588 | reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable); |
587 | 589 | ||
588 | buf = reg_read(ohci, OHCI1394_Version); | 590 | buf = reg_read(ohci, OHCI1394_Version); |
589 | #ifndef __sparc__ | ||
590 | sprintf (irq_buf, "%d", ohci->dev->irq); | 591 | sprintf (irq_buf, "%d", ohci->dev->irq); |
591 | #else | ||
592 | sprintf (irq_buf, "%s", __irq_itoa(ohci->dev->irq)); | ||
593 | #endif | ||
594 | PRINT(KERN_INFO, "OHCI-1394 %d.%d (PCI): IRQ=[%s] " | 592 | PRINT(KERN_INFO, "OHCI-1394 %d.%d (PCI): IRQ=[%s] " |
595 | "MMIO=[%lx-%lx] Max Packet=[%d] IR/IT contexts=[%d/%d]", | 593 | "MMIO=[%lx-%lx] Max Packet=[%d] IR/IT contexts=[%d/%d]", |
596 | ((((buf) >> 16) & 0xf) + (((buf) >> 20) & 0xf) * 10), | 594 | ((((buf) >> 16) & 0xf) + (((buf) >> 20) & 0xf) * 10), |
@@ -2386,6 +2384,15 @@ static irqreturn_t ohci_irq_handler(int irq, void *dev_id, | |||
2386 | PRINT(KERN_ERR, "physical posted write error"); | 2384 | PRINT(KERN_ERR, "physical posted write error"); |
2387 | /* no recovery strategy yet, had to involve protocol drivers */ | 2385 | /* no recovery strategy yet, had to involve protocol drivers */ |
2388 | } | 2386 | } |
2387 | if (event & OHCI1394_cycleTooLong) { | ||
2388 | if(printk_ratelimit()) | ||
2389 | PRINT(KERN_WARNING, "isochronous cycle too long"); | ||
2390 | else | ||
2391 | DBGMSG("OHCI1394_cycleTooLong"); | ||
2392 | reg_write(ohci, OHCI1394_LinkControlSet, | ||
2393 | OHCI1394_LinkControl_CycleMaster); | ||
2394 | event &= ~OHCI1394_cycleTooLong; | ||
2395 | } | ||
2389 | if (event & OHCI1394_cycleInconsistent) { | 2396 | if (event & OHCI1394_cycleInconsistent) { |
2390 | /* We subscribe to the cycleInconsistent event only to | 2397 | /* We subscribe to the cycleInconsistent event only to |
2391 | * clear the corresponding event bit... otherwise, | 2398 | * clear the corresponding event bit... otherwise, |
@@ -3404,6 +3411,14 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev, | |||
3404 | host->csr.max_rec = (reg_read(ohci, OHCI1394_BusOptions) >> 12) & 0xf; | 3411 | host->csr.max_rec = (reg_read(ohci, OHCI1394_BusOptions) >> 12) & 0xf; |
3405 | host->csr.lnk_spd = reg_read(ohci, OHCI1394_BusOptions) & 0x7; | 3412 | host->csr.lnk_spd = reg_read(ohci, OHCI1394_BusOptions) & 0x7; |
3406 | 3413 | ||
3414 | if (phys_dma) { | ||
3415 | host->low_addr_space = | ||
3416 | (u64) reg_read(ohci, OHCI1394_PhyUpperBound) << 16; | ||
3417 | if (!host->low_addr_space) | ||
3418 | host->low_addr_space = OHCI1394_PHYS_UPPER_BOUND_FIXED; | ||
3419 | } | ||
3420 | host->middle_addr_space = OHCI1394_MIDDLE_ADDRESS_SPACE; | ||
3421 | |||
3407 | /* Tell the highlevel this host is ready */ | 3422 | /* Tell the highlevel this host is ready */ |
3408 | if (hpsb_add_host(host)) | 3423 | if (hpsb_add_host(host)) |
3409 | FAIL(-ENOMEM, "Failed to register host with highlevel"); | 3424 | FAIL(-ENOMEM, "Failed to register host with highlevel"); |
@@ -3462,24 +3477,13 @@ static void ohci1394_pci_remove(struct pci_dev *pdev) | |||
3462 | case OHCI_INIT_HAVE_TXRX_BUFFERS__MAYBE: | 3477 | case OHCI_INIT_HAVE_TXRX_BUFFERS__MAYBE: |
3463 | /* The ohci_soft_reset() stops all DMA contexts, so we | 3478 | /* The ohci_soft_reset() stops all DMA contexts, so we |
3464 | * dont need to do this. */ | 3479 | * dont need to do this. */ |
3465 | /* Free AR dma */ | ||
3466 | free_dma_rcv_ctx(&ohci->ar_req_context); | 3480 | free_dma_rcv_ctx(&ohci->ar_req_context); |
3467 | free_dma_rcv_ctx(&ohci->ar_resp_context); | 3481 | free_dma_rcv_ctx(&ohci->ar_resp_context); |
3468 | |||
3469 | /* Free AT dma */ | ||
3470 | free_dma_trm_ctx(&ohci->at_req_context); | 3482 | free_dma_trm_ctx(&ohci->at_req_context); |
3471 | free_dma_trm_ctx(&ohci->at_resp_context); | 3483 | free_dma_trm_ctx(&ohci->at_resp_context); |
3472 | |||
3473 | /* Free IR dma */ | ||
3474 | free_dma_rcv_ctx(&ohci->ir_legacy_context); | 3484 | free_dma_rcv_ctx(&ohci->ir_legacy_context); |
3475 | |||
3476 | /* Free IT dma */ | ||
3477 | free_dma_trm_ctx(&ohci->it_legacy_context); | 3485 | free_dma_trm_ctx(&ohci->it_legacy_context); |
3478 | 3486 | ||
3479 | /* Free IR legacy dma */ | ||
3480 | free_dma_rcv_ctx(&ohci->ir_legacy_context); | ||
3481 | |||
3482 | |||
3483 | case OHCI_INIT_HAVE_SELFID_BUFFER: | 3487 | case OHCI_INIT_HAVE_SELFID_BUFFER: |
3484 | pci_free_consistent(ohci->dev, OHCI1394_SI_DMA_BUF_SIZE, | 3488 | pci_free_consistent(ohci->dev, OHCI1394_SI_DMA_BUF_SIZE, |
3485 | ohci->selfid_buf_cpu, | 3489 | ohci->selfid_buf_cpu, |
@@ -3539,6 +3543,7 @@ static int ohci1394_pci_resume (struct pci_dev *pdev) | |||
3539 | } | 3543 | } |
3540 | #endif /* CONFIG_PPC_PMAC */ | 3544 | #endif /* CONFIG_PPC_PMAC */ |
3541 | 3545 | ||
3546 | pci_restore_state(pdev); | ||
3542 | pci_enable_device(pdev); | 3547 | pci_enable_device(pdev); |
3543 | 3548 | ||
3544 | return 0; | 3549 | return 0; |
@@ -3558,6 +3563,8 @@ static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state) | |||
3558 | } | 3563 | } |
3559 | #endif | 3564 | #endif |
3560 | 3565 | ||
3566 | pci_save_state(pdev); | ||
3567 | |||
3561 | return 0; | 3568 | return 0; |
3562 | } | 3569 | } |
3563 | 3570 | ||