public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: sparclinux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Greg Kroah-Hartman" <gregkh@suse.de>,
	"Kristian Høgsberg" <krh@bitplanet.net>,
	linux1394-devel@lists.sourceforge.net
Subject: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)
Date: Tue, 18 Dec 2007 00:53:03 +0100	[thread overview]
Message-ID: <47670BDF.80409@s5r6.in-berlin.de> (raw)
In-Reply-To: <47112797.7060003@s5r6.in-berlin.de>

Stefan Richter wrote on 2007-10-13:
> bugme-daemon@bugzilla.kernel.org wrote:
>> http://bugzilla.kernel.org/show_bug.cgi?id=9160

It's a 100% reproducible oops on Sparc (with FireWire controller) for
2.6.23 and 2.6.24 kernels, but not 2.6.22.  The reporter confirmed that
the bug also happens
  - with plain 2.6.24-rc5,
  - with 2.6.23.y and the firewire subsystem fully reverted to that of
    2.6.22.

This has also been reported independently once before against
2.6.23-rc3, http://marc.info/?l=linux-sparc&m=118751438108687 in August.

>> Oct 13 20:26:04 succubus OOPS: Bogus kernel PC [0000000000000000] in fault handler
>> Oct 13 20:26:04 succubus OOPS: RPC [0000000010068cd0]
>> Oct 13 20:26:04 succubus RPC: <ar_context_add_page+0xd8/0x160 [firewire_ohci]>
>> Oct 13 20:26:04 succubus OOPS: Fault was to vaddr[1004e000]
>> Oct 13 20:26:04 succubus Call Trace:
>> Oct 13 20:26:04 succubus [00000000004076f4] sparc64_realfault_common+0x18/0x20
>> Oct 13 20:26:04 succubus [0000000010068cd0] ar_context_add_page+0xd8/0x160 [firewire_ohci]
>> Oct 13 20:26:04 succubus [0000000010068d90] ar_context_init+0x38/0x60 [firewire_ohci]
>> Oct 13 20:26:04 succubus [000000001006ac50] pci_probe+0xf8/0x340 [firewire_ohci]
>> Oct 13 20:26:04 succubus [00000000005299bc] pci_device_probe+0x64/0xa0
>> Oct 13 20:26:04 succubus [0000000000550a28] driver_probe_device+0x90/0x1c0
>> Oct 13 20:26:04 succubus [0000000000550bc0] __driver_attach+0x68/0x80
>> Oct 13 20:26:04 succubus [000000000054fe5c] bus_for_each_dev+0x44/0x80
>> Oct 13 20:26:04 succubus [0000000000550218] bus_add_driver+0x80/0x1c0
>> Oct 13 20:26:04 succubus [0000000000529b7c] __pci_register_driver+0x44/0xa0
>> Oct 13 20:26:04 succubus [000000000047d5cc] sys_init_module+0x134/0x1400
>> Oct 13 20:26:04 succubus [0000000000406094] linux_sparc_syscall32+0x3c/0x40
>> Oct 13 20:26:04 succubus [00000000000133d8] 0x133e0
>> Oct 13 20:26:04 succubus Unable to handle kernel NULL pointer dereference
>> Oct 13 20:26:04 succubus tsk->{mm,active_mm}->context = 00000000000001f9
>> Oct 13 20:26:04 succubus tsk->{mm,active_mm}->pgd = fffff8004f9f8000
[...]

The fault happens due to dma_sync_single_for_device() which
drivers/firewire/fw-ohci.c calls in ar_context_add_page() when still
being in its pci_probe method.  I suspect that --- at least on Sparc and
after 2.6.22 --- it is not possible anymore to use dma_sync_* before the
pci_device's or device's probe was finished.

Would that be a bug in the Sparc platform code?  Or a bug in driver core
code or in PCI code?  Or am I expected to refrain from dma_sync_* calls
until after the probe returned?

(Doing the latter might be tricky, but I suspect that the AR buffers in
fw-ohci would generally be better off using coherent allocations.  The
DMA mapping and syncing in this part of fw-ohci is currently slightly
messy.)

Thanks for any comments,
-- 
Stefan Richter
-=====-=-=== ==-- =--=-
http://arcgraph.de/sr/

       reply	other threads:[~2007-12-17 23:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-9160-4803@http.bugzilla.kernel.org/>
     [not found] ` <47112797.7060003@s5r6.in-berlin.de>
2007-12-17 23:53   ` Stefan Richter [this message]
2007-12-18  0:50     ` No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression) David Miller
2007-12-18 10:38       ` Stefan Richter
2007-12-18 22:29         ` David Miller
2007-12-19 16:33           ` Stefan Richter
2007-12-19 23:06             ` David Miller
2007-12-20  8:40             ` David Miller
2007-12-20 20:19               ` Emanuele Rocca
2007-12-22 13:10                 ` Stefan Richter
2007-12-18 22:30         ` David Miller
2007-12-19 21:08         ` Benjamin Herrenschmidt
2007-12-19 21:07       ` Benjamin Herrenschmidt
2007-12-18  2:58     ` Chris Newport
2007-12-18  3:03       ` David Miller

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=47670BDF.80409@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=davem@davemloft.net \
    --cc=gregkh@suse.de \
    --cc=krh@bitplanet.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=sparclinux@vger.kernel.org \
    /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