Skip to contentSkip to conversation

New: kernel oops in firewire_ohci

Bug 9160 Stefan Richter 5 participants 15 messages Oct 13, 2007 – Dec 22, 2007

lore
Share & tools
lore
#0 lore raw

For the linux1394-devel and sparclinux mailinglists to see:

Since Linux 2.6.23, the firewire-ohci driver oopses on startup when it sets up its AR DMA contexts (AR = asynchronous reception). See quote from bugzilla below.

The last modification that directly affected firewire-ohci's AR DMA was already before 2.6.22 (firewire: fix async reception on big endian machines).
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=history;f=drivers/firewire/fw-ohci.c

Patches to fw-ohci.c in 2.6.23 which are not in 2.6.22.9:

firewire: missing newline in printk
firewire: fw-ohci: flush MMIO write before msleep
firewire: fw-ohci: dma_free_coherent needs IRQs enabled

They are all obviously unrelated to the bug.

Quoted 118 lines · [email protected] wrote:

http://bugzilla.kernel.org/show_bug.cgi?id‘60

           Summary: kernel oops in firewire_ohci
           Product: Drivers
           Version: 2.5
     KernelVersion: 2.6.23.1
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: IEEE1394
        AssignedTo: [email protected]
        ReportedBy: [email protected]

Most recent kernel where this bug did not occur: 2.6.22.9
Distribution: Gentoo
Hardware Environment: Sparc64 (Blade 100 UltraSPARC 2e) Software Environment:
Problem Description:

I found a kernel oops in /var/log/messages after booting both my Blade 100s. The oops appears to have triggered by firewire_ohci, but I'm no kernel hacker and could be mistaken.

