public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Kernel Panic during memcpy_toio to PCI card
@ 2002-11-01 20:06 Donepudi, Suneeta
  0 siblings, 0 replies; 6+ messages in thread
From: Donepudi, Suneeta @ 2002-11-01 20:06 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'; +Cc: Donepudi, Suneeta

Hi,

I would like help in diagnosing a kernel panic while accessing a PCI device.

Everything runs fine for sometime and in about 1/2 hour I get a Kernel Panic
message saying :

"Unable to handle kernel paging request at virtual address 0xc2821000"

Analysis with Ksymoops shows that it is happening during a memcpy_toio()
with the PCI card. The PCI card uses three Base Address Registers with
virtual addresses mapped as follows (after ioremap has been issued):

BAR0 = 0xc280f000
BAR1 = 0xc2811000
BAR2 = 0xc2822000

It seems like the kernel panic is complaining about an address which is a
combination of BAR1 (lower bytes) and BAR2 (upper bytes). It should really
be accessing the BAR1 address at the point the crash occurred.

I put the following if-statement just before the memcpy_toio():
-----------------------------------------------------------
if (((long int)pci_bar1) == 0xc2821000)
{
	printk (KERN_ERR "Illegal address for BAR1\n");
	return -1;
}
memcpy_toio (pci_bar1, in_ptr, len);
------------------------------------------------------------

It still caused the crash in the same manner and at the same location.
Could someone help me with pointers to where I should start looking ?
Disabling interrupts around the memcpy_toio() did not make any
difference. Is this a hardware problem with the PCI card ? We are using
a Xilinx core with out FPGA build into it.
Is there a book I could read to learn more about debugging this in the 
Kernel ?

