Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40304618 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/locking' into next

* pci/locking:
  PCI: Check parent kobject in pci_destroy_dev()
  xen/pcifront: Use global PCI rescan-remove locking
  powerpc/eeh: Use global PCI rescan-remove locking
  MPT / PCI: Use pci_stop_and_remove_bus_device_locked()
  platform / x86: Use global PCI rescan-remove locking
  PCI: hotplug: Use global PCI rescan-remove locking
  pcmcia: Use global PCI rescan-remove locking
  ACPI / hotplug / PCI: Use global PCI rescan-remove locking
  ACPI / PCI: Use global PCI rescan-remove locking in PCI root hotplug
  PCI: Add global pci_lock_rescan_remove()
parents 1255dfbb 8a4c5c32
Loading
Loading
Loading
Loading
+16 −3
Original line number Original line Diff line number Diff line
@@ -369,7 +369,9 @@ static void *eeh_rmv_device(void *data, void *userdata)
	edev->mode |= EEH_DEV_DISCONNECTED;
	edev->mode |= EEH_DEV_DISCONNECTED;
	(*removed)++;
	(*removed)++;


	pci_lock_rescan_remove();
	pci_stop_and_remove_bus_device(dev);
	pci_stop_and_remove_bus_device(dev);
	pci_unlock_rescan_remove();


	return NULL;
	return NULL;
}
}
@@ -416,10 +418,13 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
	 * into pcibios_add_pci_devices().
	 * into pcibios_add_pci_devices().
	 */
	 */
	eeh_pe_state_mark(pe, EEH_PE_KEEP);
	eeh_pe_state_mark(pe, EEH_PE_KEEP);
	if (bus)
	if (bus) {
		pci_lock_rescan_remove();
		pcibios_remove_pci_devices(bus);
		pcibios_remove_pci_devices(bus);
	else if (frozen_bus)
		pci_unlock_rescan_remove();
	} else if (frozen_bus) {
		eeh_pe_dev_traverse(pe, eeh_rmv_device, &removed);
		eeh_pe_dev_traverse(pe, eeh_rmv_device, &removed);
	}


	/* Reset the pci controller. (Asserts RST#; resets config space).
	/* Reset the pci controller. (Asserts RST#; resets config space).
	 * Reconfigure bridges and devices. Don't try to bring the system
	 * Reconfigure bridges and devices. Don't try to bring the system
@@ -429,6 +434,8 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
	if (rc)
	if (rc)
		return rc;
		return rc;


	pci_lock_rescan_remove();

	/* Restore PE */
	/* Restore PE */
	eeh_ops->configure_bridge(pe);
	eeh_ops->configure_bridge(pe);
	eeh_pe_restore_bars(pe);
	eeh_pe_restore_bars(pe);
@@ -462,6 +469,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
	pe->tstamp = tstamp;
	pe->tstamp = tstamp;
	pe->freeze_count = cnt;
	pe->freeze_count = cnt;


	pci_unlock_rescan_remove();
	return 0;
	return 0;
}
}


@@ -618,8 +626,11 @@ static void eeh_handle_normal_event(struct eeh_pe *pe)
	eeh_pe_dev_traverse(pe, eeh_report_failure, NULL);
	eeh_pe_dev_traverse(pe, eeh_report_failure, NULL);


	/* Shut down the device drivers for good. */
	/* Shut down the device drivers for good. */
	if (frozen_bus)
	if (frozen_bus) {
		pci_lock_rescan_remove();
		pcibios_remove_pci_devices(frozen_bus);
		pcibios_remove_pci_devices(frozen_bus);
		pci_unlock_rescan_remove();
	}
}
}


