linux/drivers/gpu/drm/nouveau
Bjorn Helgaas b440bde74f PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device
Powering off a hot-pluggable device, e.g., with pci_set_power_state(D3cold),
normally generates a hot-remove event that unbinds the driver.

Some drivers expect to remain bound to a device even while they power it
off and back on again.  This can be dangerous, because if the device is
removed or replaced while it is powered off, the driver doesn't know that
anything changed.  But some drivers accept that risk.

Add pci_ignore_hotplug() for use by drivers that know their device cannot
be removed.  Using pci_ignore_hotplug() tells the PCI core that hot-plug
events for the device should be ignored.

The radeon and nouveau drivers use this to switch between a low-power,
integrated GPU and a higher-power, higher-performance discrete GPU.  They
power off the unused GPU, but they want to remain bound to it.

This is a reimplementation of f244d8b623 ("ACPIPHP / radeon / nouveau:
Fix VGA switcheroo problem related to hotplug") but extends it to work with
both acpiphp and pciehp.

This fixes a problem where systems with dual GPUs using the radeon drivers
become unusable, freezing every few seconds (see bugzillas below).  The
resume of the radeon device may also fail, e.g.,

This fixes problems on dual GPU systems where the radeon driver becomes
unusable because of problems while suspending the device, as in bug 79701:

    [drm] radeon: finishing device.
    radeon 0000:01:00.0: Userspace still has active objects !
    radeon 0000:01:00.0: ffff8800cb4ec288 ffff8800cb4ec000 16384 4294967297 force free
    ...
    WARNING: CPU: 0 PID: 67 at /home/apw/COD/linux/drivers/gpu/drm/radeon/radeon_gart.c:234 radeon_gart_unbind+0xd2/0xe0 [radeon]()
    trying to unbind memory from uninitialized GART !

or while resuming it, as in bug 77261:

    radeon 0000:01:00.0: ring 0 stalled for more than 10158msec
    radeon 0000:01:00.0: GPU lockup ...
    radeon 0000:01:00.0: GPU pci config reset
    pciehp 0000:00:01.0:pcie04: Card not present on Slot(1-1)
    radeon 0000:01:00.0: GPU reset succeeded, trying to resume
    *ERROR* radeon: dpm resume failed
    radeon 0000:01:00.0: Wait for MC idle timedout !

Link: https://bugzilla.kernel.org/show_bug.cgi?id=77261
Link: https://bugzilla.kernel.org/show_bug.cgi?id=79701
Reported-by: Shawn Starr <shawn.starr@rogers.com>
Reported-by: Jose P. <lbdkmjdf@sharklasers.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Rajat Jain <rajatxjain@gmail.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Dave Airlie <airlied@redhat.com>
CC: stable@vger.kernel.org	# v3.15+
2014-09-10 13:45:01 -06:00
..
core drm/nouveau/gk20a: add LTC device 2014-08-15 07:58:39 +10:00
dispnv04 drm/nouveau: use ram info from nvif_device 2014-08-10 05:28:12 +10:00
nvif drm/nouveau/nvif: fix dac load detect method definition 2014-08-15 07:58:39 +10:00
Kconfig drm/nouveau: support for probing platform devices 2014-08-10 05:11:10 +10:00
Makefile drm/nouveau: expose the full object/event interfaces to userspace 2014-08-10 05:28:18 +10:00
nouveau_abi16.c drm/nouveau: use ram info from nvif_device 2014-08-10 05:28:12 +10:00
nouveau_abi16.h drm/nouveau: port to nvif client/device/objects 2014-08-10 05:13:14 +10:00
nouveau_acpi.c drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi 2014-05-02 16:24:52 +10:00
nouveau_acpi.h nouveau: ACPI support depends on X86 and X86_PLATFORM_DEVICES 2013-02-20 16:05:16 +10:00
nouveau_agp.c drm/nouveau: remove as much direct use of core headers as possible 2014-08-10 05:13:16 +10:00
nouveau_agp.h drm/nouveau: implement devinit subdev, and new init table parser 2012-10-03 13:12:47 +10:00
nouveau_backlight.c drm/nouveau: initial pass at moving to struct nvif_device 2014-08-10 05:13:13 +10:00
nouveau_bios.c drm/nv50-/disp: audit and version DAC_PWR method 2014-08-10 05:28:07 +10:00
nouveau_bios.h drm/nv04/disp: hide all the cruft away in its own little hole 2013-04-26 15:37:51 +10:00
nouveau_bo.c drm/nouveau: kill unused variable warning if !__OS_HAS_AGP 2014-08-15 07:58:38 +10:00
nouveau_bo.h drm/nouveau: embed gem object in nouveau_bo 2013-10-09 14:37:55 +10:00
nouveau_chan.c drm/nouveau: use ram info from nvif_device 2014-08-10 05:28:12 +10:00
nouveau_chan.h drm/nouveau/fifo: audit and version fifo channel classes 2014-08-10 05:28:04 +10:00
nouveau_connector.c drm/nouveau/disp: implement nvif event sources for vblank/connector notifiers 2014-08-10 05:28:12 +10:00
nouveau_connector.h drm/nouveau/disp: implement nvif event sources for vblank/connector notifiers 2014-08-10 05:28:12 +10:00
nouveau_crtc.h drm/nouveau/disp: implement nvif event sources for vblank/connector notifiers 2014-08-10 05:28:12 +10:00
nouveau_debugfs.c drm/nouveau: restore debugfs/vbios.rom support 2013-02-20 20:46:34 +10:00
nouveau_debugfs.h drm/nouveau: restore debugfs/vbios.rom support 2013-02-20 20:46:34 +10:00
nouveau_display.c drm/nouveau: warn if we fail to re-pin fb on resume 2014-08-15 07:58:39 +10:00
nouveau_display.h drm/nouveau: port to nvif client/device/objects 2014-08-10 05:13:14 +10:00
nouveau_dma.c drm/nouveau: remove as much direct use of core headers as possible 2014-08-10 05:13:16 +10:00
nouveau_dma.h drm/nouveau: remove (most) hardcoded object handle usage 2014-08-10 05:13:15 +10:00
nouveau_dp.c drm/nouveau: remove as much direct use of core headers as possible 2014-08-10 05:13:16 +10:00
nouveau_drm.c PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device 2014-09-10 13:45:01 -06:00
nouveau_drm.h drm/nouveau: expose the full object/event interfaces to userspace 2014-08-10 05:28:18 +10:00
nouveau_encoder.h drm/nouveau/dp: probe dpcd to determine connectedness 2014-06-11 16:11:42 +10:00
nouveau_fbcon.c drm/nouveau/kms: nouveau_fbcon_accel_fini can be static 2014-08-15 07:58:38 +10:00
nouveau_fbcon.h drm/nouveau: port to nvif client/device/objects 2014-08-10 05:13:14 +10:00
nouveau_fence.c drm/nouveau/fifo: implement nvif event source 2014-08-10 05:28:05 +10:00
nouveau_fence.h drm/nouveau: delay busy bo vma removal until fence signals 2013-07-01 13:50:31 +10:00
nouveau_gem.c drm/nouveau: port to nvif client/device/objects 2014-08-10 05:13:14 +10:00
nouveau_gem.h dma-buf: use reservation objects 2014-07-08 13:03:20 -07:00
nouveau_hwmon.c drm/nouveau: port to nvif client/device/objects 2014-08-10 05:13:14 +10:00
nouveau_hwmon.h drm/nouveau/drm/pm: remove everything except the hwmon interfaces to THERM 2013-11-08 15:40:00 +10:00
nouveau_ioc32.c drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
nouveau_ioctl.h drm/nouveau: fix up 32-bit ioctls and device wake up. 2013-09-02 09:52:55 +10:00
nouveau_nvif.c drm/nouveau: expose the full object/event interfaces to userspace 2014-08-10 05:28:18 +10:00
nouveau_platform.c drm/nouveau/platform: fix compilation error 2014-08-15 07:58:39 +10:00
nouveau_platform.h drm/nouveau: support for probing platform devices 2014-08-10 05:11:10 +10:00
nouveau_prime.c dma-buf: use reservation objects 2014-07-08 13:03:20 -07:00
nouveau_reg.h
nouveau_sgdma.c drm/nouveau: port to nvif client/device/objects 2014-08-10 05:13:14 +10:00
nouveau_sysfs.c drm/nouveau: hide sysfs pstate file behind an option again 2014-08-10 05:28:18 +10:00
nouveau_sysfs.h drm/nouveau: port to nvif client/device/objects 2014-08-10 05:13:14 +10:00
nouveau_ttm.c drm/nouveau: use ram info from nvif_device 2014-08-10 05:28:12 +10:00
nouveau_ttm.h drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nouveau_usif.c drm/nouveau: expose the full object/event interfaces to userspace 2014-08-10 05:28:18 +10:00
nouveau_usif.h drm/nouveau: expose the full object/event interfaces to userspace 2014-08-10 05:28:18 +10:00
nouveau_vga.c drm/nouveau: initial pass at moving to struct nvif_device 2014-08-10 05:13:13 +10:00
nouveau_vga.h drm/nouveau: port remainder of drm code, and rip out compat layer 2012-10-03 13:12:59 +10:00
nv04_fbcon.c drm/nouveau: remove as much direct use of core headers as possible 2014-08-10 05:13:16 +10:00
nv04_fence.c drm/nouveau: port to nvif client/device/objects 2014-08-10 05:13:14 +10:00
nv10_fence.c drm/nouveau: remove as much direct use of core headers as possible 2014-08-10 05:13:16 +10:00
nv10_fence.h drm/nouveau: remove as much direct use of core headers as possible 2014-08-10 05:13:16 +10:00
nv17_fence.c drm/nouveau/dma: audit and version NV_DMA classes 2014-08-10 05:13:24 +10:00
nv50_display.c drm/nouveau: use ram info from nvif_device 2014-08-10 05:28:12 +10:00
nv50_display.h drm/nouveau: rename nvd0_display to nv50_display to reflect reality since merge 2012-11-29 09:57:58 +10:00
nv50_fbcon.c drm/nouveau: remove (most) hardcoded object handle usage 2014-08-10 05:13:15 +10:00
nv50_fence.c drm/nouveau/dma: audit and version NV_DMA classes 2014-08-10 05:13:24 +10:00
nv84_fence.c drm/nouveau/fifo: audit and version fifo channel classes 2014-08-10 05:28:04 +10:00
nvc0_fbcon.c drm/nouveau: remove (most) hardcoded object handle usage 2014-08-10 05:13:15 +10:00
nvc0_fence.c drm/nouveau: remove as much direct use of core headers as possible 2014-08-10 05:13:16 +10:00