Commit 080de8c2c57e3199eee837fe8b6d35a43679f8c1

Authored by Stefan Richter
1 parent 17cff9ff87

firewire: fw-ohci: add option for remote debugging

This way firewire-ohci can be used for remote debugging like ohci1394.
Version with amendment from Fri, 11 Apr 2008 00:08:08 +0200.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Acked-by: Bernhard Kaindl <bk@suse.de>

Showing 3 changed files with 31 additions and 7 deletions Side-by-side Diff

Documentation/debugging-via-ohci1394.txt
... ... @@ -41,15 +41,19 @@
41 41 This can be turned off by ohci1394's module parameter phys_dma=0.
42 42  
43 43 The alternative firewire-ohci driver in drivers/firewire uses filtered physical
44   -DMA, hence is not yet suitable for remote debugging.
  44 +DMA by default, which is more secure but not suitable for remote debugging.
  45 +Compile the driver with CONFIG_FIREWIRE_OHCI_REMOTE_DMA (Kernel hacking menu:
  46 +Remote debugging over FireWire with firewire-ohci) to get unfiltered physical
  47 +DMA.
45 48  
46   -Because ohci1394 depends on the PCI enumeration to be completed, an
47   -initialization routine which runs pretty early (long before console_init()
48   -which makes the printk buffer appear on the console can be called) was written.
  49 +Because ohci1394 and firewire-ohci depend on the PCI enumeration to be
  50 +completed, an initialization routine which runs pretty early has been
  51 +implemented for x86. This routine runs long before console_init() can be
  52 +called, i.e. before the printk buffer appears on the console.
49 53  
50 54 To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu:
51   -Provide code for enabling DMA over FireWire early on boot) and pass the
52   -parameter "ohci1394_dma=early" to the recompiled kernel on boot.
  55 +Remote debugging over FireWire early on boot) and pass the parameter
  56 +"ohci1394_dma=early" to the recompiled kernel on boot.
53 57  
54 58 Tools
55 59 -----
drivers/firewire/fw-ohci.c
... ... @@ -1097,6 +1097,11 @@
1097 1097 reg_write(ohci, OHCI1394_ConfigROMhdr, ohci->next_header);
1098 1098 }
1099 1099  
  1100 +#ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA
  1101 + reg_write(ohci, OHCI1394_PhyReqFilterHiSet, ~0);
  1102 + reg_write(ohci, OHCI1394_PhyReqFilterLoSet, ~0);
  1103 +#endif
  1104 +
1100 1105 spin_unlock_irqrestore(&ohci->lock, flags);
1101 1106  
1102 1107 if (free_rom)
... ... @@ -1435,6 +1440,9 @@
1435 1440 static int
1436 1441 ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
1437 1442 {
  1443 +#ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA
  1444 + return 0;
  1445 +#else
1438 1446 struct fw_ohci *ohci = fw_ohci(card);
1439 1447 unsigned long flags;
1440 1448 int n, retval = 0;
... ... @@ -1466,6 +1474,7 @@
1466 1474 out:
1467 1475 spin_unlock_irqrestore(&ohci->lock, flags);
1468 1476 return retval;
  1477 +#endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */
1469 1478 }
1470 1479  
1471 1480 static u64
... ... @@ -593,7 +593,7 @@
593 593 to find out which userspace is blocking on what kernel operations.
594 594  
595 595 config PROVIDE_OHCI1394_DMA_INIT
596   - bool "Provide code for enabling DMA over FireWire early on boot"
  596 + bool "Remote debugging over FireWire early on boot"
597 597 depends on PCI && X86
598 598 help
599 599 If you want to debug problems which hang or crash the kernel early
... ... @@ -620,6 +620,17 @@
620 620 in charge of the OHCI-1394 controllers should be used instead.
621 621  
622 622 See Documentation/debugging-via-ohci1394.txt for more information.
  623 +
  624 +config FIREWIRE_OHCI_REMOTE_DMA
  625 + bool "Remote debugging over FireWire with firewire-ohci"
  626 + depends on FIREWIRE_OHCI
  627 + help
  628 + This option lets you use the FireWire bus for remote debugging
  629 + with help of the firewire-ohci driver. It enables unfiltered
  630 + remote DMA in firewire-ohci.
  631 + See Documentation/debugging-via-ohci1394.txt for more information.
  632 +
  633 + If unsure, say N.
623 634  
624 635 source "samples/Kconfig"