On Tue, 2003-02-04 at 10:04, Stefan Farfeleder wrote:
> Hi
> 
> The drm code uses 'struct mtx' as DRM_SPINTYPE on FreeBSD 5.x.  The
> kernel expects such mutices to be freed after use by calling
> mtx_destroy(), which the current code fails to do.  Quitting X and
> restarting it thus results in this kernel panic
...
> The attached patch does these things:
> 
> - Create a new macro DRM_SPINDESTROY which releases the lock on FreeBSD
>   5.x by calling mtx_destroy(), on 4.x and NetBSD it does nothing.  I
>   also removed the trailing ';' from the DRM_SPINUNLOCK macro.
> 
> - Move the lock creation for getmagic() into the attach routing and make
>   the mutex a member of drm_device (otherwise, the static lock could not
>   be released).  The vbl_lock which caused my panic is also created in
>   attach().
> 
> - Create mem_cleanup() as counterpart to mem_init().  Mem_clean() just
>   releases DRM(mem_lock).
>   
> - Add code to release all locks in the detach function.  The waitlist
>   mutex is released in waitlist_destroy().
> 
> - Fix an occurence of p->p_pid, which doesn't compile on FreeBSD 5.x
>   because p is a struct thread, not a struct proc.

This was already done in bsd-4-0-0-branch, which I'm hoping to merge to
trunk soon.  Sorry for the duplication of work.

-- 
Eric Anholt                                [EMAIL PROTECTED]          
http://people.freebsd.org/~anholt/         [EMAIL PROTECTED]



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to