Date: Wed, 22 Apr 2009 20:58:23 +0000 (UTC) From: Robert Noland <rnoland@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r191404 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm Message-ID: <200904222058.n3MKwNBE067459@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rnoland Date: Wed Apr 22 20:58:23 2009 New Revision: 191404 URL: http://svn.freebsd.org/changeset/base/191404 Log: Merge 191274. Don't try to setup interrupts for drivers that don't support them. This causes sis and probably a couple of other driver to panic and fail. Tested by: cpghost <cpghost@cordula.ws> Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/drm_drv.c Modified: stable/7/sys/dev/drm/drm_drv.c ============================================================================== --- stable/7/sys/dev/drm/drm_drv.c Wed Apr 22 20:49:54 2009 (r191403) +++ stable/7/sys/dev/drm/drm_drv.c Wed Apr 22 20:58:23 2009 (r191404) @@ -134,7 +134,7 @@ static struct cdevsw drm_cdevsw = { .d_flags = D_TRACKCLOSE }; -int drm_msi = 1; /* Enable by default. */ +static int drm_msi = 1; /* Enable by default. */ TUNABLE_INT("hw.drm.msi", &drm_msi); static struct drm_msi_blacklist_entry drm_msi_blacklist[] = { @@ -228,28 +228,31 @@ int drm_attach(device_t kdev, drm_pci_id dev->pci_vendor = pci_get_vendor(dev->device); dev->pci_device = pci_get_device(dev->device); - if (drm_msi && - !drm_msi_is_blacklisted(dev->pci_vendor, dev->pci_device)) { - msicount = pci_msi_count(dev->device); - DRM_DEBUG("MSI count = %d\n", msicount); - if (msicount > 1) - msicount = 1; + if (drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) { + if (drm_msi && + !drm_msi_is_blacklisted(dev->pci_vendor, dev->pci_device)) { + msicount = pci_msi_count(dev->device); + DRM_DEBUG("MSI count = %d\n", msicount); + if (msicount > 1) + msicount = 1; + + if (pci_alloc_msi(dev->device, &msicount) == 0) { + DRM_INFO("MSI enabled %d message(s)\n", + msicount); + dev->msi_enabled = 1; + dev->irqrid = 1; + } + } - if (pci_alloc_msi(dev->device, &msicount) == 0) { - DRM_INFO("MSI enabled %d message(s)\n", msicount); - dev->msi_enabled = 1; - dev->irqrid = 1; + dev->irqr = bus_alloc_resource_any(dev->device, SYS_RES_IRQ, + &dev->irqrid, RF_SHAREABLE); + if (!dev->irqr) { + return ENOENT; } - } - dev->irqr = bus_alloc_resource_any(dev->device, SYS_RES_IRQ, - &dev->irqrid, RF_SHAREABLE); - if (!dev->irqr) { - return ENOENT; + dev->irq = (int) rman_get_start(dev->irqr); } - dev->irq = (int) rman_get_start(dev->irqr); - mtx_init(&dev->dev_lock, "drmdev", NULL, MTX_DEF); mtx_init(&dev->irq_lock, "drmirq", NULL, MTX_DEF); mtx_init(&dev->vbl_lock, "drmvbl", NULL, MTX_DEF);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904222058.n3MKwNBE067459>