diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-03 22:24:10 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-03 22:24:10 +0000 |
commit | b11c8aa81cdeaf0823f628ce08ea936caa71d2a9 (patch) | |
tree | 592d3e855f7c8e1d29d6be2d894cd9032838f1da /sys/dev/pci | |
parent | b583bd3022a2d6aacea4f1a72583ff09f772d0d4 (diff) |
store root bridge data in softc before calling intel_init_stolen_res()
should fix panic on boot on x41 reported by Fred Crowson
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index 735908e4149..99c47441868 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -107,6 +107,10 @@ int i915_get_bridge_dev(struct drm_i915_private *dev_priv) { struct drm_device *dev = &dev_priv->drm; + /* may be already called from attach */ + if (dev_priv->bridge_dev != NULL) + return 0; + dev_priv->bridge_dev = malloc(sizeof(*dev_priv->bridge_dev), M_DEVBUF, M_WAITOK); dev_priv->bridge_dev->pc = dev->pdev->pc; @@ -2470,6 +2474,7 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) return; } dev->pdev->irq = -1; + i915_get_bridge_dev(dev_priv); intel_init_stolen_res(dev_priv); config_mountroot(self, inteldrm_attachhook); |