firewire: fw-ohci: add option for remote debugging
Subsystems (3)
PATCH 1/1 firewire: fw-ohci: add option for remote debugging
This way firewire-ohci can be used for remote debugging like ohci1394.
Signed-off-by Stefan Richter <[email protected]>
--- Documentation/debugging-via-ohci1394.txt | 13 ++++++++----- drivers/firewire/fw-ohci.c | 9 +++++++++ lib/Kconfig.debug | 10 ++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-)
Documentation/debugging-via-ohci1394.txt +8 -5
@@ -41,11 +41,14 @@ to a working state and enables physical This can be turned off by ohci1394's module parameter phys_dma=0. The alternative firewire-ohci driver in drivers/firewire uses filtered physical -DMA, hence is not yet suitable for remote debugging. - -Because ohci1394 depends on the PCI enumeration to be completed, an -initialization routine which runs pretty early (long before console_init() -which makes the printk buffer appear on the console can be called) was written. +DMA by default, which is more secure but not suitable for remote debugging. +Compile the driver with CONFIG_FIREWIRE_OHCI_REMOTE_DMA to get unfiltered +physical DMA. + +Because ohci1394 and firewire-ohci depend on the PCI enumeration to be +completed, an initialization routine which runs pretty early has been +implemented for x86. This routine runs long before console_init() can be +called, i.e. before the printk buffer appears on the console. To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu: Provide code for enabling DMA over FireWire early on boot) and pass the
drivers/firewire/fw-ohci.c +9 -0
@@ -1091,6 +1091,11 @@ static void bus_reset_tasklet(unsigned lreg_write (ohci, OHCI1394_ConfigROMhdr, ohci->next_header); } +#ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA +reg_write (ohci, OHCI1394_PhyReqFilterHiSet, ~0 ); +reg_write (ohci, OHCI1394_PhyReqFilterLoSet, ~0 ); +#endif +spin_unlock_irqrestore (&ohci->lock, flags);if (free_rom)
@@ -1429,6 +1434,9 @@ static int ohci_cancel_packet(struct fw_static int ohci_enable_phys_dma (struct fw_card *card,int node_id,int generation) { +#ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA +return 0 ; +#else struct fw_ohci *ohci =fw_ohci (card);unsigned long flags;int n, retval =0 ;
@@ -1460,6 +1468,7 @@ ohci_enable_phys_dma(struct fw_card *car out:spin_unlock_irqrestore (&ohci->lock, flags);return retval; +#endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */ } static u64
lib/Kconfig.debug +10 -0
@@ -592,6 +592,16 @@ config LATENCYTOP Enable this option if you want to use the LatencyTOP tool to find out which userspace is blocking on what kernel operations. +config FIREWIRE_OHCI_REMOTE_DMA + bool "Remote debugging via firewire-ohci" + depends on FIREWIRE_OHCI + help + This option lets you use the FireWire bus for remote debugging. + It enables unfiltered remote DMA in the firewire-ohci driver. + See Documentation/debugging-via-ohci1394.txt for more information. + + If unsure, say N. + config PROVIDE_OHCI1394_DMA_INIT bool "Provide code for enabling DMA over FireWire early on boot" depends on PCI && X86
Signature · 3 lines
Stefan Richter -=====-==--- --=- ===-- http://arcgraph.de/sr/