Lines Matching refs:slot

287 	unsigned int seg, bus, slot, func;
301 ret = sscanf(p, "/%x.%x%c", &slot, &func, &end);
307 if (dev->devfn != PCI_DEVFN(slot, func)) {
327 ret = sscanf(wpath, "%x:%x:%x.%x%c", &seg, &bus, &slot,
331 ret = sscanf(wpath, "%x:%x.%x%c", &bus, &slot, &func, &end);
340 dev->devfn == PCI_DEVFN(slot, func));
4928 if (dev->multifunction || dev->subordinate || !dev->slot ||
4932 return pci_reset_hotplug_slot(dev->slot->hotplug, probe);
5490 /* Do any devices on or below this slot prevent a bus reset? */
5491 static bool pci_slot_resettable(struct pci_slot *slot)
5495 if (slot->bus->self &&
5496 (slot->bus->self->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET))
5499 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5500 if (!dev->slot || dev->slot != slot)
5511 static void pci_slot_lock(struct pci_slot *slot)
5515 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5516 if (!dev->slot || dev->slot != slot)
5525 static void pci_slot_unlock(struct pci_slot *slot)
5529 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5530 if (!dev->slot || dev->slot != slot)
5539 static int pci_slot_trylock(struct pci_slot *slot)
5543 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5544 if (!dev->slot || dev->slot != slot)
5559 &slot->bus->devices, bus_list) {
5560 if (!dev->slot || dev->slot != slot)
5604 static void pci_slot_save_and_disable_locked(struct pci_slot *slot)
5608 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5609 if (!dev->slot || dev->slot != slot)
5622 static void pci_slot_restore_locked(struct pci_slot *slot)
5626 list_for_each_entry(dev, &slot->bus->devices, bus_list) {
5627 if (!dev->slot || dev->slot != slot)
5635 static int pci_slot_reset(struct pci_slot *slot, bool probe)
5639 if (!slot || !pci_slot_resettable(slot))
5643 pci_slot_lock(slot);
5647 rc = pci_reset_hotplug_slot(slot->hotplug, probe);
5650 pci_slot_unlock(slot);
5656 * pci_probe_reset_slot - probe whether a PCI slot can be reset
5657 * @slot: PCI slot to probe
5659 * Return 0 if slot can be reset, negative if a slot reset is not supported.
5661 int pci_probe_reset_slot(struct pci_slot *slot)
5663 return pci_slot_reset(slot, PCI_RESET_PROBE);
5668 * __pci_reset_slot - Try to reset a PCI slot
5669 * @slot: PCI slot to reset
5671 * A PCI bus may host multiple slots, each slot may support a reset mechanism
5672 * independent of other slots. For instance, some slots may support slot power
5673 * control. In the case of a 1:1 bus to slot architecture, this function may
5674 * wrap the bus reset to avoid spurious slot related events such as hotplug.
5675 * Generally a slot reset should be attempted before a bus reset. All of the
5676 * function of the slot and any subordinate buses behind the slot are reset
5677 * through this function. PCI config space of all devices in the slot and
5678 * behind the slot is saved before and restored after reset.
5680 * Same as above except return -EAGAIN if the slot cannot be locked
5682 static int __pci_reset_slot(struct pci_slot *slot)
5686 rc = pci_slot_reset(slot, PCI_RESET_PROBE);
5690 if (pci_slot_trylock(slot)) {
5691 pci_slot_save_and_disable_locked(slot);
5693 rc = pci_reset_hotplug_slot(slot->hotplug, PCI_RESET_DO_RESET);
5694 pci_slot_restore_locked(slot);
5695 pci_slot_unlock(slot);
5728 * available. If slot reset fails or is not available, this will fall back to a
5734 struct pci_slot *slot;
5743 list_for_each_entry(slot, &bus->slots, list)
5744 if (pci_probe_reset_slot(slot))
5747 list_for_each_entry(slot, &bus->slots, list)
5748 if (pci_slot_reset(slot, PCI_RESET_DO_RESET))
5798 * @pdev: top level PCI device to reset via slot/bus
5804 return (!pci_probe_reset_slot(pdev->slot)) ?
5805 __pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus);
6332 * @devfn_from: alias slot and function