Here is the text of one of them. The one from the other machine is identical except for the timestamps and machine name.

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
Oct 13 20:26:04 succubus \|/ ____ \|/
Oct 13 20:26:04 succubus "@'/ .. \`@"
Oct 13 20:26:04 succubus /_| \__/ |_\
Oct 13 20:26:04 succubus \__U_/
Oct 13 20:26:04 succubus modprobe(648): Oops [#1]
Oct 13 20:26:04 succubus TSTATE: 0000001911009601 TPC: 0000000000000000 TNPC: 0000000000000004 Y: 00000000    Not tainted
Oct 13 20:26:04 succubus TPC: <0x8>
Oct 13 20:26:04 succubus g0: 0000000000470a40 g1: 00000000005d2b28 g2: 0000000000000000 g3: 0000000000000000
Oct 13 20:26:04 succubus g4: fffff8004f393480 g5: 0000000000000098 g6: fffff8004fa74000 g7: 00c06500180065c0
Oct 13 20:26:04 succubus o0: fffff8004effb870 o1: 00000000c0650000 o2: 0000000000002000 o3: 0000000000000000
Oct 13 20:26:04 succubus o4: 0000000000000004 o5: 000001ff00420000 sp: fffff8004fa76e71 ret_pc: 0000000010068cd0
Oct 13 20:26:04 succubus RPC: <ar_context_add_page+0xd8/0x160 [firewire_ohci]>
Oct 13 20:26:04 succubus l0: fffff8004fba4000 l1: 00000000c0650000 l2: fffff8004effb870 l3: fffff8004f608d90
Oct 13 20:26:04 succubus l4: 000000000063cc00 l5: 0000000000ff0000 l6: fffff8004fa776e0 l7: fffffffffffffff0
Oct 13 20:26:04 succubus i0: 000000000000ff00 i1: 0000000010069cc0 i2: fffff8004f608d90 i3: 0000000000000000
Oct 13 20:26:04 succubus i4: 0000000000000040 i5: 0000000000000000 i6: fffff8004fa76f31 i7: 0000000010068d90
Oct 13 20:26:04 succubus I7: <ar_context_init+0x38/0x60 [firewire_ohci]>
Oct 13 20:26:04 succubus Caller[0000000010068d90]: ar_context_init+0x38/0x60 [firewire_ohci]
Oct 13 20:26:04 succubus Caller[000000001006ac50]: pci_probe+0xf8/0x340 [firewire_ohci]
Oct 13 20:26:04 succubus Caller[00000000005299bc]: pci_device_probe+0x64/0xa0
Oct 13 20:26:04 succubus Caller[0000000000550a28]: driver_probe_device+0x90/0x1c0
Oct 13 20:26:04 succubus Caller[0000000000550bc0]: __driver_attach+0x68/0x80
Oct 13 20:26:04 succubus Caller[000000000054fe5c]: bus_for_each_dev+0x44/0x80
Oct 13 20:26:04 succubus Caller[0000000000550218]: bus_add_driver+0x80/0x1c0
Oct 13 20:26:04 succubus Caller[0000000000529b7c]: __pci_register_driver+0x44/0xa0
Oct 13 20:26:04 succubus Caller[000000000047d5cc]: sys_init_module+0x134/0x1400
Oct 13 20:26:04 succubus Caller[0000000000406094]: linux_sparc_syscall32+0x3c/0x40
Oct 13 20:26:04 succubus Caller[00000000000133d8]: 0x133e0
Oct 13 20:26:04 succubus Instruction DUMP: 01000000  01000000  01000000
<1>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
Oct 13 20:26:04 succubus \|/ ____ \|/
Oct 13 20:26:04 succubus "@'/ .. \`@"
Oct 13 20:26:04 succubus /_| \__/ |_\
Oct 13 20:26:04 succubus \__U_/
Oct 13 20:26:04 succubus modprobe(648): Oops [#2]
Oct 13 20:26:04 succubus TSTATE: 0000004480009605 TPC: 0000000000428a5c TNPC: 0000000000428a60 Y: 00000000    Tainted: G      D
Oct 13 20:26:04 succubus TPC: <instruction_dump+0x44/0xa0>
Oct 13 20:26:04 succubus g0: 78745f6164645f70 g1: 000000000063def0 g2: 0000000000000000 g3: 000000000063dc00
Oct 13 20:26:04 succubus g4: fffff8004f393480 g5: 0000000000000098 g6: fffff8004fa74000 g7: 000000000063def0
Oct 13 20:26:04 succubus o0: 00000000006050d0 o1: 000000000000003c o2: 0000000001000000 o3: 000000000000003e
Oct 13 20:26:04 succubus o4: 0000000010068d90 o5: 000000000068d168 sp: fffff8004fa76aa1 ret_pc: 0000000000428a80
Oct 13 20:26:04 succubus RPC: <instruction_dump+0x68/0xa0>
Oct 13 20:26:04 succubus l0: 0000000000000000 l1: 0000000000605000 l2: 0000000000000000 l3: 0000001911009601
Oct 13 20:26:04 succubus l4: 0000000000000000 l5: 000000000063dc00 l6: 000000000063dc00 l7: 0000000000000000
Oct 13 20:26:04 succubus i0: 0000000000000000 i1: 00000000000133e0 i2: fffff8004fa775d0 i3: 0000000000000000
Oct 13 20:26:04 succubus i4: 00000000000000ff i5: 000000000000000b i6: fffff8004fa76b61 i7: 00000000004294b8
Oct 13 20:26:04 succubus I7: <die_if_kernel+0x160/0x2c0>
Oct 13 20:26:04 succubus Caller[00000000004294b8]: die_if_kernel+0x160/0x2c0
Oct 13 20:26:04 succubus Caller[000000000044d130]: unhandled_fault+0x78/0xe0
Oct 13 20:26:04 succubus Caller[00000000004076f4]: sparc64_realfault_common+0x18/0x20
Oct 13 20:26:04 succubus Caller[0000000010068cd0]: ar_context_add_page+0xd8/0x160 [firewire_ohci]
Oct 13 20:26:04 succubus Caller[0000000010068d90]: ar_context_init+0x38/0x60 [firewire_ohci]
Oct 13 20:26:04 succubus Caller[000000001006ac50]: pci_probe+0xf8/0x340 [firewire_ohci]
Oct 13 20:26:04 succubus Caller[00000000005299bc]: pci_device_probe+0x64/0xa0
Oct 13 20:26:04 succubus Caller[0000000000550a28]: driver_probe_device+0x90/0x1c0
Oct 13 20:26:04 succubus Caller[0000000000550bc0]: __driver_attach+0x68/0x80
Oct 13 20:26:04 succubus Caller[000000000054fe5c]: bus_for_each_dev+0x44/0x80
Oct 13 20:26:04 succubus Caller[0000000000550218]: bus_add_driver+0x80/0x1c0
Oct 13 20:26:04 succubus Caller[0000000000529b7c]: __pci_register_driver+0x44/0xa0
Oct 13 20:26:04 succubus Caller[000000000047d5cc]: sys_init_module+0x134/0x1400
Oct 13 20:26:04 succubus Caller[0000000000406094]: linux_sparc_syscall32+0x3c/0x40
Oct 13 20:26:04 succubus Caller[00000000000133d8]: 0x133e0
Oct 13 20:26:04 succubus Instruction DUMP: 80a42000  12480005  9610203e <d4060000> 4000cf10  a0102001  833c2000  901460d0  83287002
Signature · 2 lines
Stefan Richter
-===-=-== =-=- -=-http://arcgraph.de/sr/
#1 lore raw

No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

Stefan Richter wrote on 2007-10-13:

Quoted 2 lines
Quoted 1 line · [email protected] wrote:

http://bugzilla.kernel.org/show_bug.cgi?id‘60

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&m8751438108687 in August.

Quoted 13 lines
Quoted 13 lines
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
Quoted 8 lines
Quoted 8 lines
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,

Signature · 3 lines
Stefan Richter
-===-=-== =-- =--=-
http://arcgraph.de/sr/
#2 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

From: Stefan Richter <[email protected]>
Date: Tue, 18 Dec 2007 00:53:03 +0100

Quoted 9 lines

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?

The problem is likely what device struct you are passing to dma_sync_single_for_device(), it has to be a real pci_dev or similar that has it's dev_archdata properly initialized.

I bet dev_archdata in whatever "struct device" is being passed in has a NULL iommu pointer or something like that.

Oh yeah, I see what you're doing, that won't work, please pass in the correct device struct pointer. Please pass in the &pci_dev->dev not this ohci->card.device thing.

#3 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

[As pointed out elsewhere in the thread, this is indeed about sparc64, not sparc per se.]

Quoted 17 lines · David Miller

From: Stefan Richter <[email protected]>
Date: Tue, 18 Dec 2007 00:53:03 +0100

Quoted 9 lines

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?

The problem is likely what device struct you are passing to dma_sync_single_for_device(), it has to be a real pci_dev or similar that has it's dev_archdata properly initialized.

Quoted 6 lines

I bet dev_archdata in whatever "struct device" is being passed in has a NULL iommu pointer or something like that.

Oh yeah, I see what you're doing, that won't work, please pass in the correct device struct pointer. Please pass in the &pci_dev->dev not this ohci->card.device thing.

No, the dev argument is alright. We use it a few lines above in the same function in a call to dma_map_single(). The dev argument is IMO correctly obtained here:

static int
pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)

{
	...
	fw_card_initialize(&ohci->card, &ohci_driver, &dev->dev);
	...
}

void
fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver, struct device *device)

