Bug 141987

Summary: Suspend to disk is not working with NVidia due to AGPGART compiled into kernel
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Andras Mantia <amantia>
Component: KernelAssignee: Andreas Kleen <ak>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: aritger, eich, sndirsch
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Andras Mantia 2006-01-09 09:04:25 UTC
With the default kernel shipped with SuSE 10.0 it is not possible to make suspend to disk working with the binary nvidia module on AMD64 systems. Every try results on kernel crash or reboot when resuming. According to the http://susewiki.org/index.php?title=Suspend_NVidia_HOWTO#Feedback, it can me made to work if the kernel's amd64_agp module is not loaded, but unfortunately in SuSE this is loaded no matter what you try to do as the module is unconditionally compiled into the kernel if CONFIG_GART_IOMMU=y is specified.
The solution is to disable IOMMU and enable the AGPGART and AMD64_AGP modules as real modules, so the user can choose if he wants to load them or not.
This way all the AMD64 users with motherboards supported by the NVidia's AGP module will work with 3D, AGP and suspend to disk as well, and those who have unsupported chipsets will have at least 3D acceleration and suspend to disk, even if in PCI only mode.
Comment 1 Olaf Kirch 2006-01-09 20:03:57 UTC
Assigning to the X11 folks. I guess there's little we can do - we need
CONFIG_GART_IOMMU in our shipped kernels.
Comment 2 Andras Mantia 2006-01-09 21:27:54 UTC
I didn't know it is needed, I thought the modules can replace it. The problem with self compiled kernels is when a security update appears, this is why it would be nice to have it working by default.
Yes, I know that the real fix should be in the nvidia module, and I sent a mail to them as well, but I don't think they will do it soon (or ever?).
Comment 3 Egbert Eich 2006-01-10 12:23:53 UTC
The root of this particular problem might be that the kernel agp driver does not have suspend support. Maybe this is a feature that should be added.
(Adding Andi for comment).
Comment 5 Andreas Kleen 2006-01-10 12:29:23 UTC
AMD K8 suspend support went into mainline just a few days ago. Probably 
next release.
Comment 6 Andras Mantia 2006-01-10 14:53:43 UTC
Is it in some officially released kernel or only in the development tree? Just that I would test if it was officially released.
Comment 7 Stefan Dirsch 2006-01-27 13:48:39 UTC
Andy, could you close this one as FIXED once it's done for an official SUSE kernel? Thanks.
Comment 8 Andreas Kleen 2006-01-27 14:05:36 UTC
Hmm, it's actually not in -rc1. Maybe we need to add the patch ourselves.
Comment 9 Andreas Kleen 2006-01-30 07:22:05 UTC
According to the maintainer it's going to be merged soon, just waiting
for Linus to come back from New Zealand.
Comment 10 Andreas Kleen 2006-02-03 11:17:28 UTC
Should be fixed in kotd now (= for beta4)
Comment 11 Andras Mantia 2006-04-12 07:09:40 UTC
Just for the record:it was not fixed out of the box even in beta9. But the new NVidia driver came out, and that one works with beta9. So you need at least the 8756 binary driver with NVAGP enabled.
Comment 12 Andras Mantia 2006-04-12 15:18:52 UTC
Aargh, it worked that way, but I realized that AGP is disabled due to the same reasons as I wrote in the original report. I switched to use the system AGPGART, but this was suspend2disk does not work. I played with removing IOMMU from the kernel and using NvAGP=1, and it did not worked. Now it doesn't even work with IOMMU in the kernel and a disabled AGP.
Certainly, the bug doesn't seem to be fixed in the recent kernel.
Comment 13 Andras Mantia 2006-04-12 18:33:06 UTC
So, until now I found:
- NvAGP="1": suspend 2 disk works, AGP becomes disabled as AGPGART is already loaded
- NvAGP="2": suspend 2 disk does not work (after resume, the monitor is switched off, if I suspend in text mode, it resumes, but the monitor is switched off as soon as I switch to the graphical session), AGP works via AGPGART. After resume, AGP becomes disabled


Tomorrow I will try NVAGP="1" without IOMMU compiled in the kernel, maybe what I describe below will help in that case as well.

Note: Resume fails if I don't specify SUSPEND2DISK_RESUME_DEVICE="/dev/hda6"
in /etc/sysconfig/powersave/sleep, even if resume=/dev/hda6 is passed to the kernel. The kernel prints "Attempting manual resume" and boots without resuming and tries to fix the file system. After a while it hangs. 
Comment 14 Forgotten User ZhJd0F0L3x 2006-04-12 19:08:00 UTC
(In reply to comment #13)
> Note: Resume fails if I don't specify SUSPEND2DISK_RESUME_DEVICE="/dev/hda6"
> in /etc/sysconfig/powersave/sleep, even if resume=/dev/hda6 is passed to the
> kernel. The kernel prints "Attempting manual resume" and boots without resuming
> and tries to fix the file system. After a while it hangs. 

This is strange, but another bug, so please file a separate bug against 10.1beta9, component "Mobile devices".