All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: PCI ERROR: Segmentation fault in pci_do_scan_bus
@ 2006-04-26 11:35 biswa.nayak
  2006-04-26 17:21 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: biswa.nayak @ 2006-04-26 11:35 UTC (permalink / raw)
  To: greg; +Cc: Linux-Kernel

Thanks Greg for your reply. My comments are below.

From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Greg KH

> >On Tue, Apr 25, 2006 at 05:25:32PM +0530, biswa.nayak@wipro.com
wrote:
> > Hi
> > 
> > I am getting segmentation fault, consistently on call to 
> > 'pci_do_scan_bus'. This is a small test code ( attached with this 
> > mail) to test the APIs exposed by the PCI subsystem.

> The module code you attached isn't exactly "small" :)
> What chunk of code is causing the problem?
> Why are you scanning the PCI bus from a module?

Sorry for attaching the whole module. 
Initially I thought of sending only the part which is causing the
problem, but
later thought of sending full module which is compiling and working for
better understanding.

In my code inside 'test_scan_bus' I am calling 'pci_do_scan_bus' in that
case I am getting the segmentation fault.

I am developing a test suite which will validate all the BSPs. 
That's the reason I am calling this exported APIs from the subsystem to
verify that things are working fine. 

> > I just checked where it
> >  faults and found out that inside 'sysfs_create_bin_file' it is not 
> > able  to find the kobject out of the dev pointer passed to it. Now 
> > extracting  of the dev object out of the bus pointer is done by  
> > 'list_for_each_entry(dev, &bus->devices, bus_list)' in  
> > 'pci_bus_add_devices'. Now I am not able to understand why the
kobject  
> > is missing. Is it something that I am missing or is it a kernel
defect?
> > Any help in this will be really appreciated. The bug message is
pasted  
> > below.

> I'm confused as to why you are trying to set up the pci bus for a pci
bus that is already set up.
> That's why the function is dying...

I am not trying to set up the already set up bus ( or is it what I am
doing by making a call to this function?). My intention is to call all
the APIs provided by all the subsystem of the system, like PCI, USB,
UART, FS etc...

I am doing something seriously wrong over here?

Thanks
~Biswa

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

* Re: PCI ERROR: Segmentation fault in pci_do_scan_bus
  2006-04-26 11:35 PCI ERROR: Segmentation fault in pci_do_scan_bus biswa.nayak
@ 2006-04-26 17:21 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2006-04-26 17:21 UTC (permalink / raw)
  To: biswa.nayak; +Cc: Linux-Kernel

On Wed, Apr 26, 2006 at 05:05:55PM +0530, biswa.nayak@wipro.com wrote:
> 
> Thanks Greg for your reply. My comments are below.
> 
> From: linux-kernel-owner@vger.kernel.org
> [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Greg KH
> 
> > >On Tue, Apr 25, 2006 at 05:25:32PM +0530, biswa.nayak@wipro.com
> wrote:
> > > Hi
> > >
> > > I am getting segmentation fault, consistently on call to
> > > 'pci_do_scan_bus'. This is a small test code ( attached with this
> > > mail) to test the APIs exposed by the PCI subsystem.
> 
> > The module code you attached isn't exactly "small" :)
> > What chunk of code is causing the problem?
> > Why are you scanning the PCI bus from a module?
> 
> Sorry for attaching the whole module.
> Initially I thought of sending only the part which is causing the
> problem, but
> later thought of sending full module which is compiling and working for
> better understanding.
> 
> In my code inside 'test_scan_bus' I am calling 'pci_do_scan_bus' in that
> case I am getting the segmentation fault.
> 
> I am developing a test suite which will validate all the BSPs.

What is a "BSP"?

> That's the reason I am calling this exported APIs from the subsystem to
> verify that things are working fine.

Working fine for what?

> > > I just checked where it
> > >  faults and found out that inside 'sysfs_create_bin_file' it is not
> > > able  to find the kobject out of the dev pointer passed to it. Now
> > > extracting  of the dev object out of the bus pointer is done by 
> > > 'list_for_each_entry(dev, &bus->devices, bus_list)' in 
> > > 'pci_bus_add_devices'. Now I am not able to understand why the
> kobject 
> > > is missing. Is it something that I am missing or is it a kernel
> defect?
> > > Any help in this will be really appreciated. The bug message is
> pasted 
> > > below.
> 
> > I'm confused as to why you are trying to set up the pci bus for a pci
> bus that is already set up.
> > That's why the function is dying...
> 
> I am not trying to set up the already set up bus ( or is it what I am
> doing by making a call to this function?).

Do you understand what this function does?

> My intention is to call all the APIs provided by all the subsystem of
> the system, like PCI, USB, UART, FS etc...

But you need to call them in ways that make sense, right? :)

> I am doing something seriously wrong over here?

I think you need to understand what the functions that you are calling
really do before calling them.  And understand what you are trying to
achive.

thanks,

greg k-h

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

* Re: PCI ERROR: Segmentation fault in pci_do_scan_bus
  2006-04-25 11:55 biswa.nayak
@ 2006-04-26  6:13 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2006-04-26  6:13 UTC (permalink / raw)
  To: biswa.nayak; +Cc: Linux-Kernel

