diff options
| author | Lubomir Rintel <lkundrak@v3.sk> | 2013-12-22 05:34:22 -0500 |
|---|---|---|
| committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2014-01-12 12:54:38 -0500 |
| commit | 8bc588e0e585bc9085df75e84d4d5635f45cf360 (patch) | |
| tree | 8dc98f31ce6330b1bd8670a42f60061e94481c68 | |
| parent | a9954ce769e2c8b450b00ab2a4e208f447996b2d (diff) | |
firewire: ohci: Turn remote DMA support into a module parameter
This makes it possible to debug kernel over FireWire without the need to
recompile it.
[Stefan R: changed description from "...0" to "...N"]
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| -rw-r--r-- | Documentation/debugging-via-ohci1394.txt | 4 | ||||
| -rw-r--r-- | drivers/firewire/ohci.c | 19 | ||||
| -rw-r--r-- | lib/Kconfig.debug | 11 |
3 files changed, 12 insertions, 22 deletions
diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt index 14d194496490..73473aa8d861 100644 --- a/Documentation/debugging-via-ohci1394.txt +++ b/Documentation/debugging-via-ohci1394.txt | |||
| @@ -38,9 +38,7 @@ Drivers | |||
| 38 | 38 | ||
| 39 | The firewire-ohci driver in drivers/firewire uses filtered physical | 39 | The firewire-ohci driver in drivers/firewire uses filtered physical |
| 40 | DMA by default, which is more secure but not suitable for remote debugging. | 40 | DMA by default, which is more secure but not suitable for remote debugging. |
| 41 | Compile the driver with CONFIG_FIREWIRE_OHCI_REMOTE_DMA (Kernel hacking menu: | 41 | Pass the remote_dma=1 parameter to the driver to get unfiltered physical DMA. |
| 42 | Remote debugging over FireWire with firewire-ohci) to get unfiltered physical | ||
| 43 | DMA. | ||
| 44 | 42 | ||
| 45 | Because the firewire-ohci driver depends on the PCI enumeration to be | 43 | Because the firewire-ohci driver depends on the PCI enumeration to be |
| 46 | completed, an initialization routine which runs pretty early has been | 44 | completed, an initialization routine which runs pretty early has been |
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 6aa8a86cb83b..036fb3bd5659 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
| @@ -370,6 +370,10 @@ MODULE_PARM_DESC(debug, "Verbose logging (default = 0" | |||
| 370 | ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS) | 370 | ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS) |
| 371 | ", or a combination, or all = -1)"); | 371 | ", or a combination, or all = -1)"); |
| 372 | 372 | ||
| 373 | static bool param_remote_dma; | ||
| 374 | module_param_named(remote_dma, param_remote_dma, bool, 0444); | ||
| 375 | MODULE_PARM_DESC(remote_dma, "Enable unfiltered remote DMA (default = N)"); | ||
| 376 | |||
| 373 | static void log_irqs(struct fw_ohci *ohci, u32 evt) | 377 | static void log_irqs(struct fw_ohci *ohci, u32 evt) |
| 374 | { | 378 | { |
| 375 | if (likely(!(param_debug & | 379 | if (likely(!(param_debug & |
| @@ -2050,10 +2054,10 @@ static void bus_reset_work(struct work_struct *work) | |||
| 2050 | be32_to_cpu(ohci->next_header)); | 2054 | be32_to_cpu(ohci->next_header)); |
| 2051 | } | 2055 | } |
| 2052 | 2056 | ||
| 2053 | #ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA | 2057 | if (param_remote_dma) { |
| 2054 | reg_write(ohci, OHCI1394_PhyReqFilterHiSet, ~0); | 2058 | reg_write(ohci, OHCI1394_PhyReqFilterHiSet, ~0); |
| 2055 | reg_write(ohci, OHCI1394_PhyReqFilterLoSet, ~0); | 2059 | reg_write(ohci, OHCI1394_PhyReqFilterLoSet, ~0); |
| 2056 | #endif | 2060 | } |
| 2057 | 2061 | ||
| 2058 | spin_unlock_irq(&ohci->lock); | 2062 | spin_unlock_irq(&ohci->lock); |
| 2059 | 2063 | ||
| @@ -2587,13 +2591,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, | 2591 | static int ohci_enable_phys_dma(struct fw_card *card, |
| 2588 | int node_id, int generation) | 2592 | int node_id, int generation) |
| 2589 | { | 2593 | { |
| 2590 | #ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA | ||
| 2591 | return 0; | ||
| 2592 | #else | ||
| 2593 | struct fw_ohci *ohci = fw_ohci(card); | 2594 | struct fw_ohci *ohci = fw_ohci(card); |
| 2594 | unsigned long flags; | 2595 | unsigned long flags; |
| 2595 | int n, ret = 0; | 2596 | int n, ret = 0; |
| 2596 | 2597 | ||
| 2598 | if (param_remote_dma) | ||
| 2599 | return 0; | ||
| 2600 | |||
| 2597 | /* | 2601 | /* |
| 2598 | * FIXME: Make sure this bitmask is cleared when we clear the busReset | 2602 | * FIXME: Make sure this bitmask is cleared when we clear the busReset |
| 2599 | * interrupt bit. Clear physReqResourceAllBuses on bus reset. | 2603 | * interrupt bit. Clear physReqResourceAllBuses on bus reset. |
| @@ -2622,7 +2626,6 @@ static int ohci_enable_phys_dma(struct fw_card *card, | |||
| 2622 | spin_unlock_irqrestore(&ohci->lock, flags); | 2626 | spin_unlock_irqrestore(&ohci->lock, flags); |
| 2623 | 2627 | ||
| 2624 | return ret; | 2628 | return ret; |
| 2625 | #endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */ | ||
| 2626 | } | 2629 | } |
| 2627 | 2630 | ||
| 2628 | static u32 ohci_read_csr(struct fw_card *card, int csr_offset) | 2631 | static u32 ohci_read_csr(struct fw_card *card, int csr_offset) |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index db25707aa41b..dc30284a3b07 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
| @@ -1547,17 +1547,6 @@ config PROVIDE_OHCI1394_DMA_INIT | |||
| 1547 | 1547 | ||
| 1548 | See Documentation/debugging-via-ohci1394.txt for more information. | 1548 | See Documentation/debugging-via-ohci1394.txt for more information. |
| 1549 | 1549 | ||
| 1550 | config FIREWIRE_OHCI_REMOTE_DMA | ||
| 1551 | bool "Remote debugging over FireWire with firewire-ohci" | ||
| 1552 | depends on FIREWIRE_OHCI | ||
| 1553 | help | ||
| 1554 | This option lets you use the FireWire bus for remote debugging | ||
| 1555 | with help of the firewire-ohci driver. It enables unfiltered | ||
| 1556 | remote DMA in firewire-ohci. | ||
| 1557 | See Documentation/debugging-via-ohci1394.txt for more information. | ||
| 1558 | |||
| 1559 | If unsure, say N. | ||
| 1560 | |||
| 1561 | config BUILD_DOCSRC | 1550 | config BUILD_DOCSRC |
| 1562 | bool "Build targets in Documentation/ tree" | 1551 | bool "Build targets in Documentation/ tree" |
| 1563 | depends on HEADERS_CHECK | 1552 | depends on HEADERS_CHECK |
