Lines Matching defs:slot
288 unsigned int seg, bus, slot, func;
302 ret = sscanf(p, "/%x.%x%c", &slot, &func, &end);
308 if (dev->devfn != PCI_DEVFN(slot, func)) {
328 ret = sscanf(wpath, "%x:%x:%x.%x%c", &seg, &bus, &slot,
332 ret = sscanf(wpath, "%x:%x.%x%c", &bus, &slot, &func, &end);
341 dev->devfn == PCI_DEVFN(slot, func));
3918 * behind bridges on add-in cards. For devices with ARI enabled, the slot
3924 int slot;
3927 slot = 0;
3929 slot = PCI_SLOT(dev->devfn);
3931 return (((pin - 1) + slot) % 4) + 1;
5254 if (dev->multifunction || dev->subordinate || !dev->slot ||
5258 return pci_reset_hotplug_slot(dev->slot->hotplug, probe);
5723 /* Do any devices on or below this slot prevent a bus reset? */
5724 static bool pci_slot_resettable(struct pci_slot *slot)
5728 if (slot->bus->self &&
5729 (slot->bus->self->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET))
5732 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5733 if (!dev->slot || dev->slot != slot)
5744 static void pci_slot_lock(struct pci_slot *slot)
5748 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5749 if (!dev->slot || dev->slot != slot)
5758 static void pci_slot_unlock(struct pci_slot *slot)
5762 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5763 if (!dev->slot || dev->slot != slot)
5772 static int pci_slot_trylock(struct pci_slot *slot)
5776 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5777 if (!dev->slot || dev->slot != slot)
5792 &slot->bus->devices, bus_list) {
5793 if (!dev->slot || dev->slot != slot)
5837 static void pci_slot_save_and_disable_locked(struct pci_slot *slot)
5841 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5842 if (!dev->slot || dev->slot != slot)
5855 static void pci_slot_restore_locked(struct pci_slot *slot)
5859 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5860 if (!dev->slot || dev->slot != slot)
5868 static int pci_slot_reset(struct pci_slot *slot, bool probe)
5872 if (!slot || !pci_slot_resettable(slot))
5876 pci_slot_lock(slot);
5880 rc = pci_reset_hotplug_slot(slot->hotplug, probe);
5883 pci_slot_unlock(slot);
5889 * pci_probe_reset_slot - probe whether a PCI slot can be reset
5890 * @slot: PCI slot to probe
5892 * Return 0 if slot can be reset, negative if a slot reset is not supported.
5894 int pci_probe_reset_slot(struct pci_slot *slot)
5896 return pci_slot_reset(slot, PCI_RESET_PROBE);
5901 * __pci_reset_slot - Try to reset a PCI slot
5902 * @slot: PCI slot to reset
5904 * A PCI bus may host multiple slots, each slot may support a reset mechanism
5905 * independent of other slots. For instance, some slots may support slot power
5906 * control. In the case of a 1:1 bus to slot architecture, this function may
5907 * wrap the bus reset to avoid spurious slot related events such as hotplug.
5908 * Generally a slot reset should be attempted before a bus reset. All of the
5909 * function of the slot and any subordinate buses behind the slot are reset
5910 * through this function. PCI config space of all devices in the slot and
5911 * behind the slot is saved before and restored after reset.
5913 * Same as above except return -EAGAIN if the slot cannot be locked
5915 static int __pci_reset_slot(struct pci_slot *slot)
5919 rc = pci_slot_reset(slot, PCI_RESET_PROBE);
5923 if (pci_slot_trylock(slot)) {
5924 pci_slot_save_and_disable_locked(slot);
5926 rc = pci_reset_hotplug_slot(slot->hotplug, PCI_RESET_DO_RESET);
5927 pci_slot_restore_locked(slot);
5928 pci_slot_unlock(slot);
5961 * available. If slot reset fails or is not available, this will fall back to a
5967 struct pci_slot *slot;
5976 list_for_each_entry(slot, &bus->slots, list)
5977 if (pci_probe_reset_slot(slot))
5980 list_for_each_entry(slot, &bus->slots, list)
5981 if (pci_slot_reset(slot, PCI_RESET_DO_RESET))
6031 * @pdev: top level PCI device to reset via slot/bus
6037 return (!pci_probe_reset_slot(pdev->slot)) ?
6038 __pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus);
6529 * @devfn_from: alias slot and function