On Tue, Apr 25, 2006 at 05:25:32PM +0530, biswa.nayak@wipro.com wrote:
> Hi 
> 
> I am getting segmentation fault, consistently on call to
> 'pci_do_scan_bus'. This is a small test code ( attached with this mail)
> to test the APIs exposed by the PCI subsystem.

The module code you attached isn't exactly "small" :)

What chunk of code is causing the problem?

Why are you scanning the PCI bus from a module?

>I just checked where it
> faults and found out that inside 'sysfs_create_bin_file' it is not able
> to find the kobject out of the dev pointer passed to it. Now extracting
> of the dev object out of the bus pointer is done by
> 'list_for_each_entry(dev, &bus->devices, bus_list)' in
> 'pci_bus_add_devices'. Now I am not able to understand why the kobject
> is missing. Is it something that I am missing or is it a kernel defect?
> Any help in this will be really appreciated. The bug message is pasted
> below.

I'm confused as to why you are trying to set up the pci bus for a pci
bus that is already set up.  That's why the function is dying...

thanks,

greg k-h

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

* PCI ERROR: Segmentation fault in pci_do_scan_bus
@ 2006-04-25 11:55 biswa.nayak
  2006-04-26  6:13 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: biswa.nayak @ 2006-04-25 11:55 UTC (permalink / raw)
  To: Linux-Kernel

[-- Attachment #1: Type: text/plain, Size: 2681 bytes --]

Hi 

I am getting segmentation fault, consistently on call to
'pci_do_scan_bus'. This is a small test code ( attached with this mail)
to test the APIs exposed by the PCI subsystem. I just checked where it
faults and found out that inside 'sysfs_create_bin_file' it is not able
to find the kobject out of the dev pointer passed to it. Now extracting
of the dev object out of the bus pointer is done by
'list_for_each_entry(dev, &bus->devices, bus_list)' in
'pci_bus_add_devices'. Now I am not able to understand why the kobject
is missing. Is it something that I am missing or is it a kernel defect?
Any help in this will be really appreciated. The bug message is pasted
below.

The kernel version is linux 2.6.14.  

========================================================================
======================================
kernel BUG at fs/sysfs/bin.c:184!
invalid operand: 0000 [#1]
Modules linked in: tpci parport_pc lp parport autofs4 sunrpc
iptable_filter ip_tables button battery ac ipv6 uhci_hcd i2c_i801
i2c_core snd_intel8x0 snd_ac97_codec snd_ac97_bus snd_pcm_oss
snd_mixer_oss snd_pcm snd_timer snd soundcore snd_page_alloc e1000
floppy dm_snapshot dm_zero dm_mirror dm_mod
CPU:    0
EIP:    0060:[<c01a29a1>]    Not tainted VLI
EFLAGS: 00010202   (2.6.14-skas3-v8.2)
EIP is at sysfs_create_bin_file+0x41/0x50
eax: c8bbf701   ebx: 00000000   ecx: 00000001   edx: c03bf700
esi: c03bf700   edi: d76c83a0   ebp: 00000000   esp: d348fee8
ds: 007b   es: 007b   ss: 0068
Process test_pci (pid: 4626, threadinfo=d348e000 task=c8da5560)
Stack: c893b400 c893b4ec c01feb5a c893b400 c893b400 d76c83b4 d76c83a0
00000000
       c01f967c d76c83a0 00000001 00006b08 c01fa9ea d76c83a0 00000000
d8989631
       d898a068 d76c83a0 00000000 d898924a d8989bb0 00000000 00000000
00000000
Call Trace:
 [<c01feb5a>] pci_create_sysfs_dev_files+0x4a/0x140
 [<c01f967c>] pci_bus_add_devices+0x3c/0xd0
 [<c01fa9ea>] pci_do_scan_bus+0x1a/0x30
 [<d8989631>] test_scan_bus+0x21/0x60 [tpci]
 [<d898924a>] tpci_ioctl+0x20a/0x2b0 [tpci]
 [<d8989040>] tpci_ioctl+0x0/0x2b0 [tpci]
 [<c0172bc0>] do_ioctl+0x50/0x80
 [<c0172d2e>] vfs_ioctl+0x5e/0x1c0
 [<c015f67f>] vfs_write+0x12f/0x180
 [<c0172f07>] sys_ioctl+0x77/0x90
 [<c010301f>] sysenter_past_esp+0x54/0x75
Code: 94 c0 85 d2 0f 94 c2 09 d0 a8 01 75 1e 89 f2 89 d8 8b 74 24 04 8b
1c 24 b9 08 00 00 00 83 c4 08 e9 85 df ff ff 8b 1d 30 00 00 00 <0f> 0b
b8 00 52 ff 36 c0 eb d8 90 8d 74 26 00 8b 40 30 8b 12 e8

========================================================================
==================================

Please, let me know if any more info is required.

Thanks
Biswa



[-- Attachment #2: test.tar.bz2 --]
[-- Type: application/octet-stream, Size: 7569 bytes --]

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

end of thread, other threads:[~2006-04-26 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 11:35 PCI ERROR: Segmentation fault in pci_do_scan_bus biswa.nayak
2006-04-26 17:21 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2006-04-25 11:55 biswa.nayak
2006-04-26  6:13 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.