Hot plug PCI?


Results 1 to 4 of 4

Thread: Hot plug PCI?

  1. #1
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642

    Hot plug PCI?

    Just wondering if there exists any documentation on how to get a hot plug PCI controller working.

    Let me ******** - the PCI devices work, but I would like to know WHERE to find a guide/howto on installing pcihpfs/sysfs, how to mount it, or whatnot.

    It seems PCIHPFS was overtaken by sysfs and it now seems in my 2.6.5 kernel there is no sysfs even.

    Of all the useless google searching, perhaps someone here who actually HAS a working hotplug PCI controller could poing to in a general direction ;-)

    Thanks - Dean

  2. #2
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,947

    Re: Hot plug PCI?

    I don't have a hotplug PCI controller, but I know how I think it's supposed to work.

    Originally posted by deanrantala
    It seems PCIHPFS was overtaken by sysfs and it now seems in my 2.6.5 kernel there is no sysfs even.
    That's strange, because it's impossible to disable sysfs. It's in every single 2.6 kernel everywhere.

    How did you come to the conclusion that you don't have it? (It won't show up in the kernel configuration, because it can't be disabled. So that's not a good test -- you have to actually try to mount it, or check /proc/filesystems while running the kernel you're wondering about.)

    Anyway, the theory is that the PCI-hotplug driver will create or delete some files in sysfs whenever a new hotplug PCI card is inserted. This file creation or deletion will cause a hotplug event to be fired (the default handler is /sbin/hotplug -- you do have a script there, right?). The hotplug handler will do whatever is necessary -- usually it just loads or unloads the driver for the device that was plugged in, searching by the device's PCI ID numbers (which the kernel makes available to hotplug).

    (PCI devices have vendor_id, device_id, subvendor_id, and subdevice_id numbers. The vendor numbers are assigned by some central authority, and the device IDs are supposed to be unique across all devices made by the vendor. The subvendor and subdevice are for things like wireless cards -- many wireless cards use the Atheros chipset, and they all have the same vendor / device, but they all have different subvendor / subdevice numbers.)

  3. #3
    Join Date
    Mar 2003
    Location
    Cookeville, TN
    Posts
    642
    well, heres how the hotplug USED to work (with PCIHPFS).

    Under /proc was a directory /proc/hotplug or /proc/pci/hotplug.

    Under that directory were a series of folders

    slot1/
    slot2/
    slot3/

    etc...

    In each slot folder (which corsponded to a PCI card slot) were a series of entries kinda like text files. For instance, if I wanted to power down slot 1 (so I could remove the card) I would do the following:

    modprobe -r module_name
    echo "0" /proc/pci/hotplug/slot1/power

    That would physically power that slot down and disconnect it from the PCI bus. Then I could just remove and plug a new card in, then run the following...

    echo "1" /proc/pci/hotplug/slot1/power
    modprobe module_name

    At least that is how it worked in PCIHPFS. It seems, however that PCIHPFS is dead as can be, and according to the sysfs code and motes, was completely and utterly taken over by sysfs. However, by digging deeper into sysfs and notes in the corsponding code, it seems the hotplug PCI code has been removed and disabled until someone decides to further work on it. (Always worked fine before)

    Whats worse, is back with PCIHPFS - it was well documented and easy to find resources about in the case of help - these days, a google for hotplug PCI linux or variants returns a spew of outdated documents regarding PCIHPFS and others. Nothing available for today's world.

    No real hassle I guesse - would be nice for my own hotplug backpanes in systems such as my ProLiant and Poweredge, but I HAD a client who was absolutely NEEDING the hotplug capabilities and was interested in Linux - had to tell him just last week "Hotplug capabiliteis have temporarily been disabled in Linux kernel code, We will have to go with Server 03" So that kinda hurt a bit n the budget.

    Maybe I'll find time and hack this crap back into sysfs myself if I even get time. The hotplug API is supposed to be generic and compatable with any module that uses the new hotplug API (which is like most all current modules). So Don't know.

    Thanks anyway

    Dean

  4. #4
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,947
    Well, maybe you could do an:

    echo some-value >/sys/bus/pci/devices/[PCI ID]/power/state

    ? By default this file has 0 in it, and I don't know if you can change it or not. But it might be worth a shot anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •