Current CVS hits an oops when the X-server is started, stoped, and restarted. This was originally reported to the DRI mailing list by Chris Rankin. I looked into it a bit, and it appears that when the X-server exits, dev->dev_private becomes NULL. When the X-server restarts and calls mga_dma_init, it oopses when mga_do_dma_init dereferences dev->dev_private.
Created attachment 2817 [details] [review] Move deallocation of dev_private This moves the deallocation of dev_private. Since dev_private is allocated when the driver is loaded and is always expected to be around, it should only be deallocated when the driver is unloaded.
The patch was commited to DRI CVS today.
This patch solves the oops for me, but generates the following messages when I unload the module: __iounmap: bad address dab30000 __iounmap: bad address dac00000 [drm] Module unloaded
Created attachment 2835 [details] [review] Completely re-initialize DMA settings There were two problems. First, the 'warp' and 'primary' pointers weren't cleared, so mga_do_cleanup_dma, which gets called multiple times, would try to ioremapfree them multiple times. This resulted in the new error messages to syslog. The second problem was the, since the dev_private structure isn't reallocated and cleaned out in mga_do_init_dma, when the server is reloaded idle-waits would wait for impossible values. I have given this patch some more riggorous testing. This includes: - Load module, start server, run GL app, stop server, unload module. - Load module, start server, run GL app, stop server, unload module, reload module, restart server, run GL app. - Load module, start server, run GL app, stop server, restart server, run GL app, stop server, unload module. In all three cases, everything worked as expected. Please let me know if there are any further regressions with this patch.
Patch #2835 committed to DRM CVS on 9-June-2005.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.