@@ -195,6 +195,7 @@ int pciehp_get_raw_indicator_status(struct hotplug_slot *h_slot, u8 *status);
int pciehp_slot_reset(struct pcie_device *dev);
int pciehp_link_enable(struct controller *ctrl);
+int pciehp_link_disable(struct controller *ctrl);
static inline const char *slot_name(struct controller *ctrl)
{
@@ -353,6 +353,12 @@ int pciehp_link_enable(struct controller *ctrl)
}
EXPORT_SYMBOL_NS_GPL(pciehp_link_enable, PCIEHP);
+int pciehp_link_disable(struct controller *ctrl)
+{
+ return __pciehp_link_set(ctrl, false);
+}
+EXPORT_SYMBOL_NS_GPL(pciehp_link_disable, PCIEHP);
+
int pciehp_get_raw_indicator_status(struct hotplug_slot *hotplug_slot,
u8 *status)
{
When a PCIe-based FPGA card is reprogrammed, it temporarily disappears from the PCIe bus. This needs to be managed to avoid PCIe errors while the device is not present. Also, re-probing and rescan the PCI devices must be performed after loading the new images. Export functions from pciehp driver necessary for disable and enable the PCI link of a PCI hotplug bridge. Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com> --- drivers/pci/hotplug/pciehp.h | 1 + drivers/pci/hotplug/pciehp_hpc.c | 6 ++++++ 2 files changed, 7 insertions(+)