LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-25-2017, 11:01 AM   #1
khhyle
LQ Newbie
 
Registered: Dec 2016
Location: San Jose, California
Distribution: Red Hat (Tikanga)
Posts: 6

Rep: Reputation: Disabled
PCI - Remove/Rescan vs. Rescan


Can someone help me understand why I need to remove my stale PCI device files from the tree if I want to properly get my device re-initialized after unplugging and reinserting?

For example, I turn on my system with my PCI device plugged in. All is fine. I unplug it, plug it back in, and rescan (echo 1 > /sys/bus/pci/devices/rescan) and end up in this state where my BAR0 is not set, and other things are not entirely correct.

But if I do a remove (echo 1 > /sys/bus/pci/devices/xxxx/xx.x/remove) of the port, it then properly re-initializes my device when I do a rescan.

Why does it not suffice to simply do a rescan? Does the rescan skip some step if it finds that the device is already in the PCI tree? It's not as if the rescan completely skips the device if I don't do a remove, it just doesn't do all of the initialization.
 
Old 04-27-2017, 03:50 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
I assume you remove it before you take the pci card out. I also assume the board has full support for this task.

I think this link has the clues you are asking about. https://stackoverflow.com/questions/...an-of-pcie-bus
 
  


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
PCI - Remove/Rescan vs. Rescan khhyle Linux - Kernel 1 04-28-2017 08:51 AM
rescan for monitor bjlockie Linux - Desktop 2 06-05-2016 06:08 AM
How to rescan bash PATH reakinator Linux - General 7 04-14-2009 03:35 PM
Rescan devices consty Linux - General 1 11-02-2005 05:13 PM
HD SCSI Rescan carma Linux - Hardware 2 03-03-2005 09:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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