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

Commit b29f83aa authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull PCI fixes from Bjorn Helgaas:
 "These fix:

   - Boot video device detection on dual-GPU Apple systems
   - Hotplug fiascos on VGA switcheroo with radeon & nouveau drivers
   - Boot hang on Freescale i.MX6 systems
   - Excessive "no hotplug settings from platform" warnings

  In particular:

  Enumeration
    - Don't default exclusively to first video device (Bruno Prémont)

  PCI device hotplug
    - Remove "no hotplug settings from platform" warning (Bjorn Helgaas)
    - Add pci_ignore_hotplug() for VGA switcheroo (Bjorn Helgaas)

  Freescale i.MX6
    - Put LTSSM in "Detect" state before disabling (Lucas Stach)"

* tag 'pci-v3.17-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  vgaarb: Drop obsolete #ifndef
  vgaarb: Don't default exclusively to first video device with mem+io
  ACPIPHP / radeon / nouveau: Remove acpi_bus_no_hotplug()
  PCI: Remove "no hotplug settings from platform" warning
  PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device
  PCI: imx6: Put LTSSM in "Detect" state before disabling it
  MAINTAINERS: Add Lucas Stach as co-maintainer for i.MX6 PCI driver
parents 73030efa 649ae752
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6876,7 +6876,7 @@ F: arch/x86/kernel/quirks.c

PCI DRIVER FOR IMX6
M:	Richard Zhu <r65037@freescale.com>
M:	Shawn Guo <shawn.guo@freescale.com>
M:	Lucas Stach <l.stach@pengutronix.de>
L:	linux-pci@vger.kernel.org
L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S:	Maintained
+1 −23
Original line number Diff line number Diff line
@@ -38,27 +38,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
		return;
	/* Maybe, this machine supports legacy memory map. */

	if (!vga_default_device()) {
		resource_size_t start, end;
		int i;

		/* Does firmware framebuffer belong to us? */
		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
			if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
				continue;

			start = pci_resource_start(pdev, i);
			end  = pci_resource_end(pdev, i);

			if (!start || !end)
				continue;

			if (screen_info.lfb_base >= start &&
			    (screen_info.lfb_base + screen_info.lfb_size) < end)
				vga_set_default_device(pdev);
		}
	}

	/* Is VGA routed to us? */
	bus = pdev->bus;
	while (bus) {
@@ -83,8 +62,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
		pci_read_config_word(pdev, PCI_COMMAND, &config);
		if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
			pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
			dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
			vga_set_default_device(pdev);
			dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
		}
	}
}
+1 −23
Original line number Diff line number Diff line
@@ -326,27 +326,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
	struct pci_bus *bus;
	u16 config;

	if (!vga_default_device()) {
		resource_size_t start, end;
		int i;

		/* Does firmware framebuffer belong to us? */
		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
			if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
				continue;

			start = pci_resource_start(pdev, i);
			end  = pci_resource_end(pdev, i);

			if (!start || !end)
				continue;

			if (screen_info.lfb_base >= start &&
			    (screen_info.lfb_base + screen_info.lfb_size) < end)
				vga_set_default_device(pdev);
		}
	}

	/* Is VGA routed to us? */
	bus = pdev->bus;
	while (bus) {
@@ -371,8 +350,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
		pci_read_config_word(pdev, PCI_COMMAND, &config);
		if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
			pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
			dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
			vga_set_default_device(pdev);
			dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
		}
	}
}
+0 −10
Original line number Diff line number Diff line
@@ -177,16 +177,6 @@ void acpi_bus_detach_private_data(acpi_handle handle)
}
EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data);

void acpi_bus_no_hotplug(acpi_handle handle)
{
	struct acpi_device *adev = NULL;

	acpi_bus_get_device(handle, &adev);
	if (adev)
		adev->flags.no_hotplug = true;
}
EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug);

static void acpi_print_osc_error(acpi_handle handle,
	struct acpi_osc_context *context, char *error)
{
+2 −14
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ static struct nouveau_dsm_priv {
	bool dsm_detected;
	bool optimus_detected;
	acpi_handle dhandle;
	acpi_handle other_handle;
	acpi_handle rom_handle;
} nouveau_dsm_priv;

@@ -222,10 +221,9 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
	if (!dhandle)
		return false;

	if (!acpi_has_method(dhandle, "_DSM")) {
		nouveau_dsm_priv.other_handle = dhandle;
	if (!acpi_has_method(dhandle, "_DSM"))
		return false;
	}

	if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102,
			   1 << NOUVEAU_DSM_POWER))
		retval |= NOUVEAU_DSM_HAS_MUX;
@@ -301,16 +299,6 @@ static bool nouveau_dsm_detect(void)
		printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n",
			acpi_method_name);
		nouveau_dsm_priv.dsm_detected = true;
		/*
		 * On some systems hotplug events are generated for the device
		 * being switched off when _DSM is executed.  They cause ACPI
		 * hotplug to trigger and attempt to remove the device from
		 * the system, which causes it to break down.  Prevent that from
		 * happening by setting the no_hotplug flag for the involved
		 * ACPI device objects.
		 */
		acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle);
		acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle);
		ret = true;
	}

Loading