page fault in sis.ko / drm.ko

cpghost cpghost at cordula.ws
Sat Apr 18 19:43:22 UTC 2009


On Sat, Apr 18, 2009 at 01:58:39PM -0500, Robert Noland wrote:
> On Sat, 2009-04-18 at 19:13 +0200, cpghost wrote:
> > Could a drm guru please have a look at kern/133554?
> > 
> > Thanks,
> > -cpghost.
> 
> Give this patch a try, it looks like the sis driver doesn't have irq's.

Ah, thank you. I'll try this tomorrow as soon as I'm in front of
this box again, and will report back.

Kind regards,
-cpghost.

> robert.
> 
> -- 
> Robert Noland <rnoland at FreeBSD.org>
> FreeBSD

> Index: dev/drm/drm_drv.c
> ===================================================================
> --- dev/drm/drm_drv.c	(revision 190987)
> +++ dev/drm/drm_drv.c	(working copy)
> @@ -134,7 +134,7 @@
>  	.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 @@
>  	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);

-- 
Cordula's Web. http://www.cordula.ws/


More information about the freebsd-stable mailing list