{
	...
	card->device = device;
	...
}

So, ohci->card.device is in fact &pci_dev->dev.

Also note:
- The very same code did not oops at this point in 2.6.22. It only

    started doing so in 2.6.23.

- There has been no other report of this kind for any other architecture yet. I would expect e.g. the PPC64 folks to report bugs in our dma mappings eventually.

-----
Two footnotes:

- Although the 2.6.22 firewire subsystem does not oops during the
pci_probe like it does in 2.6.23 and 2.6.24, it does lock up sometime later during actual use. However this is not surprising, as I found and fixed some portential DMA mapping issues in the fw-sbp2 highlevel driver sometime after 2.6.22. But due to the pci_probe problem, the firewire subsystem doesn't get as far on sparc64 on 2.6.23 and 2.6.24.

- One thing which we do slightly wrong in ar_context_add_page() is that we
1.) dma-map the buffer,
2.) continue to write into the buffer from the CPU,
3.) then sync it for the device.
I let the reporter try a patch which inserted a dma_sync_single_for_cpu() right after the dma_map_single() in order to be clearly entitled to access the buffer by the CPU, but that didn't fix it.

Signature · 3 lines
Stefan Richter
-===-=-== =-- =--=-
http://arcgraph.de/sr/
#4 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

From: Stefan Richter <[email protected]>
Date: Tue, 18 Dec 2007 11:38:27 +0100

