LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-29-2017, 02:53 AM   #1
kzytaruk
LQ Newbie
 
Registered: Mar 2017
Posts: 3

Rep: Reputation: Disabled
PCI device becomes unresponsive and can't reset it.


I have a PCI device that is sitting behind a bridge.

Under certain circumstances the PCI device will become inactive. Reading the PCI config space returns all 0xFFFFFFFF.

The bridge appears to still be functional. Reading the status from the bridge I see a Fatal Error due to a Surprise Down event.

I am trying to figure out how to bring the device back online.

I tried toggling the secondary bus reset bit of the Bridge Control Register but it doesn't appear to make any difference. I still see 0xFFFFFFFF in the device config space.

I provided a pci_error_handler but the error_detected() function is not getting called.

Given that these two methods are not helping me out what other choices do I have to either reset the PCI device or hot-plug the device from a kernel driver. Or some other method of bring the device back to life.

Note that I am running Linux 4.8 in dom0 on Xen (if that makes a difference).

Thanks,
Kelly
 
Old 03-29-2017, 01:16 PM   #2
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Having any form of virtualization in your path adds the question: "Is it the hardware or the virtualization screwing up?"

ie. Try the hardware without the virtualization and see if life improves.
 
Old 03-29-2017, 02:31 PM   #3
kzytaruk
LQ Newbie
 
Registered: Mar 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
>>"Is it the hardware or the virtualization screwing up?"

I haven't tried without virtualization yet but I am pretty sure that it is the hardware as I am giving it a nasty whack as part of stress testing.
 
Old 03-29-2017, 03:26 PM   #4
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Hardware is sometimes timing sensitive, so adding in a bunch of cycles delay through virtualization can cause sorrow.

Sometimes rmmod'ing the driver and then modprobe'ing it works to revive sad hardware.

If you can't rmmod it, you may have to remove the entire stack of mods that depends on it first.

Sometimes way up the /sys/devices tree you can find useful things to toggle as well.
 
1 members found this post helpful.
Old 03-29-2017, 03:44 PM   #5
kzytaruk
LQ Newbie
 
Registered: Mar 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
I tried rmmod but it hard hung the system. Thinking back however my driver assumes that the device is still active when it does an rmmod. During rmmod it tries to "uninitialized" the device. Touching the hardware hung the system.

I am going to add a check in my driver to take a "quick-path" out if the hardware is not responsive.

Does rmmod/modprobe do anything to the hardware (ie reset) or does it just unload/load the driver?
 
Old 03-29-2017, 04:27 PM   #6
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Vague memory that it runs some hook code at unload time, whether it gets lower layer modules like the pci driver to do anything sensible I don't know.

I sort of would expect the ability to hard reset / power on / power off a device to would reside with the bus layer.
 
  


Reply



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
usb 1-1: reset high-speed USB device number 2 using ehci-pci jotapdiez Slackware 3 11-14-2014 02:42 PM
Reset RS232 Buffer on Device LSigales Linux - Hardware 2 08-09-2010 12:03 PM
Can a PCI device communicate with another device attached to the bus system? bhagatindia Linux - Kernel 3 10-16-2008 12:44 AM
reset the tape device ust Linux - Software 5 02-03-2005 07:09 AM
device to simulate physical memory with PCI device kevinsung Linux - Software 1 12-14-2002 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 04:56 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