linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Ingo Molnar <mingo@elte.hu>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	Bernhard Kaindl <bk@suse.de>
Subject: [PATCH linux1394-2.6.git] firewire: fw-ohci: add option for remote debugging - amendment
Date: Thu, 10 Apr 2008 21:05:47 +0200 (CEST)	[thread overview]
Message-ID: <tkrat.88330c779367ee9d@s5r6.in-berlin.de> (raw)
In-Reply-To: <20080410095112.GB12543@elte.hu>

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@s5r6.in-berlin.de>
---

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/



  reply	other threads:[~2008-04-10 19:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09  8:53 linux-next: Tree for April 9 Stephen Rothwell
     [not found] ` <d711229d0804090400p1c92a158j381b86e207a6f38a@mail.gmail.com>
2008-04-09 11:09   ` Stephen Rothwell
2008-04-09 11:27     ` Stephen Rothwell
2008-04-09 11:26       ` Jacek Luczak
2008-04-09 11:34         ` Ingo Molnar
2008-04-09 11:55           ` Jacek Luczak
2008-04-09 12:01           ` Ingo Molnar
2008-04-09 11:31       ` Ingo Molnar
2008-04-09 14:50         ` Cyrill Gorcunov
2008-04-09 15:03           ` Ingo Molnar
2008-04-09 15:18             ` Cyrill Gorcunov
2008-04-09 16:55 ` Stefan Richter
2008-04-10  0:45   ` Stephen Rothwell
2008-04-10  6:52   ` Ingo Molnar
2008-04-10  7:44     ` Stephen Rothwell
2008-04-10  7:52       ` debug Kconfig option (was Re: linux-next: Tree for April 9) Stefan Richter
2008-04-10  9:51         ` Ingo Molnar
2008-04-10 19:05           ` Stefan Richter [this message]
2008-04-10 22:08             ` [PATCH linux1394-2.6.git] firewire: fw-ohci: add option for remote debugging - amendment Stefan Richter
2008-04-10 15:01         ` debug Kconfig option (was Re: linux-next: Tree for April 9) Randy Dunlap
2008-04-10  9:48       ` linux-next: Tree for April 9 Ingo Molnar
2008-04-10 19:02         ` Stefan Richter
2008-04-10  9:39 ` [BUG] linux-next: Tree for April 9 warning on CC_STACKPROTECTOR, followed by kernel panic Kamalesh Babulal
2008-04-10 10:14   ` Jacek Luczak
2008-04-10 10:51     ` Kamalesh Babulal
2008-04-10 10:58       ` Jacek Luczak
2008-04-10 11:47   ` Stephen Rothwell
2008-04-11  9:45     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tkrat.88330c779367ee9d@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=bk@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=mingo@elte.hu \
    --cc=randy.dunlap@oracle.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).