Lines Matching +full:ctrl +full:- +full:a

1 // SPDX-License-Identifier: GPL-2.0+
6 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
8 * Copyright (C) 2003-2004 Intel Corporation
25 * pciehp_configure_device() - enumerate PCI devices below a hotplug bridge
26 * @ctrl: PCIe hotplug controller
28 * Enumerate PCI devices below a hotplug bridge and add them to the system.
29 * Return 0 on success, %-EEXIST if the devices are already enumerated or
30 * %-ENODEV if enumeration failed.
32 int pciehp_configure_device(struct controller *ctrl) in pciehp_configure_device() argument
35 struct pci_dev *bridge = ctrl->pcie->port; in pciehp_configure_device()
36 struct pci_bus *parent = bridge->subordinate; in pciehp_configure_device()
45 * boot firmware or a previous hotplug event. in pciehp_configure_device()
47 ctrl_dbg(ctrl, "Device %s already exists at %04x:%02x:00, skipping hot-add\n", in pciehp_configure_device()
48 pci_name(dev), pci_domain_nr(parent), parent->number); in pciehp_configure_device()
50 ret = -EEXIST; in pciehp_configure_device()
56 ctrl_err(ctrl, "No new device found\n"); in pciehp_configure_device()
57 ret = -ENODEV; in pciehp_configure_device()
69 * to avoid AB-BA deadlock with device_lock. in pciehp_configure_device()
71 up_read(&ctrl->reset_lock); in pciehp_configure_device()
73 down_read_nested(&ctrl->reset_lock, ctrl->depth); in pciehp_configure_device()
76 ctrl->dsn = pci_get_dsn(dev); in pciehp_configure_device()
85 * pciehp_unconfigure_device() - remove PCI devices below a hotplug bridge
86 * @ctrl: PCIe hotplug controller
91 * Unbind PCI devices below a hotplug bridge from their drivers and remove
95 void pciehp_unconfigure_device(struct controller *ctrl, bool presence) in pciehp_unconfigure_device() argument
98 struct pci_bus *parent = ctrl->pcie->port->subordinate; in pciehp_unconfigure_device()
101 ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:00\n", in pciehp_unconfigure_device()
102 __func__, pci_domain_nr(parent), parent->number); in pciehp_unconfigure_device()
110 * Stopping an SR-IOV PF device removes all the associated VFs, in pciehp_unconfigure_device()
111 * which will update the bus->devices list and confuse the in pciehp_unconfigure_device()
115 list_for_each_entry_safe_reverse(dev, temp, &parent->devices, in pciehp_unconfigure_device()
121 * to avoid AB-BA deadlock with device_lock. in pciehp_unconfigure_device()
123 up_read(&ctrl->reset_lock); in pciehp_unconfigure_device()
125 down_read_nested(&ctrl->reset_lock, ctrl->depth); in pciehp_unconfigure_device()