From: jsg Date: Thu, 3 Feb 2022 22:24:09 +0000 (+0000) Subject: store root bridge data in softc before calling intel_init_stolen_res() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4f8f9e3419951bae8a0caec818d75e8173121f4b;p=openbsd store root bridge data in softc before calling intel_init_stolen_res() should fix panic on boot on x41 reported by Fred Crowson --- 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);