Quoted 3 lines

Also note:
- The very same code did not oops at this point in 2.6.22. It only

    started doing so in 2.6.23.

2.6.23 is when the sparc64 IOMMU code started relying upon the dev_archdata bits being correct.

#5 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

Quoted 9 lines · David Miller

From: Stefan Richter <[email protected]>
Date: Tue, 18 Dec 2007 11:38:27 +0100

Quoted 3 lines

Also note:
- The very same code did not oops at this point in 2.6.22. It only

    started doing so in 2.6.23.

2.6.23 is when the sparc64 IOMMU code started relying upon the dev_archdata bits being correct.

And why are the dev_archdata corrupt?
Does arch/sparc64/kernel/pci.c fill them in incorrectly or too late?

drivers/firewire/fw_ohci.c needs them for dma_map_single() + dma_sync_single_for_device() in the pci_driver.probe(), sometime after it called pci_enable_device(), before finishing the probe.

Signature · 3 lines
Stefan Richter
-===-=-== =-- =--=
http://arcgraph.de/sr/
#6 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

From: Stefan Richter <[email protected]>
Date: Wed, 19 Dec 2007 17:33:05 +0100

Quoted 3 lines

drivers/firewire/fw_ohci.c needs them for dma_map_single() + dma_sync_single_for_device() in the pci_driver.probe(), sometime after it called pci_enable_device(), before finishing the probe.

I'll take a look at this and try to figure out exactly what might be going wrong.

The dev_archdata should be fully setup at this time.

#7 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

In reply to Stefan Richter

From: Stefan Richter <[email protected]>
Date: Wed, 19 Dec 2007 17:33:05 +0100

Quoted 1 line

Does arch/sparc64/kernel/pci.c fill them in incorrectly or too late?

The problem is that I created indirection that was totally unused, the operation vectors members for these cases thus didn't get filled in, and we OOPS trying to call NULL pointers as functions :-)

This should fix the crash:

include/asm-sparc64/dma-mapping.h +3 -9
index 1fc6554..38cbec7 100644
@@ -25,15 +25,9 @@ struct dma_ops {
 	void (*sync_single_for_cpu)(struct device *dev,
 				    dma_addr_t dma_handle, size_t size,
 				    enum dma_data_direction direction);
-	void (*sync_single_for_device)(struct device *dev,
-				       dma_addr_t dma_handle, size_t size,
-				       enum dma_data_direction direction);
 	void (*sync_sg_for_cpu)(struct device *dev, struct scatterlist *sg,
 				int nelems,
 				enum dma_data_direction direction);
-	void (*sync_sg_for_device)(struct device *dev, struct scatterlist *sg,
-				   int nelems,
-				   enum dma_data_direction direction);
 };
 extern const struct dma_ops *dma_ops;
 
