Bug 31637

Summary: NV30, PFIFO_CACHE_ERROR when stopping kdm
Product: xorg Reporter: Patrice Mandin <patmandin>
Component: Driver/nouveauAssignee: Nouveau Project <nouveau>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Logged kernel messages when stopping kdm
none
nouveau_grobj_sync.patch
none
Kernel log with patch and more debug message
none
nvfx_screen_destroy_flush.patch
none
libdrm_gpuobj_flush.patch none

Description Patrice Mandin 2010-11-15 12:19:54 UTC
Created attachment 40285 [details]
Logged kernel messages when stopping kdm

I have this problem since a long time, but did not bother making a bug report as it does not hang the machine; and a recent message on nouveau mailing list reminding me of it. Here is what happens:

vt1 -> text console
vt7 -> kdm or logged kde session running

If I run /etc/init.d/kdm stop from the text console, I got the PFIFO_CACHE_ERROR, if I do it from an X terminal in the kde session, no errors happens.

Restarting the server from kdm login screen also does not produce errors.

Using gdm does not trigger the error in any case, so it's something specific to kdm (from my pov). Also the fact I stop kdm from a different virtual console may be important.
Comment 1 Patrice Mandin 2010-11-18 12:26:26 UTC
Just noticed that in my log: the first error happens on channel with object 0x8a (NVXX_IMAGE_FROM_CPU), the following errors happen on a different channel with object 0x39 (NVXX_MEMORY_TO_MEMORY_FORMAT) however the called methods match the first object.
Comment 2 Patrice Mandin 2010-11-18 13:46:38 UTC
I just compared timing info (from both kernel and X log files), and the error happens after nouveau_channel_free() has been called, from NVTakedownDma() in the DDX.

So it appears something is not totally cleaned up, and the fifo is still executing commands.
Comment 3 Francisco Jerez 2010-11-18 14:11:38 UTC
Created attachment 40400 [details] [review]
nouveau_grobj_sync.patch

This patch might help.
Comment 4 Patrice Mandin 2010-11-18 23:41:25 UTC
Created attachment 40403 [details]
Kernel log with patch and more debug message

Your patch does not change anything. I also added some debug messages in nouveau_channel_idle() at start and end of the function, and the error appears in the middle of it.
Comment 5 Francisco Jerez 2010-11-19 09:44:29 UTC
Created attachment 40409 [details] [review]
nvfx_screen_destroy_flush.patch

(In reply to comment #4)
> Created an attachment (id=40403) [details]
> Kernel log with patch and more debug message
> 
> Your patch does not change anything. I also added some debug messages in
> nouveau_channel_idle() at start and end of the function, and the error appears
> in the middle of it.

Right, you'll need this mesa patch in addition to the other one.
Comment 6 Patrice Mandin 2010-11-19 11:13:32 UTC
This mesa patch does not change anything (obviously, because I have nothing running that may be using mesa, and system-wide the software renderer is used).

However, when running glxgears with nouveau mesa backend, sometimes the error does not trigger (with or without the mesa patch).
Comment 7 Francisco Jerez 2010-11-20 05:41:32 UTC
Created attachment 40434 [details] [review]
libdrm_gpuobj_flush.patch

This libdrm patch along with "nouveau_grobj_sync.patch" should fix both your KDM issue and the gallium issue that was reported earlier.
Comment 8 Patrice Mandin 2010-11-20 12:01:45 UTC
With patched libdrm, no error triggers, and I even removed the patch to DDX to be sure :).

So kernel+libdrm patch seems ok to me.
Comment 9 Francisco Jerez 2010-11-21 18:54:43 UTC
(In reply to comment #8)
> With patched libdrm, no error triggers, and I even removed the patch to DDX to
> be sure :).
> 
> So kernel+libdrm patch seems ok to me.

This should be fixed in master now.

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.