LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2015, 01:18 PM   #1
mike3500
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Rep: Reputation: Disabled
Why does "lspci" command crash my system?


I'm using a recent version of CentOS on a server with a PCI Express board that we are developing. When the system is first booted, our board shows up normally when I enter an "lspci" command such as "lspci -d xxxx: -vvv" or any other.

However, while running the firmware on our board, which sends & receives various PCIe TLP's such as MWr, MRd, CplD, etc. to and from an application running on the server, if I try an "lspci" command it will crash the system, i.e. keyboard and mouse freeze and I have to use the front panel pushbutton to power cycle the system.

So my question is, basically how does "lspci" work? What are some of the things that "lspci" does that (apparently) our board does not handle properly? It usually crashes after displaying the 8th line of output, which reads "Capabilities: [fc] <chain broken>"

-Mike
 
Old 02-17-2015, 01:27 PM   #2
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
Here's the source: https://github.com/gittup/pciutils/blob/gittup/lspci.c
 
Old 02-17-2015, 02:39 PM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 7
Posts: 3,532

Rep: Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974
PCI capabilities are a linked list reported in PCI config space. If the list is malformed and points outside the config space assigned to your board, that would be bad. If PCI config reads have any side effects on your board, that would also be bad.
 
Old 02-18-2015, 08:42 AM   #4
mike3500
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for your responses. So is the linked list stored in the PCI config space? And is the PCI config space the same as the BAR0 space? What actions would cause a linked list that was originally fine to go bad?
 
Old 05-11-2017, 11:16 AM   #5
SK17
LQ Newbie
 
Registered: May 2017
Posts: 2

Rep: Reputation: Disabled
Same Issue

Hi Mike,

Today i was trying a similar experiment as yours. The details are as below: If i run lspci, i am able to see the devices attached. If i run data traffic, the traffic is fine, but if i run lspci in parallel to data transfer, the Linux crashes. There are no solid logs to find out what caused the crash. On going through websites i came across your post.

Have you root caused the issue that you were facing? Did you got any solution on how to run lspci in parallel to data transfer?

Thanks in Advance!

Regards,
SK17.
 
Old 05-11-2017, 01:25 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 16,929
Blog Entries: 10

Rep: Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039
Quote:
Originally Posted by SK17 View Post
Today i was trying a similar experiment as yours.
are you also developing your own pci express board?

in any case, you should start a new topic, and provide as much information & output as possible.
 
Old 05-11-2017, 01:35 PM   #7
SK17
LQ Newbie
 
Registered: May 2017
Posts: 2

Rep: Reputation: Disabled
Why does "lspci" command crash my system?

Hi,

Sorry am new to this web portal. So, just pasted my comment as such.

Yes we are developing our own PCIe express board. When validating various scenarios we got this issue. We are running the Linux drivers to transfer data from RC to EP via a Switch. While data transfer is in progress, and if we issue a lspci command, the Linux crashes. But we just get the ARM register dump and no crash information which is useful enough:

[ 119.032066] Bad mode in Error handler detected on CPU3, code 0xbf000002 -- SError
[ 119.039785] Internal error: Oops - bad mode: 0 [#1] SMP
[ 119.045175] Modules linked in:
[ 119.048327] CPU: 3 PID: 2396 Comm: lspci Not tainted 4.11.0-01282-g0f8eafb-dirty #9

kernel:[ 119.039785] Internal error: Oops - bad mode: 0 [#1] SMP
kernel:[ 119.170397] Process lspci (pid: 2396, stack limit = 0xffff80a1543d0000)
Segmentation fault
Jobs: 16 (f=64): [R(16)] [16.6% done] [423.1MB/0KB/0KB /s] [109K/0/0 iops] [eta 03m:11s]iops] [eta 03m:17s]


If you get any debug idea or solution please suggest.

Thanks,
SK17
 
Old 05-11-2017, 01:57 PM   #8
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 7
Posts: 3,532

Rep: Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974
You can check if your hardware has a bug when reading the PCI config space with a command like:

Code:
 lspci -xxx -s 04:00.0
Replace the 04:00.0 with the actual PCI address of your card (as listed by lspci).
 
Old 05-11-2017, 02:04 PM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 16,929
Blog Entries: 10

Rep: Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039Reputation: 5039
please start a new, your own, thread.
 
  


Reply

Tags
crash, freeze, lspci, pcie


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to add the "dialout" group in my system without the command "groupadd"? floppy_stuttgart Linux - Networking 3 09-19-2013 02:55 PM
"lspci" command - parse error giri_blr Linux - Kernel 5 08-15-2008 02:03 AM
"status=0x50 DriveReady Seek Complete" system crash cyungle Linux - Hardware 1 09-20-2006 05:27 PM
"cp" command causes system crash PocaHontas Linux - General 2 09-17-2004 01:48 AM
'Last' command showing "Crash" for ftp users wizade Linux - Software 2 10-27-2003 12:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration