On 04/19/2010 05:41 PM, Kenji Kaneshige wrote:
Greg KH wrote:
On Mon, Apr 19, 2010 at 12:45:44PM -0700, Nishank wrote:
Hi,
I'm trying understand PCIe hot-plugging and surprise removal as
supported in kernel. I am using a board having Ibex Peak. Can
someone please help me understand -
1. Which is the relevant driver for pcie hp for this board? (looks
like pciehp but I see others as well - shpchp)
Depends on the hardware, what does yours have on it?
2. Is there a specific user-space utility for safe removal of PCIe?
Seems like it should be something like - quiesce, unbind, power-off.
You can do it with a simple one line bash script:
echo 0 > /sys/bus/pci/slot/SLOT_NUMBER/power
Yes, however, driver needs to handle 0xFF reads.
Or you can use the very old pcihpview GUI tool if you really like those
types of things.
Or you can just press the button on the back of your machine that
controls the power to the slot.
3. Is there any existing driver which supports PCIe surprise
removal? Also, when pcie slot has been powered off (as in
handle_suprise_event() in pciehp), how is the driver notified about
it?
The pciehp driver handles pcie device removal, assuming that is what is
controlling the hardware. It is notified through the PCIe standard way
(go read the PCI spec for the boring details...)
The pciehp driver detects surprise removal through presence detect
changed event.
Actually Extended error handling driver shows something similar. In
fact, their documentation is also really good.
One more question I had was, on a hotplug event, what is prompting the
re-enumeration of bus? update_slot_info() seems to be setting status
specific to that slot only.
thanks,
Nishank
Thanks,
Kenji Kaneshige
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html