diff options
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r-- | drivers/firewire/ohci.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 6aa8a86cb83b..8db663219560 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -290,7 +290,6 @@ static char ohci_driver_name[] = KBUILD_MODNAME; | |||
290 | #define QUIRK_NO_MSI 0x10 | 290 | #define QUIRK_NO_MSI 0x10 |
291 | #define QUIRK_TI_SLLZ059 0x20 | 291 | #define QUIRK_TI_SLLZ059 0x20 |
292 | #define QUIRK_IR_WAKE 0x40 | 292 | #define QUIRK_IR_WAKE 0x40 |
293 | #define QUIRK_PHY_LCTRL_TIMEOUT 0x80 | ||
294 | 293 | ||
295 | /* In case of multiple matches in ohci_quirks[], only the first one is used. */ | 294 | /* In case of multiple matches in ohci_quirks[], only the first one is used. */ |
296 | static const struct { | 295 | static const struct { |
@@ -303,10 +302,7 @@ static const struct { | |||
303 | QUIRK_BE_HEADERS}, | 302 | QUIRK_BE_HEADERS}, |
304 | 303 | ||
305 | {PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6, | 304 | {PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6, |
306 | QUIRK_PHY_LCTRL_TIMEOUT | QUIRK_NO_MSI}, | 305 | QUIRK_NO_MSI}, |
307 | |||
308 | {PCI_VENDOR_ID_ATT, PCI_ANY_ID, PCI_ANY_ID, | ||
309 | QUIRK_PHY_LCTRL_TIMEOUT}, | ||
310 | 306 | ||
311 | {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_SB1394, PCI_ANY_ID, | 307 | {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_SB1394, PCI_ANY_ID, |
312 | QUIRK_RESET_PACKET}, | 308 | QUIRK_RESET_PACKET}, |
@@ -353,7 +349,6 @@ MODULE_PARM_DESC(quirks, "Chip quirks (default = 0" | |||
353 | ", disable MSI = " __stringify(QUIRK_NO_MSI) | 349 | ", disable MSI = " __stringify(QUIRK_NO_MSI) |
354 | ", TI SLLZ059 erratum = " __stringify(QUIRK_TI_SLLZ059) | 350 | ", TI SLLZ059 erratum = " __stringify(QUIRK_TI_SLLZ059) |
355 | ", IR wake unreliable = " __stringify(QUIRK_IR_WAKE) | 351 | ", IR wake unreliable = " __stringify(QUIRK_IR_WAKE) |
356 | ", phy LCtrl timeout = " __stringify(QUIRK_PHY_LCTRL_TIMEOUT) | ||
357 | ")"); | 352 | ")"); |
358 | 353 | ||
359 | #define OHCI_PARAM_DEBUG_AT_AR 1 | 354 | #define OHCI_PARAM_DEBUG_AT_AR 1 |
@@ -370,6 +365,10 @@ MODULE_PARM_DESC(debug, "Verbose logging (default = 0" | |||
370 | ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS) | 365 | ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS) |
371 | ", or a combination, or all = -1)"); | 366 | ", or a combination, or all = -1)"); |
372 | 367 | ||
368 | static bool param_remote_dma; | ||
369 | module_param_named(remote_dma, param_remote_dma, bool, 0444); | ||
370 | MODULE_PARM_DESC(remote_dma, "Enable unfiltered remote DMA (default = N)"); | ||
371 | |||
373 | static void log_irqs(struct fw_ohci *ohci, u32 evt) | 372 | static void log_irqs(struct fw_ohci *ohci, u32 evt) |
374 | { | 373 | { |
375 | if (likely(!(param_debug & | 374 | if (likely(!(param_debug & |
@@ -2050,10 +2049,10 @@ static void bus_reset_work(struct work_struct *work) | |||
2050 | be32_to_cpu(ohci->next_header)); | 2049 | be32_to_cpu(ohci->next_header)); |
2051 | } | 2050 | } |
2052 | 2051 | ||
2053 | #ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA | 2052 | if (param_remote_dma) { |
2054 | reg_write(ohci, OHCI1394_PhyReqFilterHiSet, ~0); | 2053 | reg_write(ohci, OHCI1394_PhyReqFilterHiSet, ~0); |
2055 | reg_write(ohci, OHCI1394_PhyReqFilterLoSet, ~0); | 2054 | reg_write(ohci, OHCI1394_PhyReqFilterLoSet, ~0); |
2056 | #endif | 2055 | } |
2057 | 2056 | ||
2058 | spin_unlock_irq(&ohci->lock); | 2057 | spin_unlock_irq(&ohci->lock); |
2059 | 2058 | ||
@@ -2295,9 +2294,6 @@ static int ohci_enable(struct fw_card *card, | |||
2295 | * TI TSB82AA2 + TSB81BA3(A) cards signal LPS enabled early but | 2294 | * TI TSB82AA2 + TSB81BA3(A) cards signal LPS enabled early but |
2296 | * cannot actually use the phy at that time. These need tens of | 2295 | * cannot actually use the phy at that time. These need tens of |
2297 | * millisecods pause between LPS write and first phy access too. | 2296 | * millisecods pause between LPS write and first phy access too. |
2298 | * | ||
2299 | * But do not wait for 50msec on Agere/LSI cards. Their phy | ||
2300 | * arbitration state machine may time out during such a long wait. | ||
2301 | */ | 2297 | */ |
2302 | 2298 | ||
2303 | reg_write(ohci, OHCI1394_HCControlSet, | 2299 | reg_write(ohci, OHCI1394_HCControlSet, |
@@ -2305,11 +2301,8 @@ static int ohci_enable(struct fw_card *card, | |||
2305 | OHCI1394_HCControl_postedWriteEnable); | 2301 | OHCI1394_HCControl_postedWriteEnable); |
2306 | flush_writes(ohci); | 2302 | flush_writes(ohci); |
2307 | 2303 | ||
2308 | if (!(ohci->quirks & QUIRK_PHY_LCTRL_TIMEOUT)) | 2304 | for (lps = 0, i = 0; !lps && i < 3; i++) { |
2309 | msleep(50); | 2305 | msleep(50); |
2310 | |||
2311 | for (lps = 0, i = 0; !lps && i < 150; i++) { | ||
2312 | msleep(1); | ||
2313 | lps = reg_read(ohci, OHCI1394_HCControlSet) & | 2306 | lps = reg_read(ohci, OHCI1394_HCControlSet) & |
2314 | OHCI1394_HCControl_LPS; | 2307 | OHCI1394_HCControl_LPS; |
2315 | } | 2308 | } |
@@ -2363,7 +2356,7 @@ static int ohci_enable(struct fw_card *card, | |||
2363 | reg_write(ohci, OHCI1394_FairnessControl, 0); | 2356 | reg_write(ohci, OHCI1394_FairnessControl, 0); |
2364 | card->priority_budget_implemented = ohci->pri_req_max != 0; | 2357 | card->priority_budget_implemented = ohci->pri_req_max != 0; |
2365 | 2358 | ||
2366 | reg_write(ohci, OHCI1394_PhyUpperBound, 0x00010000); | 2359 | reg_write(ohci, OHCI1394_PhyUpperBound, FW_MAX_PHYSICAL_RANGE >> 16); |
2367 | reg_write(ohci, OHCI1394_IntEventClear, ~0); | 2360 | reg_write(ohci, OHCI1394_IntEventClear, ~0); |
2368 | reg_write(ohci, OHCI1394_IntMaskClear, ~0); | 2361 | reg_write(ohci, OHCI1394_IntMaskClear, ~0); |
2369 | 2362 | ||
@@ -2587,13 +2580,13 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) | |||
2587 | static int ohci_enable_phys_dma(struct fw_card *card, | 2580 | static int ohci_enable_phys_dma(struct fw_card *card, |
2588 | int node_id, int generation) | 2581 | int node_id, int generation) |
2589 | { | 2582 | { |
2590 | #ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA | ||
2591 | return 0; | ||
2592 | #else | ||
2593 | struct fw_ohci *ohci = fw_ohci(card); | 2583 | struct fw_ohci *ohci = fw_ohci(card); |
2594 | unsigned long flags; | 2584 | unsigned long flags; |
2595 | int n, ret = 0; | 2585 | int n, ret = 0; |
2596 | 2586 | ||
2587 | if (param_remote_dma) | ||
2588 | return 0; | ||
2589 | |||
2597 | /* | 2590 | /* |
2598 | * FIXME: Make sure this bitmask is cleared when we clear the busReset | 2591 | * FIXME: Make sure this bitmask is cleared when we clear the busReset |
2599 | * interrupt bit. Clear physReqResourceAllBuses on bus reset. | 2592 | * interrupt bit. Clear physReqResourceAllBuses on bus reset. |
@@ -2622,7 +2615,6 @@ static int ohci_enable_phys_dma(struct fw_card *card, | |||
2622 | spin_unlock_irqrestore(&ohci->lock, flags); | 2615 | spin_unlock_irqrestore(&ohci->lock, flags); |
2623 | 2616 | ||
2624 | return ret; | 2617 | return ret; |
2625 | #endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */ | ||
2626 | } | 2618 | } |
2627 | 2619 | ||
2628 | static u32 ohci_read_csr(struct fw_card *card, int csr_offset) | 2620 | static u32 ohci_read_csr(struct fw_card *card, int csr_offset) |
@@ -3720,9 +3712,11 @@ static int pci_probe(struct pci_dev *dev, | |||
3720 | version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff; | 3712 | version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff; |
3721 | ohci_notice(ohci, | 3713 | ohci_notice(ohci, |
3722 | "added OHCI v%x.%x device as card %d, " | 3714 | "added OHCI v%x.%x device as card %d, " |
3723 | "%d IR + %d IT contexts, quirks 0x%x\n", | 3715 | "%d IR + %d IT contexts, quirks 0x%x%s\n", |
3724 | version >> 16, version & 0xff, ohci->card.index, | 3716 | version >> 16, version & 0xff, ohci->card.index, |
3725 | ohci->n_ir, ohci->n_it, ohci->quirks); | 3717 | ohci->n_ir, ohci->n_it, ohci->quirks, |
3718 | reg_read(ohci, OHCI1394_PhyUpperBound) ? | ||
3719 | ", >4 GB phys DMA" : ""); | ||
3726 | 3720 | ||
3727 | return 0; | 3721 | return 0; |
3728 | 3722 | ||