static void eeh_handle_special_event(void)
static void eeh_handle_special_event(void)
@@ -692,6 +703,7 @@ static void eeh_handle_special_event(void)
	if (rc == 2 || rc == 1)
	if (rc == 2 || rc == 1)
		eeh_handle_normal_event(pe);
		eeh_handle_normal_event(pe);
	else {
	else {
		pci_lock_rescan_remove();
		list_for_each_entry_safe(hose, tmp,
		list_for_each_entry_safe(hose, tmp,
			&hose_list, list_node) {
			&hose_list, list_node) {
			phb_pe = eeh_phb_pe_get(hose);
			phb_pe = eeh_phb_pe_get(hose);
@@ -703,6 +715,7 @@ static void eeh_handle_special_event(void)
			eeh_pe_dev_traverse(pe, eeh_report_failure, NULL);
			eeh_pe_dev_traverse(pe, eeh_report_failure, NULL);
			pcibios_remove_pci_devices(bus);
			pcibios_remove_pci_devices(bus);
		}
		}
		pci_unlock_rescan_remove();
	}
	}
}
}


+6 −0
Original line number Original line Diff line number Diff line
@@ -596,7 +596,9 @@ static int acpi_pci_root_add(struct acpi_device *device,
		pci_assign_unassigned_root_bus_resources(root->bus);
		pci_assign_unassigned_root_bus_resources(root->bus);
	}
	}


	pci_lock_rescan_remove();
	pci_bus_add_devices(root->bus);
	pci_bus_add_devices(root->bus);
	pci_unlock_rescan_remove();
	return 1;
	return 1;


end:
end:
@@ -608,6 +610,8 @@ static void acpi_pci_root_remove(struct acpi_device *device)
{
{
	struct acpi_pci_root *root = acpi_driver_data(device);
	struct acpi_pci_root *root = acpi_driver_data(device);


	pci_lock_rescan_remove();

	pci_stop_root_bus(root->bus);
	pci_stop_root_bus(root->bus);


	device_set_run_wake(root->bus->bridge, false);
	device_set_run_wake(root->bus->bridge, false);
@@ -615,6 +619,8 @@ static void acpi_pci_root_remove(struct acpi_device *device)


	pci_remove_root_bus(root->bus);
	pci_remove_root_bus(root->bus);


	pci_unlock_rescan_remove();

	kfree(root);
	kfree(root);
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -346,7 +346,7 @@ static int mpt_remove_dead_ioc_func(void *arg)
	if ((pdev == NULL))
	if ((pdev == NULL))
		return -1;
		return -1;


	pci_stop_and_remove_bus_device(pdev);
	pci_stop_and_remove_bus_device_locked(pdev);
	return 0;
	return 0;
}
}


+4 −1
Original line number Original line Diff line number Diff line
@@ -77,6 +77,8 @@ struct acpiphp_bridge {


	/* PCI-to-PCI bridge device */
	/* PCI-to-PCI bridge device */
	struct pci_dev *pci_dev;
	struct pci_dev *pci_dev;

	bool is_going_away;
};
};




@@ -150,6 +152,7 @@ struct acpiphp_attention_info
/* slot flags */
/* slot flags */


#define SLOT_ENABLED		(0x00000001)
#define SLOT_ENABLED		(0x00000001)
#define SLOT_IS_GOING_AWAY	(0x00000002)


/* function flags */
/* function flags */


@@ -169,7 +172,7 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot);
typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);


int acpiphp_enable_slot(struct acpiphp_slot *slot);
int acpiphp_enable_slot(struct acpiphp_slot *slot);
int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot);
int acpiphp_disable_slot(struct acpiphp_slot *slot);
u8 acpiphp_get_power_status(struct acpiphp_slot *slot);
u8 acpiphp_get_power_status(struct acpiphp_slot *slot);
u8 acpiphp_get_attention_status(struct acpiphp_slot *slot);
u8 acpiphp_get_attention_status(struct acpiphp_slot *slot);
u8 acpiphp_get_latch_status(struct acpiphp_slot *slot);
u8 acpiphp_get_latch_status(struct acpiphp_slot *slot);
+1 −1
Original line number Original line Diff line number Diff line
@@ -156,7 +156,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
	pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));
	pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));


	/* disable the specified slot */
	/* disable the specified slot */
	return acpiphp_disable_and_eject_slot(slot->acpi_slot);
	return acpiphp_disable_slot(slot->acpi_slot);
}
}




Loading