Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Apr 2009 21:24:41 +0200
From:      cpghost <cpghost@cordula.ws>
To:        Robert Noland <rnoland@FreeBSD.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: page fault in sis.ko / drm.ko
Message-ID:  <20090418192441.GB4441@phenom.cordula.ws>
In-Reply-To: <1240081119.3525.5.camel@balrog.2hip.net>
References:  <20090418171306.GA1983@phenom.cordula.ws> <1240081119.3525.5.camel@balrog.2hip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090418192441.GB4441>