diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-11-11 02:21:10 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-11-11 02:21:10 +0000 |
commit | bad320476abd1fd15c0738168c771e11cb60bc52 (patch) | |
tree | 930e15f9442e244f54af3191fb478ac326b2052a /sys/dev | |
parent | b9da2a8dca1a70a039e217bc34305c8336adb5cd (diff) |
return early from drm activate functions after fatal error
avoids a page fault trap trying to take an uninitialised
modeset lock on suspend
reported and tested by Ali Farzanrad on HP ProBook 4530s
radeondrm0 at pci1 dev 0 function 0 "ATI Radeon HD 6400M" rev 0x00
drm1 at radeondrm0
radeondrm0: msi
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 3000" rev 0x09
drm0 at inteldrm0
inteldrm0: msi, SANDYBRIDGE, gen 6
..
radeondrm0: CAICOS
[drm] *ERROR* Unable to locate a BIOS ROM
drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init
inteldrm0: 1366x768, 32bpp
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_kms.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c index 66e36cde096..27666951fed 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c @@ -2283,7 +2283,7 @@ amdgpu_activate(struct device *self, int act) struct drm_device *dev = &adev->ddev; int rv = 0; - if (dev->dev == NULL) + if (dev->dev == NULL || amdgpu_fatal_error) return (0); switch (act) { diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index ad36e5aaf52..5f1ba56413b 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -2605,7 +2605,7 @@ inteldrm_activate(struct device *self, int act) struct drm_device *dev = &dev_priv->drm; int rv = 0; - if (dev->dev == NULL) + if (dev->dev == NULL || inteldrm_fatal_error) return (0); /* diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index 75702aafd11..10dca3c6acf 100644 --- a/sys/dev/pci/drm/radeon/radeon_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_kms.c @@ -874,7 +874,7 @@ radeondrm_activate_kms(struct device *self, int act) struct radeon_device *rdev = (struct radeon_device *)self; int rv = 0; - if (rdev->ddev == NULL) + if (rdev->ddev == NULL || radeon_fatal_error) return (0); switch (act) { |