Re: xorg 7.2 locks system in current

From: Michael Butler <imb_at_protected-networks.net>
Date: Fri, 06 Jul 2007 10:55:21 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kostik Belousov wrote:
> [Redirecting to x11_at_ as more appropriate]
>
> Man page states explicitely that bus_dma_tag_create() (as well as
> bus_dmamem_alloc()) shall not be called with non-sleepable lock held.
> I am not completely sure, but it seems to be safe to drop the drm
> lock around drm_pci_alloc() when the later moved to the start of the
> i915_initialize().
> 
> Could you, please, test the patch below ?

This appears to be equally applicable to 6-stable. I've had random
lock-ups with an i945GM and which, on initial and brief testing, appear
to be gone using this patch,

	Michael


> diff --git a/sys/dev/drm/i915_dma.c b/sys/dev/drm/i915_dma.c
> index 1d1877b..118d160 100644
> --- a/sys/dev/drm/i915_dma.c
> +++ b/sys/dev/drm/i915_dma.c
> _at__at_ -122,7 +122,22 _at__at_ static int i915_initialize(drm_device_t * dev,
>  			   drm_i915_private_t * dev_priv,
>  			   drm_i915_init_t * init)
>  {
> +	drm_dma_handle_t *dmah;
> +
> +	DRM_UNLOCK();
> +	dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 
> +	    0xffffffff);
> +	if (!dmah) {
> +		dev->dev_private = (void *)dev_priv;
> +		i915_dma_cleanup(dev);
> +		DRM_ERROR("Can not allocate hardware status page\n");
> +		DRM_LOCK();
> +		return DRM_ERR(ENOMEM);
> +	}
> +	DRM_LOCK();
> +
>  	memset(dev_priv, 0, sizeof(drm_i915_private_t));
> +	dev_priv->status_page_dmah = dmah;
>  
>  	DRM_GETSAREA();
>  	if (!dev_priv->sarea) {
> _at__at_ -181,15 +196,6 _at__at_ static int i915_initialize(drm_device_t * dev,
>  	dev_priv->allow_batchbuffer = 1;
>  
>  	/* Program Hardware Status Page */
> -	dev_priv->status_page_dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 
> -	    0xffffffff);
> -
> -	if (!dev_priv->status_page_dmah) {
> -		dev->dev_private = (void *)dev_priv;
> -		i915_dma_cleanup(dev);
> -		DRM_ERROR("Can not allocate hardware status page\n");
> -		return DRM_ERR(ENOMEM);
> -	}
>  	dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr;
>  	dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr;
>  	

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD4DBQFGjlfZQv9rrgRC1JIRAnKKAJjho4IxKKbkckbFHJWXkU0eXB48AJ9pcxI/
fCAdV0vMyddsC2WfFKN9Vg==
=5hrb
-----END PGP SIGNATURE-----
Received on Fri Jul 06 2007 - 12:55:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:13 UTC