All of lore.kernel.org
 help / color / mirror / Atom feed
* PCI rescan
@ 2013-03-01 14:46 Pete Zievers
  2013-03-01 21:53 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Pete Zievers @ 2013-03-01 14:46 UTC (permalink / raw)
  To: linux-pci

  Hi-

Right now I am using 64-bit Red Hat Fedora 16.  The kernel version is 
3.1.0-7.fc16.x86_64.

I'm interested in an API that will achieve from within C-language code 
compiled using gcc what can be accomplished from the shell with the 
following invocation:

echo 1 > /sys/bus/pci/devices/<device designator>/remove
echo 1 > /sys/bus/pci/rescan

I find that at the shell level the above works great for me but is 
slow.  I need it to work perhaps an order of magnitude faster for what 
I'm attempting.

Any help you could give me would be greatly appreciated.  If possible it 
would be great if you could give me a short code snippet and whichever 
libraries are involved with some indication as to where I'd need to get 
such libraries.  If I need to upgrade my Linux that's a perfectly okay 
thing to suggest.

regards
Pete Zievers

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

* Re: PCI rescan
  2013-03-01 14:46 PCI rescan Pete Zievers
@ 2013-03-01 21:53 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2013-03-01 21:53 UTC (permalink / raw)
  To: Pete Zievers; +Cc: linux-pci

On Fri, Mar 01, 2013 at 08:46:17AM -0600, Pete Zievers wrote:
>  Hi-
> 
> Right now I am using 64-bit Red Hat Fedora 16.  The kernel version
> is 3.1.0-7.fc16.x86_64.
> 
> I'm interested in an API that will achieve from within C-language
> code compiled using gcc what can be accomplished from the shell with
> the following invocation:
> 
> echo 1 > /sys/bus/pci/devices/<device designator>/remove
> echo 1 > /sys/bus/pci/rescan
> 
> I find that at the shell level the above works great for me but is
> slow.  I need it to work perhaps an order of magnitude faster for
> what I'm attempting.

PCI device removal and recanning is not a fast process, what is "slow"
about doing it in this manner?  All of the delay is in the kernel here,
not in your userspace code.

What is wrong with doing the above "writing of values" in C code?

confused,

greg k-h

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

end of thread, other threads:[~2013-03-01 21:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 14:46 PCI rescan Pete Zievers
2013-03-01 21:53 ` 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.