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

Commit 7f768544 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branches 'pci/enumeration', 'pci/hotplug', 'pci/misc', 'pci/ntb',...

Merge branches 'pci/enumeration', 'pci/hotplug', 'pci/misc', 'pci/ntb', 'pci/thunderbolt' and 'pci/virtualization' into next

* pci/enumeration:
  x86/PCI: Refine PCI support check in pcibios_init()

* pci/hotplug:
  PCI: acpiphp_ibm: Avoid uninitialized variable reference

* pci/misc:
  PCI: Fix spelling errors

* pci/ntb:
  PCI: Add DMA alias quirk for mic_x200_dma
  PCI: Add support for multiple DMA aliases
  PCI: Move informational printk to pci_add_dma_alias()
  PCI: Add pci_add_dma_alias() to abstract implementation

* pci/thunderbolt:
  thunderbolt: Support 1st gen Light Ridge controller
  thunderbolt: Fix typos and magic number
  PCI: Add Intel Thunderbolt device IDs

* pci/virtualization:
  PCI: Work around Intel Sunrise Point PCH incorrect ACS capability
  PCI: Reverse standard ACS vs device-specific ACS enabling
  PCI: Mark Intel i40e NIC INTx masking as broken
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ void __init pcibios_set_cache_line_size(void)

int __init pcibios_init(void)
{
	if (!raw_pci_ops) {
	if (!raw_pci_ops && !raw_pci_ext_ops) {
		printk(KERN_WARNING "PCI: System does not support PCI\n");
		return 0;
	}
+3 −7
Original line number Diff line number Diff line
@@ -660,8 +660,8 @@ static struct iommu_group *get_pci_function_alias_group(struct pci_dev *pdev,
}

/*
 * Look for aliases to or from the given device for exisiting groups.  The
 * dma_alias_devfn only supports aliases on the same bus, therefore the search
 * Look for aliases to or from the given device for existing groups. DMA
 * aliases are only supported on the same bus, therefore the search
 * space is quite small (especially since we're really only looking at pcie
 * device, and therefore only expect multiple slots on the root complex or
 * downstream switch ports).  It's conceivable though that a pair of
@@ -686,11 +686,7 @@ static struct iommu_group *get_pci_alias_group(struct pci_dev *pdev,
			continue;

		/* We alias them or they alias us */
		if (((pdev->dev_flags & PCI_DEV_FLAGS_DMA_ALIAS_DEVFN) &&
		     pdev->dma_alias_devfn == tmp->devfn) ||
		    ((tmp->dev_flags & PCI_DEV_FLAGS_DMA_ALIAS_DEVFN) &&
		     tmp->dma_alias_devfn == pdev->devfn)) {

		if (pci_devs_are_dma_aliases(pdev, tmp)) {
			group = get_pci_alias_group(tmp, devfns);
			if (group) {
				pci_dev_put(tmp);
+1 −1
Original line number Diff line number Diff line
@@ -819,7 +819,7 @@ static int nwl_pcie_probe(struct platform_device *pdev)

	err = nwl_pcie_bridge_init(pcie);
	if (err) {
		dev_err(pcie->dev, "HW Initalization failed\n");
		dev_err(pcie->dev, "HW Initialization failed\n");
		return err;
	}

+2 −0
Original line number Diff line number Diff line
@@ -138,6 +138,8 @@ static union apci_descriptor *ibm_slot_from_id(int id)
	char *table;

	size = ibm_get_table_from_acpi(&table);
	if (size < 0)
		return NULL;
	des = (union apci_descriptor *)table;
	if (memcmp(des->header.sig, "aPCI", 4) != 0)
		goto ibm_slot_done;
+36 −7
Original line number Diff line number Diff line
@@ -2389,7 +2389,7 @@ static int pci_ea_read(struct pci_dev *dev, int offset)
	return offset + ent_size;
}

/* Enhanced Allocation Initalization */
/* Enhanced Allocation Initialization */
void pci_ea_init(struct pci_dev *dev)
{
	int ea;
@@ -2547,7 +2547,7 @@ void pci_request_acs(void)
 * pci_std_enable_acs - enable ACS on devices using standard ACS capabilites
 * @dev: the PCI device
 */
static int pci_std_enable_acs(struct pci_dev *dev)
static void pci_std_enable_acs(struct pci_dev *dev)
{
	int pos;
	u16 cap;
@@ -2555,7 +2555,7 @@ static int pci_std_enable_acs(struct pci_dev *dev)

	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS);
	if (!pos)
		return -ENODEV;
		return;

	pci_read_config_word(dev, pos + PCI_ACS_CAP, &cap);
	pci_read_config_word(dev, pos + PCI_ACS_CTRL, &ctrl);
@@ -2573,8 +2573,6 @@ static int pci_std_enable_acs(struct pci_dev *dev)
	ctrl |= (cap & PCI_ACS_UF);

	pci_write_config_word(dev, pos + PCI_ACS_CTRL, ctrl);

	return 0;
}

/**
@@ -2586,10 +2584,10 @@ void pci_enable_acs(struct pci_dev *dev)
	if (!pci_acs_enable)
		return;

	if (!pci_std_enable_acs(dev))
	if (!pci_dev_specific_enable_acs(dev))
		return;

	pci_dev_specific_enable_acs(dev);
	pci_std_enable_acs(dev);
}

static bool pci_acs_flags_enabled(struct pci_dev *pdev, u16 acs_flags)
@@ -4578,6 +4576,37 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
	return 0;
}

/**
 * pci_add_dma_alias - Add a DMA devfn alias for a device
 * @dev: the PCI device for which alias is added
 * @devfn: alias slot and function
 *
 * This helper encodes 8-bit devfn as bit number in dma_alias_mask.
 * It should be called early, preferably as PCI fixup header quirk.
 */
void pci_add_dma_alias(struct pci_dev *dev, u8 devfn)
{
	if (!dev->dma_alias_mask)
		dev->dma_alias_mask = kcalloc(BITS_TO_LONGS(U8_MAX),
					      sizeof(long), GFP_KERNEL);
	if (!dev->dma_alias_mask) {
		dev_warn(&dev->dev, "Unable to allocate DMA alias mask\n");
		return;
	}

	set_bit(devfn, dev->dma_alias_mask);
	dev_info(&dev->dev, "Enabling fixed DMA alias to %02x.%d\n",
		 PCI_SLOT(devfn), PCI_FUNC(devfn));
}

bool pci_devs_are_dma_aliases(struct pci_dev *dev1, struct pci_dev *dev2)
{
	return (dev1->dma_alias_mask &&
		test_bit(dev2->devfn, dev1->dma_alias_mask)) ||
	       (dev2->dma_alias_mask &&
		test_bit(dev1->devfn, dev2->dma_alias_mask));
}

bool pci_device_is_present(struct pci_dev *pdev)
{
	u32 v;
Loading