diff options
Diffstat (limited to 'drivers/pci/hotplug')
| -rw-r--r-- | drivers/pci/hotplug/acpi_pcihp.c | 6 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 2 | ||||
| -rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_core.c | 2 | ||||
| -rw-r--r-- | drivers/pci/hotplug/cpqphp_core.c | 17 | ||||
| -rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 3 | ||||
| -rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 11 | ||||
| -rw-r--r-- | drivers/pci/hotplug/rpadlpar_core.c | 2 | ||||
| -rw-r--r-- | drivers/pci/hotplug/shpchp_sysfs.c | 21 | 
8 files changed, 25 insertions, 39 deletions
| diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c index 8f3faf343f75..095f29e13734 100644 --- a/drivers/pci/hotplug/acpi_pcihp.c +++ b/drivers/pci/hotplug/acpi_pcihp.c @@ -408,7 +408,7 @@ got_one:  }  EXPORT_SYMBOL(acpi_get_hp_hw_control_from_firmware); -static int is_ejectable(acpi_handle handle) +static int pcihp_is_ejectable(acpi_handle handle)  {  	acpi_status status;  	acpi_handle tmp; @@ -442,7 +442,7 @@ int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle)  		return 0;  	if (bridge_handle != parent_handle)  		return 0; -	return is_ejectable(handle); +	return pcihp_is_ejectable(handle);  }  EXPORT_SYMBOL_GPL(acpi_pci_check_ejectable); @@ -450,7 +450,7 @@ static acpi_status  check_hotplug(acpi_handle handle, u32 lvl, void *context, void **rv)  {  	int *found = (int *)context; -	if (is_ejectable(handle)) { +	if (pcihp_is_ejectable(handle)) {  		*found = 1;  		return AE_CTRL_TERMINATE;  	} diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index a70fa89f76fd..220285760b68 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -110,7 +110,7 @@ static int post_dock_fixups(struct notifier_block *nb, unsigned long val,  } -static struct acpi_dock_ops acpiphp_dock_ops = { +static const struct acpi_dock_ops acpiphp_dock_ops = {  	.handler = handle_hotplug_event_func,  }; diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index d703e73fffa7..3fadf2f135e8 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c @@ -32,7 +32,7 @@  #include <linux/pci_hotplug.h>  #include <linux/init.h>  #include <linux/interrupt.h> -#include <asm/atomic.h> +#include <linux/atomic.h>  #include <linux/delay.h>  #include <linux/kthread.h>  #include "cpci_hotplug.h" diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 4952c3b9379d..f1ce99cceac6 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c @@ -840,8 +840,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)  	/* Need to read VID early b/c it's used to differentiate CPQ and INTC  	 * discovery  	 */ -	rc = pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor_id); -	if (rc || ((vendor_id != PCI_VENDOR_ID_COMPAQ) && (vendor_id != PCI_VENDOR_ID_INTEL))) { +	vendor_id = pdev->vendor; +	if ((vendor_id != PCI_VENDOR_ID_COMPAQ) && +	    (vendor_id != PCI_VENDOR_ID_INTEL)) {  		err(msg_HPC_non_compaq_or_intel);  		rc = -ENODEV;  		goto err_disable_device; @@ -868,11 +869,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)  	/* TODO: This code can be made to support non-Compaq or Intel  	 * subsystem IDs  	 */ -	rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid); -	if (rc) { -		err("%s : pci_read_config_word failed\n", __func__); -		goto err_disable_device; -	} +	subsystem_vid = pdev->subsystem_vendor;  	dbg("Subsystem Vendor ID: %x\n", subsystem_vid);  	if ((subsystem_vid != PCI_VENDOR_ID_COMPAQ) && (subsystem_vid != PCI_VENDOR_ID_INTEL)) {  		err(msg_HPC_non_compaq_or_intel); @@ -887,11 +884,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)  		goto err_disable_device;  	} -	rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &subsystem_deviceid); -	if (rc) { -		err("%s : pci_read_config_word failed\n", __func__); -		goto err_free_ctrl; -	} +	subsystem_deviceid = pdev->subsystem_device;  	info("Hot Plug Subsystem Device ID: %x\n", subsystem_deviceid); diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 085dbb5fc168..1e9c9aacc3a6 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -213,6 +213,9 @@ static int board_added(struct slot *p_slot)  		goto err_exit;  	} +	/* Wait for 1 second after checking link training status */ +	msleep(1000); +  	/* Check for a power fault */  	if (ctrl->power_fault_detected || pciehp_query_power_fault(p_slot)) {  		ctrl_err(ctrl, "Power fault on slot %s\n", slot_name(p_slot)); diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 50a23da5d24d..96dc4734e4af 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -275,16 +275,9 @@ int pciehp_check_link_status(struct controller *ctrl)           * hot-plug capable downstream port. But old controller might           * not implement it. In this case, we wait for 1000 ms.           */ -        if (ctrl->link_active_reporting){ -                /* Wait for Data Link Layer Link Active bit to be set */ +        if (ctrl->link_active_reporting)                  pcie_wait_link_active(ctrl); -                /* -                 * We must wait for 100 ms after the Data Link Layer -                 * Link Active bit reads 1b before initiating a -                 * configuration access to the hot added device. -                 */ -                msleep(100); -        } else +        else                  msleep(1000);  	retval = pciehp_readw(ctrl, PCI_EXP_LNKSTA, &lnk_status); diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index 083034710fa6..1d002b1c2bf4 100644 --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c @@ -158,7 +158,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)  	/* Scan below the new bridge */  	if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||  	    dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) -		of_scan_pci_bridge(dn, dev); +		of_scan_pci_bridge(dev);  	/* Map IO space for child bus, which may or may not succeed */  	pcibios_map_io_space(dev->subordinate); diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c index 071b7dc0094b..efa30da1ae8f 100644 --- a/drivers/pci/hotplug/shpchp_sysfs.c +++ b/drivers/pci/hotplug/shpchp_sysfs.c @@ -50,29 +50,26 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha  	pci_bus_for_each_resource(bus, res, index) {  		if (res && (res->flags & IORESOURCE_MEM) &&  				!(res->flags & IORESOURCE_PREFETCH)) { -			out += sprintf(out, "start = %8.8llx, " -					"length = %8.8llx\n", -					(unsigned long long)res->start, -					(unsigned long long)(res->end - res->start)); +			out += sprintf(out, "start = %8.8llx, length = %8.8llx\n", +				       (unsigned long long)res->start, +				       (unsigned long long)resource_size(res));  		}  	}  	out += sprintf(out, "Free resources: prefetchable memory\n");  	pci_bus_for_each_resource(bus, res, index) {  		if (res && (res->flags & IORESOURCE_MEM) &&  			       (res->flags & IORESOURCE_PREFETCH)) { -			out += sprintf(out, "start = %8.8llx, " -					"length = %8.8llx\n", -					(unsigned long long)res->start, -					(unsigned long long)(res->end - res->start)); +			out += sprintf(out, "start = %8.8llx, length = %8.8llx\n", +				       (unsigned long long)res->start, +				       (unsigned long long)resource_size(res));  		}  	}  	out += sprintf(out, "Free resources: IO\n");  	pci_bus_for_each_resource(bus, res, index) {  		if (res && (res->flags & IORESOURCE_IO)) { -			out += sprintf(out, "start = %8.8llx, " -					"length = %8.8llx\n", -					(unsigned long long)res->start, -					(unsigned long long)(res->end - res->start)); +			out += sprintf(out, "start = %8.8llx, length = %8.8llx\n", +				       (unsigned long long)res->start, +				       (unsigned long long)resource_size(res));  		}  	}  	out += sprintf(out, "Free resources: bus numbers\n"); | 
