lkml.org 
[lkml]   [2004]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Is there a user space pci rescan method?
On Thu, Sep 23, 2004 at 05:04:38PM +0200, Jan Dittmer wrote:
> Greg KH wrote:
> > On Thu, Sep 23, 2004 at 01:58:32AM +0200, Jan Dittmer wrote:
> >
> >>Dave Aubin wrote:
> >>
> >>>Hi,
> >>>
> >>> I know very little about hotplug, but does make sense.
> >>>How do you motivate a hotplug insertion event? Or should
> >>>I just go read the /docs on hotplugging? Any help is
> >>>Appreciated:)
> >>
> >>There is a "fake" hotplug driver which works for normal pci. But last
> >>time I looked at it, it did only support hot disabling, not hot enabling
> >>- but this surely can be fixed.
> >
> >
> > Yes, hot "enabling" has been left for someone to add to the driver, if
> > you read the comments in it :)
> >
>
> I read them and started playing around with this driver. So echoing 0 in
> /sys/bus/pci/slots/*/power disables the pci device. The problem I see
> is, that the tree with the device is disappearing. So how am I supposed
> to re-enable the device.

You need to add another sysfs file called "rescan" or something.
Writing to that file will cause the kernel to rescan pci space, and add
any devices it finds that are not already present. The code to do that
can be taken from the pci startup code in the kernel today.

> I've no real hotplug hardware to play with, so I'm bound to reading
> the source code in drivers/pci/hotplug and testing with fakephp.

That's fine. You don't need real hotplug pci hardware to use fakephp,
that's what the driver is for :)

> I found your utility pcihpview (v0.5) which searches for
> /sys/bus/pci/hotplug_slots. But grepping the kernel tree doesn't show
> any mentioning of it - so I suppose it is outdated.

That's a 2.4 interface. I need to get a new version of that program out
there that works for 2.6 one of these days (the bk version of the
program has this support already in it, if you want to mess with
that...)

> Is there anywhere a current article (or Documentation/pci_hotplug.txt)
> about the state of PCI hotplug and how this is supposed to work?

Not really, sorry.

> ps: Meanwhile I found dummyphp on the pcihpd mailinglist. This doesn't
> remove the device from /sys/bus/pci/slots/*/power . Still I'd like
> to know the offical way.

That's the driver that I based fakephp on. It's a good starting point
for what it sounds like you want to do.

Hope this helps,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.068 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site