@@ -105,7 +99,7 @@ static inline void dma_sync_single_for_device(struct device *dev,
 					      size_t size,
 					      enum dma_data_direction direction)
 {
-	dma_ops->sync_single_for_device(dev, dma_handle, size, direction);
+	/* No flushing needed to sync cpu writes to the device.  */
 }
 
 static inline void dma_sync_single_range_for_cpu(struct device *dev,
@@ -123,7 +117,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
 						    size_t size,
 						    enum dma_data_direction direction)
 {
-	dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
+	/* No flushing needed to sync cpu writes to the device.  */
 }
 
 
@@ -138,7 +132,7 @@ static inline void dma_sync_sg_for_device(struct device *dev,
 					  struct scatterlist *sg, int nelems,
 					  enum dma_data_direction direction)
 {
-	dma_ops->sync_sg_for_device(dev, sg, nelems, direction);
+	/* No flushing needed to sync cpu writes to the device.  */
 }
 
 static inline int dma_mapping_error(dma_addr_t dma_addr)
#8 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

Quoted 5 lines · David Miller

The problem is that I created indirection that was totally unused, the operation vectors members for these cases thus didn't get filled in, and we OOPS trying to call NULL pointers as functions :-)

This should fix the crash:

It does, tested on a Sun Blade 2000.

Thank you David.
ciao,
ema

#9 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

Quoted 8 lines · Emanuele Rocca
Quoted 5 lines · David Miller

The problem is that I created indirection that was totally unused, the operation vectors members for these cases thus didn't get filled in, and we OOPS trying to call NULL pointers as functions :-)

This should fix the crash:

It does, tested on a Sun Blade 2000.

Thanks David and Emanuele. I haven't got feedback from the other reporter yet but I assume this fixes the issue
(http://bugzilla.kernel.org/show_bug.cgi?id‘60).

Signature · 3 lines
Stefan Richter
-===-=-== =-- =-=-
http://arcgraph.de/sr/
#10 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

In reply to Stefan Richter

From: Stefan Richter <[email protected]>
Date: Tue, 18 Dec 2007 11:38:27 +0100

Quoted 3 lines

- There has been no other report of this kind for any other architecture yet. I would expect e.g. the PPC64 folks to report bugs in our dma mappings eventually.

Irrelevant fact, powerpc handles it's dev_archdata differently from sparc64.

#11 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

In reply to Stefan Richter
Quoted 8 lines · Stefan Richter

So, ohci->card.device is in fact &pci_dev->dev.

Also note:
- The very same code did not oops at this point in 2.6.22. It only

    started doing so in 2.6.23.

- There has been no other report of this kind for any other architecture yet. I would expect e.g. the PPC64 folks to report bugs in our dma mappings eventually.

Ignore my previous message... if you are indeed passing &pci_dev->dev, it should work.

Ben.

#12 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

In reply to David Miller
Quoted 10 lines · David Miller

The problem is likely what device struct you are passing to dma_sync_single_for_device(), it has to be a real pci_dev or similar that has it's dev_archdata properly initialized.

I bet dev_archdata in whatever "struct device" is being passed in has a NULL iommu pointer or something like that.

Oh yeah, I see what you're doing, that won't work, please pass in the correct device struct pointer. Please pass in the &pci_dev->dev not this ohci->card.device thing.

Yup, this would crash on powerpc 64 bits as well for the same reason.

Ben.

#13 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

In reply to Stefan Richter
Quoted 3 lines · Stefan Richter

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

How do you achieve a sparc system with firewire ?
AFAIK there is no SBUS firewire card.

Only sparc64 and some rare javastations have PCI slots.

#14 lore raw

Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)

From: Chris Newport <[email protected]>
Date: Tue, 18 Dec 2007 02:58:29 +0000 (GMT)

Quoted 8 lines · Stefan Richter
Quoted 4 lines

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

How do you achieve a sparc system with firewire ?
AFAIK there is no SBUS firewire card.

He means sparc64, which have PCI firewire onboard many systems.