Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lubomir Rintel and committed by
Stefan Richter
8bc588e0 a9954ce7

+12 -22
+1 -3
Documentation/debugging-via-ohci1394.txt
··· 38 38 39 39 The firewire-ohci driver in drivers/firewire uses filtered physical 40 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: 42 - Remote debugging over FireWire with firewire-ohci) to get unfiltered physical 43 - DMA. 41 + Pass the remote_dma=1 parameter to the driver to get unfiltered physical DMA. 44 42 45 43 Because the firewire-ohci driver depends on the PCI enumeration to be 46 44 completed, an initialization routine which runs pretty early has been
+11 -8
drivers/firewire/ohci.c
··· 370 370 ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS) 371 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 377 static void log_irqs(struct fw_ohci *ohci, u32 evt) 374 378 { 375 379 if (likely(!(param_debug & ··· 2054 2050 be32_to_cpu(ohci->next_header)); 2055 2051 } 2056 2052 2057 - #ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA 2058 - reg_write(ohci, OHCI1394_PhyReqFilterHiSet, ~0); 2059 - reg_write(ohci, OHCI1394_PhyReqFilterLoSet, ~0); 2060 - #endif 2053 + if (param_remote_dma) { 2054 + reg_write(ohci, OHCI1394_PhyReqFilterHiSet, ~0); 2055 + reg_write(ohci, OHCI1394_PhyReqFilterLoSet, ~0); 2056 + } 2061 2057 2062 2058 spin_unlock_irq(&ohci->lock); 2063 2059 ··· 2591 2587 static int ohci_enable_phys_dma(struct fw_card *card, 2592 2588 int node_id, int generation) 2593 2589 { 2594 - #ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA 2595 - return 0; 2596 - #else 2597 2590 struct fw_ohci *ohci = fw_ohci(card); 2598 2591 unsigned long flags; 2599 2592 int n, ret = 0; 2593 + 2594 + if (param_remote_dma) 2595 + return 0; 2600 2596 2601 2597 /* 2602 2598 * FIXME: Make sure this bitmask is cleared when we clear the busReset ··· 2626 2622 spin_unlock_irqrestore(&ohci->lock, flags); 2627 2623 2628 2624 return ret; 2629 - #endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */ 2630 2625 } 2631 2626 2632 2627 static u32 ohci_read_csr(struct fw_card *card, int csr_offset)
-11
lib/Kconfig.debug
··· 1547 1547 1548 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 1550 config BUILD_DOCSRC 1562 1551 bool "Build targets in Documentation/ tree" 1563 1552 depends on HEADERS_CHECK