diff options
-rw-r--r-- | Documentation/debugging-via-ohci1394.txt | 16 | ||||
-rw-r--r-- | drivers/firewire/fw-ohci.c | 9 | ||||
-rw-r--r-- | lib/Kconfig.debug | 13 |
3 files changed, 31 insertions, 7 deletions
diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt index c360d4e91b48..59a91e5c6909 100644 --- a/Documentation/debugging-via-ohci1394.txt +++ b/Documentation/debugging-via-ohci1394.txt | |||
@@ -41,15 +41,19 @@ to a working state and enables physical DMA by default for all remote nodes. | |||
41 | This can be turned off by ohci1394's module parameter phys_dma=0. | 41 | This can be turned off by ohci1394's module parameter phys_dma=0. |
42 | 42 | ||
43 | The alternative firewire-ohci driver in drivers/firewire uses filtered physical | 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 | 49 | Because ohci1394 and firewire-ohci depend on the PCI enumeration to be |
47 | initialization routine which runs pretty early (long before console_init() | 50 | completed, an initialization routine which runs pretty early has been |
48 | which makes the printk buffer appear on the console can be called) was written. | 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 | To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu: | 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 | 55 | Remote debugging over FireWire early on boot) and pass the parameter |
52 | parameter "ohci1394_dma=early" to the recompiled kernel on boot. | 56 | "ohci1394_dma=early" to the recompiled kernel on boot. |
53 | 57 | ||
54 | Tools | 58 | Tools |
55 | ----- | 59 | ----- |
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c index 07d6053ff57e..5da7c6715e1e 100644 --- a/drivers/firewire/fw-ohci.c +++ b/drivers/firewire/fw-ohci.c | |||
@@ -1097,6 +1097,11 @@ static void bus_reset_tasklet(unsigned long data) | |||
1097 | reg_write(ohci, OHCI1394_ConfigROMhdr, ohci->next_header); | 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 | spin_unlock_irqrestore(&ohci->lock, flags); | 1105 | spin_unlock_irqrestore(&ohci->lock, flags); |
1101 | 1106 | ||
1102 | if (free_rom) | 1107 | if (free_rom) |
@@ -1435,6 +1440,9 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) | |||
1435 | static int | 1440 | static int |
1436 | ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation) | 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 | struct fw_ohci *ohci = fw_ohci(card); | 1446 | struct fw_ohci *ohci = fw_ohci(card); |
1439 | unsigned long flags; | 1447 | unsigned long flags; |
1440 | int n, retval = 0; | 1448 | int n, retval = 0; |
@@ -1466,6 +1474,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation) | |||
1466 | out: | 1474 | out: |
1467 | spin_unlock_irqrestore(&ohci->lock, flags); | 1475 | spin_unlock_irqrestore(&ohci->lock, flags); |
1468 | return retval; | 1476 | return retval; |
1477 | #endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */ | ||
1469 | } | 1478 | } |
1470 | 1479 | ||
1471 | static u64 | 1480 | static u64 |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 0796c1a090c0..78955eb6bd94 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -593,7 +593,7 @@ config LATENCYTOP | |||
593 | to find out which userspace is blocking on what kernel operations. | 593 | to find out which userspace is blocking on what kernel operations. |
594 | 594 | ||
595 | config PROVIDE_OHCI1394_DMA_INIT | 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 | depends on PCI && X86 | 597 | depends on PCI && X86 |
598 | help | 598 | help |
599 | If you want to debug problems which hang or crash the kernel early | 599 | If you want to debug problems which hang or crash the kernel early |
@@ -621,4 +621,15 @@ config PROVIDE_OHCI1394_DMA_INIT | |||
621 | 621 | ||
622 | See Documentation/debugging-via-ohci1394.txt for more information. | 622 | See Documentation/debugging-via-ohci1394.txt for more information. |
623 | 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. | ||
634 | |||
624 | source "samples/Kconfig" | 635 | source "samples/Kconfig" |