Keith Whitwell wrote:
Linus Torvalds wrote:

On Sun, 2 Mar 2003, Linus Torvalds wrote:

The _second_ DRI-enabled X startup caused problems, even if I had done
multiple non-DRI X sessions in between. This is what makes me think that
the DRI kernel modules keep some history around that they shouldn't. And
maybe the problem is hidden if you actually unload and re-load the
modules (is that what most people do?)



Ok, I went in and looked for suspicious behaviour, and I found some.


Look at AGP and MTRR behaviour: both of them are initialized by drm_init() at module load time.

Both of them are _de-initialized_ by the "DRM(takedown)()" code, and never
re-initialized by the "DRM(setup)()" code.


So an example of badness would be:

- load DRM modules (in my case as part of kernel bootup, since they are compiled in):

- initialize MTRR and AGP mappings

- run X with DRI.

- Everything is happy.

- exit DRI X

- we are the "last close" case for DRI, so DRM(release)() calls DRM(takedown)(), which frees AGP and MTRR

- restart non-DRI X

- nothing happens

- kill non-DRI X

- nothing happens

- run X with DRI again

    - oops. We now have neither AGP nor MTRR's set up, even though
      the code looks like it is assuming it.

Yeah, maybe I'm missing where somebody else re-initializes AGP and MTRR, but my point is that these things do not seem to nest correctly. That mtrr_del() in particular seems to be wrong, and I do indeed get a

mtrr: MTRR 2 not used

when shutting down X normally.

Comments? I haven't really gone through the whole path of what happens at open()/release() time, and these are really nothing more than "that looks suspicious", maybe somebody who knows the code better than I can take a better look at it.


Yes it looks suspicious, but I don't think it's the cause of the lockups on X recycle.

Evidence for this:
- The lockup is new, while the code has been suspicious forever...
- I can exit and restart X just fine, it's only recycle that locks. From the kernel point of view, these should be the same.
- In the Mesa embedded branch, I have a demo that closes & reopens its connections to the kernel without exiting. Again this works fine.


I've also verified that this lockup wasn't introduced in the filp work, ie. it had already sneaked into the trunk somehow.

OK, I've had some time to track this down. It comes down to the changes introduced to radeon_driver.c around 29 Oct last year.



---------------------------- revision 1.45 date: 2002/10/29 13:49:25; author: mdaenzer; state: Exp; lines: +30 -19 * preserve CRTC{,2}_OFFSET_CNTL in 2D driver to avoid bad effects when pageflipping after a mode switch * take current page into account in AdjustFrame(); writing the CRTC offset via the CP was probably a bad idea as this can happen asynchronously, reverted * take frame offset into account when flipping pages * handle CRTC2 as well for pageflipping (untested) * preserve GEN_INT_CNTL on mode switches to prevent interrupts from getting disabled ----------------------------

Michel, have you got time to look into why this is causing server recycles to hang? I can't reproduce it on all machines, so it's possible that your test box is one of the ones unaffected by this lockup -- if you can't reproduce, let me know...

I'll poke around in the meantime & try & figure it out.

Keith



-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to