Thanks a bunch,
Suneeta


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Kernel Panic during memcpy_toio to PCI card
@ 2002-11-01 20:34 Donepudi, Suneeta
  2002-11-01 23:28 ` Matt D. Robinson
  0 siblings, 1 reply; 6+ messages in thread
From: Donepudi, Suneeta @ 2002-11-01 20:34 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'; +Cc: 'Matt D. Robinson'


Matt,

Thanks for the response, I am using a 2.4.18 kernel with
a busybox. This is an embedded system with the file system
laid out by an 'initrd.gz'. I am new to Linux. Can LKCD
still be used in our case ?


Suneeta

-----Original Message-----
From: Matt D. Robinson [mailto:yakker@aparity.com]
Sent: Friday, November 01, 2002 3:26 PM
To: Donepudi, Suneeta; Matt D. Robinson
Subject: Re: Kernel Panic during memcpy_toio to PCI card


Hey, Suneeta.  Can you try LKCD and see if you can get
a crash dump with it?  Also, is this 2.4 or 2.5?

--Matt

On Fri, 1 Nov 2002, Donepudi, Suneeta wrote:
|>Hi,
|>
|>I would like help in diagnosing a kernel panic while accessing a PCI
device.
|>
|>Everything runs fine for sometime and in about 1/2 hour I get a Kernel
Panic
|>message saying :
|>
|>"Unable to handle kernel paging request at virtual address 0xc2821000"
|>
|>Analysis with Ksymoops shows that it is happening during a memcpy_toio()
|>with the PCI card. The PCI card uses three Base Address Registers with
|>virtual addresses mapped as follows (after ioremap has been issued):
|>
|>BAR0 = 0xc280f000
|>BAR1 = 0xc2811000
|>BAR2 = 0xc2822000
|>
|>It seems like the kernel panic is complaining about an address which is a
|>combination of BAR1 (lower bytes) and BAR2 (upper bytes). It should really
|>be accessing the BAR1 address at the point the crash occurred.
|>
|>I put the following if-statement just before the memcpy_toio():
|>-----------------------------------------------------------
|>if (((long int)pci_bar1) == 0xc2821000)
|>{
|>	printk (KERN_ERR "Illegal address for BAR1\n");
|>	return -1;
|>}
|>memcpy_toio (pci_bar1, in_ptr, len);
|>------------------------------------------------------------
|>
|>It still caused the crash in the same manner and at the same location.
|>Could someone help me with pointers to where I should start looking ?
|>Disabling interrupts around the memcpy_toio() did not make any
|>difference. Is this a hardware problem with the PCI card ? We are using
|>a Xilinx core with out FPGA build into it.
|>Is there a book I could read to learn more about debugging this in the 
|>Kernel ?
|>
|>Thanks a bunch,
|>Suneeta

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Kernel Panic during memcpy_toio to PCI card
  2002-11-01 20:34 Kernel Panic during memcpy_toio to PCI card Donepudi, Suneeta
@ 2002-11-01 23:28 ` Matt D. Robinson
  2002-11-01 23:29   ` Dave Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Matt D. Robinson @ 2002-11-01 23:28 UTC (permalink / raw)
  To: Donepudi, Suneeta; +Cc: 'linux-kernel@vger.kernel.org'

Yes, grab the 4.1.1 stuff from lkcd.sourceforge.net.  Let the
lkcd-general list know if you're having problems, one of us
should be able to help.

--Matt

On Fri, 1 Nov 2002, Donepudi, Suneeta wrote:
|>Matt,
|>
|>Thanks for the response, I am using a 2.4.18 kernel with
|>a busybox. This is an embedded system with the file system
|>laid out by an 'initrd.gz'. I am new to Linux. Can LKCD
|>still be used in our case ?
|>
|>
|>Suneeta
|>
|>-----Original Message-----
|>From: Matt D. Robinson [mailto:yakker@aparity.com]
|>Sent: Friday, November 01, 2002 3:26 PM
|>To: Donepudi, Suneeta; Matt D. Robinson
|>Subject: Re: Kernel Panic during memcpy_toio to PCI card
|>
|>
|>Hey, Suneeta.  Can you try LKCD and see if you can get
|>a crash dump with it?  Also, is this 2.4 or 2.5?
|>
|>--Matt
|>
|>On Fri, 1 Nov 2002, Donepudi, Suneeta wrote:
|>|>Hi,
|>|>
|>|>I would like help in diagnosing a kernel panic while accessing a PCI
|>device.
|>|>
|>|>Everything runs fine for sometime and in about 1/2 hour I get a Kernel
|>Panic
|>|>message saying :
|>|>
|>|>"Unable to handle kernel paging request at virtual address 0xc2821000"
|>|>
|>|>Analysis with Ksymoops shows that it is happening during a memcpy_toio()
|>|>with the PCI card. The PCI card uses three Base Address Registers with
|>|>virtual addresses mapped as follows (after ioremap has been issued):
|>|>
|>|>BAR0 = 0xc280f000
|>|>BAR1 = 0xc2811000
|>|>BAR2 = 0xc2822000
|>|>
|>|>It seems like the kernel panic is complaining about an address which is a
|>|>combination of BAR1 (lower bytes) and BAR2 (upper bytes). It should really
|>|>be accessing the BAR1 address at the point the crash occurred.
|>|>
|>|>I put the following if-statement just before the memcpy_toio():
|>|>-----------------------------------------------------------
|>|>if (((long int)pci_bar1) == 0xc2821000)
|>|>{
|>|>	printk (KERN_ERR "Illegal address for BAR1\n");
|>|>	return -1;
|>|>}
|>|>memcpy_toio (pci_bar1, in_ptr, len);
|>|>------------------------------------------------------------
|>|>
|>|>It still caused the crash in the same manner and at the same location.
|>|>Could someone help me with pointers to where I should start looking ?
|>|>Disabling interrupts around the memcpy_toio() did not make any
|>|>difference. Is this a hardware problem with the PCI card ? We are using
|>|>a Xilinx core with out FPGA build into it.
|>|>Is there a book I could read to learn more about debugging this in the 
|>|>Kernel ?
|>|>
|>|>Thanks a bunch,
|>|>Suneeta
|>-
|>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
|>the body of a message to majordomo@vger.kernel.org
|>More majordomo info at  http://vger.kernel.org/majordomo-info.html
|>Please read the FAQ at  http://www.tux.org/lkml/
|>

-- 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Kernel Panic during memcpy_toio to PCI card
  2002-11-01 23:28 ` Matt D. Robinson
