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

Commit dc53fffc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI: Fix IRQ swizzling for ARI-enabled devices
  ia64/PCI: adjust section annotation for pcibios_setup()
  x86/PCI: get root CRS before scanning children
  x86/PCI: fix boundary checking when using root CRS
  PCI MSI: Fix restoration of MSI/MSI-X mask states in suspend/resume
  PCI MSI: Unmask MSI if setup failed
  PCI MSI: shorten PCI_MSIX_ENTRY_* symbol names
  PCI: make pci_name() take const argument
  PCI: More PATA quirks for not entering D3
  PCI: fix kernel-doc warnings
  PCI: check if bus has a proper bridge device before triggering SBR
  PCI: remove pci_dac_dma_... APIs on mn10300
  PCI ECRC: Remove unnecessary semicolons
  PCI MSI: Return if alloc_msi_entry for MSI-X failed
parents f560902c 46b952a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ pcibios_align_resource (void *data, struct resource *res,
/*
 * PCI BIOS setup, always defaults to SAL interface
 */
char * __devinit
char * __init
pcibios_setup (char *str)
{
	return str;
+0 −4
Original line number Diff line number Diff line
@@ -70,10 +70,6 @@ struct pci_dev;
 */
#define PCI_DMA_BUS_IS_PHYS	(1)


/* This is always fine. */
#define pci_dac_dma_supported(pci_dev, mask)	(0)

/* Return the index of the PCI controller for device. */
static inline int pci_controller_num(struct pci_dev *dev)
{
+24 −35
Original line number Diff line number Diff line
@@ -68,6 +68,10 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
	unsigned long flags;
	struct resource *root;
	int max_root_bus_resources = PCI_BUS_NUM_RESOURCES;
	u64 start, end;

	if (bus_has_transparent_bridge(info->bus))
		max_root_bus_resources -= 3;

	status = resource_to_addr(acpi_res, &addr);
	if (!ACPI_SUCCESS(status))
@@ -84,25 +88,24 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
	} else
		return AE_OK;

	res = &info->res[info->res_num];
	res->name = info->name;
	res->flags = flags;
	res->start = addr.minimum + addr.translation_offset;
	res->end = res->start + addr.address_length - 1;
	res->child = NULL;

	if (bus_has_transparent_bridge(info->bus))
		max_root_bus_resources -= 3;
	start = addr.minimum + addr.translation_offset;
	end = start + addr.address_length - 1;
	if (info->res_num >= max_root_bus_resources) {
		printk(KERN_WARNING "PCI: Failed to allocate 0x%lx-0x%lx "
			"from %s for %s due to _CRS returning more than "
			"%d resource descriptors\n", (unsigned long) res->start,
			(unsigned long) res->end, root->name, info->name,
			"%d resource descriptors\n", (unsigned long) start,
			(unsigned long) end, root->name, info->name,
			max_root_bus_resources);
		info->res_num++;
		return AE_OK;
	}

	res = &info->res[info->res_num];
	res->name = info->name;
	res->flags = flags;
	res->start = start;
	res->end = end;
	res->child = NULL;

	if (insert_resource(root, res)) {
		printk(KERN_ERR "PCI: Failed to allocate 0x%lx-0x%lx "
			"from %s for %s\n", (unsigned long) res->start,
@@ -114,23 +117,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
	return AE_OK;
}

static void
adjust_transparent_bridge_resources(struct pci_bus *bus)
{
	struct pci_dev *dev;

	list_for_each_entry(dev, &bus->devices, bus_list) {
		int i;
		u16 class = dev->class >> 8;

		if (class == PCI_CLASS_BRIDGE_PCI && dev->transparent) {
			for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++)
				dev->subordinate->resource[i] =
						dev->bus->resource[i - 3];
		}
	}
}

static void
get_current_resources(struct acpi_device *device, int busnum,
			int domain, struct pci_bus *bus)
@@ -158,8 +144,6 @@ get_current_resources(struct acpi_device *device, int busnum,
	info.res_num = 0;
	acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
				&info);
	if (info.res_num)
		adjust_transparent_bridge_resources(bus);

	return;

@@ -222,8 +206,15 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
		 */
		memcpy(bus->sysdata, sd, sizeof(*sd));
		kfree(sd);
	} else
		bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
	} else {
		bus = pci_create_bus(NULL, busnum, &pci_root_ops, sd);
		if (bus) {
			if (pci_probe & PCI_USE__CRS)
				get_current_resources(device, busnum, domain,
							bus);
			bus->subordinate = pci_scan_child_bus(bus);
		}
	}

	if (!bus)
		kfree(sd);
@@ -238,8 +229,6 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
#endif
	}

	if (bus && (pci_probe & PCI_USE__CRS))
		get_current_resources(device, busnum, domain, bus);
	return bus;
}

+6 −2
Original line number Diff line number Diff line
@@ -100,8 +100,9 @@ void x86_pci_root_bus_res_quirks(struct pci_bus *b)
	int j;
	struct pci_root_info *info;

	/* don't go for it if _CRS is used */
	if (pci_probe & PCI_USE__CRS)
	/* don't go for it if _CRS is used already */
	if (b->resource[0] != &ioport_resource ||
	    b->resource[1] != &iomem_resource)
		return;

	/* if only one root bus, don't need to anything */
@@ -116,6 +117,9 @@ void x86_pci_root_bus_res_quirks(struct pci_bus *b)
	if (i == pci_root_num)
		return;

	printk(KERN_DEBUG "PCI: peer root bus %02x res updated from pci conf\n",
			b->number);

	info = &pci_root_info[i];
	for (j = 0; j < info->res_num; j++) {
		struct resource *res;
+2 −0
Original line number Diff line number Diff line
@@ -555,6 +555,8 @@ static struct hotplug_slot *get_slot_from_name (const char *name)
 * @slot: pointer to the &struct hotplug_slot to register
 * @devnr: device number
 * @name: name registered with kobject core
 * @owner: caller module owner
 * @mod_name: caller module name
 *
 * Registers a hotplug slot with the pci hotplug subsystem, which will allow
 * userspace interaction to the slot.
Loading