Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 114362 - NVRM: ACPI: unsupported event: 2 on nvidia-kernel with 2.6.14 and 15
Summary: NVRM: ACPI: unsupported event: 2 on nvidia-kernel with 2.6.14 and 15
Status: RESOLVED DUPLICATE of bug 114640
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: X11 External Driver Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-03 09:26 UTC by Daniele Gaffuri
Modified: 2006-01-11 13:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
nv.c patch for suspend to RAM on 2.6.15 (nv.patch,1.51 KB, patch)
2005-12-03 10:09 UTC, Daniele Gaffuri
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele Gaffuri 2005-12-03 09:26:19 UTC
Trying to suspend to mem with X started and the nvidia module loaded I got this
error.

NVRM: ACPI: unsupported event: 2
Could not suspend device 0000:01:00.0: error -1
Some devices failed to suspend

Googling around I found this bug report to Debian

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=339329

which points out that the kernel defines for pm events changed from 2.6.14. This
is the git changelog for the patch.

diff-tree ca078bae813dd46c0f9b102fdfb4a3384641ff48 (from
829ca9a30a2ddb727981d80fabdbff2ea8
Author: Pavel Machek <pavel@ucw.cz>
Date:   Sat Sep 3 15:56:57 2005 -0700

    [PATCH] swsusp: switch pm_message_t to struct

    This adds type-checking to pm_message_t, so that people can't confuse it
    with int or u32.  It also allows us to fix "disk yoyo" during suspend (disk
    spinning down/up/down).

    [We've tried that before; since that cpufreq problems were fixed and I've
    tried make allyes config and fixed resulting damage.]

    Signed-off-by: Pavel Machek <pavel@suse.cz>
    Signed-off-by: Alexander Nyberg <alexn@telia.com>
    Signed-off-by: Andrew Morton <akpm@osdl.org>
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>

This is the relevant part of the patch

--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -186,7 +186,9 @@ extern int pm_suspend(suspend_state_t st

 struct device;

-typedef u32 __bitwise pm_message_t;
+typedef struct pm_message {
+       int event;
+} pm_message_t;

 /*
  * There are 4 important states driver can be in:
@@ -207,9 +209,13 @@ typedef u32 __bitwise pm_message_t;
  * or something similar soon.
  */

-#define PMSG_FREEZE    ((__force pm_message_t) 3)
-#define PMSG_SUSPEND   ((__force pm_message_t) 3)
-#define PMSG_ON                ((__force pm_message_t) 0)
+#define PM_EVENT_ON 0
+#define PM_EVENT_FREEZE 1
+#define PM_EVENT_SUSPEND 2
+
+#define PMSG_FREEZE    ((struct pm_message){ .event = PM_EVENT_FREEZE, })
+#define PMSG_SUSPEND   ((struct pm_message){ .event = PM_EVENT_SUSPEND, })
+#define PMSG_ON                ((struct pm_message){ .event = PM_EVENT_ON, })

 struct dev_pm_info {
        pm_message_t            power_state;

As a result suspend to RAM doesn't work anymore. This is the compilation warning
showing the the .suspend function is not compatible with new kernels.

/var/tmp/portage/nvidia-kernel-1.0.7676-r1/work/NVIDIA-Linux-x86-1.0-7676-pkg0/usr/src/nv/nv.c:265:
warning: initialization from incompatible pointer type.

Besides this (it would still work because the new struct contains only an int
instead of the old u32) nv.c check for the old constants PM_SUSPEND_* instead of
the new PM_EVENT_* ones, giving the error above for PM_EVENT_SUSPEND.

If no patch for nv.c is already available (I searched by I found no bugs) I
will'try to build one (that posted in the Debian bug will not work if the struct
changes again).
Comment 1 Daniele Gaffuri 2005-12-03 10:09:59 UTC
Created attachment 73991 [details, diff]
nv.c patch for suspend to RAM on 2.6.15

This patch seem to work on vanilla 2.6.15-rc4
Comment 2 Daniele Gaffuri 2005-12-07 16:59:36 UTC
Seems that it has been solved in media-video/nvidia-kernel-1.0.8174-r1 (see bug
#114640)
Comment 3 Kris Kersey (RETIRED) gentoo-dev 2006-01-11 13:43:41 UTC

*** This bug has been marked as a duplicate of 114640 ***