@ 2002-11-01 23:29   ` Dave Jones
  2002-11-02  1:15     ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jones @ 2002-11-01 23:29 UTC (permalink / raw)
  To: Matt D. Robinson
  Cc: Donepudi, Suneeta, 'linux-kernel@vger.kernel.org'

On Fri, Nov 01, 2002 at 03:28:10PM -0800, Matt D. Robinson wrote:

 >It still caused the crash in the same manner and at the same location.
 >Could someone help me with pointers to where I should start looking ?
 >Disabling interrupts around the memcpy_toio() did not make any
 >difference. Is this a hardware problem with the PCI card ? We are using
 >a Xilinx core with out FPGA build into it.

memcpy_toio() in 2.4 is still using memcpy() which could use prefetch()
if you compile for certain processors.  Prefetching io space could do
all sorts of nasties.

2.5 changed this define (in include/asm-i386/io.h) to use __memcpy
instead, which doesn't use prefetching.

		Dave

		Dave

-- 
| Dave Jones.        http://www.codemonkey.org.uk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Kernel Panic during memcpy_toio to PCI card
  2002-11-01 23:29   ` Dave Jones
@ 2002-11-02  1:15     ` Alan Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2002-11-02  1:15 UTC (permalink / raw)
  To: Dave Jones
  Cc: Matt D. Robinson, Donepudi, Suneeta,
	'linux-kernel@vger.kernel.org'

On Fri, 2002-11-01 at 23:29, Dave Jones wrote:
> memcpy_toio() in 2.4 is still using memcpy() which could use prefetch()
> if you compile for certain processors.  Prefetching io space could do
> all sorts of nasties.
> 

If so that really wants fixing ASAP ie for 2.4.20


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Kernel Panic during memcpy_toio to PCI card
@ 2002-11-02 19:46 Donepudi, Suneeta
  0 siblings, 0 replies; 6+ messages in thread
From: Donepudi, Suneeta @ 2002-11-02 19:46 UTC (permalink / raw)
  To: 'Dave Jones ', 'Matt D. Robinson '
  Cc: Donepudi, Suneeta,
	''linux-kernel@vger.kernel.org' '



Hi Dave,

I am not sure if the problem is with memcpy_toio() itself because
I found that the kernel crash occurred even when I replaced the
memcpy_xxio() calls with readl() and writel(). The panic occured
during the memory transfer. We tried looking at the PCI bus
using an analyzer but found nothing wrong.

Thanks,
Suneeta 

-----Original Message-----
From: Dave Jones
To: Matt D. Robinson
Cc: Donepudi, Suneeta; 'linux-kernel@vger.kernel.org'
Sent: 11/1/02 6:29 PM
Subject: Re: Kernel Panic during memcpy_toio to PCI card

On Fri, Nov 01, 2002 at 03:28:10PM -0800, Matt D. Robinson wrote:

 >It still caused the crash in the same manner and at the same location.
 >Could someone help me with pointers to where I should start looking ?
 >Disabling interrupts around the memcpy_toio() did not make any
 >difference. Is this a hardware problem with the PCI card ? We are
using
 >a Xilinx core with out FPGA build into it.

memcpy_toio() in 2.4 is still using memcpy() which could use prefetch()
if you compile for certain processors.  Prefetching io space could do
all sorts of nasties.

2.5 changed this define (in include/asm-i386/io.h) to use __memcpy
instead, which doesn't use prefetching.

		Dave

		Dave

-- 
| Dave Jones.        http://www.codemonkey.org.uk

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-11-02 19:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-01 20:34 Kernel Panic during memcpy_toio to PCI card Donepudi, Suneeta
2002-11-01 23:28 ` Matt D. Robinson
2002-11-01 23:29   ` Dave Jones
2002-11-02  1:15     ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-11-02 19:46 Donepudi, Suneeta
2002-11-01 20:06 Donepudi, Suneeta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox