[PATCH linux1394-2.6.git] firewire: fw-ohci: add option for remotedebugging - amendment
From: Stefan Richter
Date: Thu Apr 10 2008 - 15:06:57 EST
Some afterthoughts:
- Tell where the Kconfig prompt is in debugging-via-ohci1394.txt.
- Open the physical DMA filter in the top half of the IRQ handler
and flush the necessary MMIO writes. This is to open the filter
as soon as possible after bus reset.
- Move the Kconfig prompt below the existing early debugging option.
Seems more logical after all, because that one is for early use
and this one for subsequent use.
- Reword the existing early debugging option to state what it is for
rather than how it works internally.
Signed-off-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
---
This could be merged into patch "firewire: fw-ohci: add option for
remote debugging" before it is submitted to mainline.
Documentation/debugging-via-ohci1394.txt | 9 +++++----
drivers/firewire/fw-ohci.c | 13 +++++++------
lib/Kconfig.debug | 23 ++++++++++++-----------
3 files changed, 24 insertions(+), 21 deletions(-)
Index: linux/Documentation/debugging-via-ohci1394.txt
===================================================================
--- linux.orig/Documentation/debugging-via-ohci1394.txt
+++ linux/Documentation/debugging-via-ohci1394.txt
@@ -42,8 +42,9 @@ This can be turned off by ohci1394's mod
The alternative firewire-ohci driver in drivers/firewire uses filtered physical
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.
+Compile the driver with CONFIG_FIREWIRE_OHCI_REMOTE_DMA (Kernel hacking menu:
+Remote debugging over FireWire with firewire-ohci) 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
@@ -51,8 +52,8 @@ implemented for x86. This routine runs
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
-parameter "ohci1394_dma=early" to the recompiled kernel on boot.
+Remote debugging over FireWire early on boot) and pass the parameter
+"ohci1394_dma=early" to the recompiled kernel on boot.
Tools
-----
Index: linux/drivers/firewire/fw-ohci.c
===================================================================
--- linux.orig/drivers/firewire/fw-ohci.c
+++ linux/drivers/firewire/fw-ohci.c
@@ -1309,11 +1309,6 @@ static void bus_reset_tasklet(unsigned l
reg_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)
@@ -1341,8 +1336,14 @@ static irqreturn_t irq_handler(int irq,
reg_write(ohci, OHCI1394_IntEventClear, event & ~OHCI1394_busReset);
log_irqs(event);
- if (event & OHCI1394_selfIDComplete)
+ if (event & OHCI1394_selfIDComplete) {
+#ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA
+ reg_write(ohci, OHCI1394_PhyReqFilterHiSet, ~0);
+ reg_write(ohci, OHCI1394_PhyReqFilterLoSet, ~0);
+ flush_writes(ohci);
+#endif
tasklet_schedule(&ohci->bus_reset_tasklet);
+ }
if (event & OHCI1394_RQPkt)
tasklet_schedule(&ohci->ar_request_ctx.tasklet);
Index: linux/lib/Kconfig.debug
===================================================================
--- linux.orig/lib/Kconfig.debug
+++ linux/lib/Kconfig.debug
@@ -592,18 +592,8 @@ 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"
+ bool "Remote debugging over FireWire early on boot"
depends on PCI && X86
help
If you want to debug problems which hang or crash the kernel early
@@ -631,4 +621,15 @@ config PROVIDE_OHCI1394_DMA_INIT
See Documentation/debugging-via-ohci1394.txt for more information.
+config FIREWIRE_OHCI_REMOTE_DMA
+ bool "Remote debugging over FireWire with firewire-ohci"
+ depends on FIREWIRE_OHCI
+ help
+ This option lets you use the FireWire bus for remote debugging
+ with help of the firewire-ohci driver. It enables unfiltered
+ remote DMA in firewire-ohci.
+ See Documentation/debugging-via-ohci1394.txt for more information.
+
+ If unsure, say N.
+
source "samples/Kconfig"
--
Stefan Richter
-=====-==--- -=-- -=-=-
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/