Hi,

during debugging I've probably found some bugs related to save/restore-pci. 
Most likely they are just typos, but it looks like that they may result wrong 
(or no) function calls.

Starting with hal, the correct command line parameter for saving the pci config 
seems to be:
"--quirk-save-pci".

Problem 1:
However, in pm/sleep.d/98smart-kernel-video in the function 
"remove_all_video_quirks()" a parameter named "--quirk-pci-save" is referenced 
for deletion. I assume this should be "--quirk-save-pci".

Problem 2:
The file pm/sleep.d/99video also assumes the wrong quirk command line parameter 
("--quirk-pci-save"). Additionally, in this file is also an internal 
inconsistency:
If the pci quirk should be applied, the function "pci_save" should be called:

"quirk "${QUIRK_PCI_SAVE}" &&            pci_save"
but the correct name of this function as defined in the same file is
"save_pci()"

The same applies then for "restore_pci".

Please find attached a patch which corrects all of these problems. Please note, 
that these issues did not cause any real trouble for me so far, but using the 
wrong command line parameters and function names seems to be really wrong and 
may lead to problems later with respect to bug fixing etc.

It would be great if anybody could look at my patch and consider applying it. 
;-) Thanks!


Best regards,
Christian






>From c2511c992aa6b07faab8e455f5b6c6c6769ec4d7 Mon Sep 17 00:00:00 2001
From: Christian Krause <c...@plauener.de>
Date: Wed, 18 Nov 2009 23:14:33 +0100
Subject: [PATCH] fix handling of command line parameters and function calls

- fix wrong function calls to pci_restore and pci_save which did
not match the actual defined functions (restore_pci and save_pci)
- use the correct quirk parameter in "remove_paramters"
(use --quirk-save-pci instead of --quirk-pci-save)
---
 pm/sleep.d/98smart-kernel-video |    2 +-
 pm/sleep.d/99video              |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pm/sleep.d/98smart-kernel-video b/pm/sleep.d/98smart-kernel-video
index 11b5490..deba3a7 100755
--- a/pm/sleep.d/98smart-kernel-video
+++ b/pm/sleep.d/98smart-kernel-video
@@ -23,7 +23,7 @@ remove_all_video_quirks()
 	--quirk-reset-brightness \
 	--quirk-radeon-off \
 	--quirk-no-fb \
-	--quirk-pci-save
+	--quirk-save-pci
 }
 
 # Test to see if the kernel has a video driver that is smart enough to
diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
index 29f2f2c..f2768ab 100755
--- a/pm/sleep.d/99video
+++ b/pm/sleep.d/99video
@@ -27,7 +27,7 @@ for opt in $PM_CMDLINE; do
 		vbestate-restore)  QUIRK_VBESTATE_RESTORE="true" ;;
 		vga-mode3) 	   QUIRK_VGA_MODE_3="true" ;;
 		no-fb) 		   QUIRK_NOFB="true" ;;
-		pci-save) 	   QUIRK_PCI_SAVE="true" ;;
+		save-pci) 	   QUIRK_SAVE_PCI="true" ;;
 	        no-chvt)           QUIRK_NO_CHVT="true" ;;
 		none) 		   QUIRK_NONE="true" ;;
 		*) continue ;;
@@ -165,7 +165,7 @@ suspend_video()
 	quirk "${QUIRK_VBESTATE_RESTORE}" && 	vbe_savestate
 	quirk "${QUIRK_VBEMODE_RESTORE}" && 	vbe_savemode
 	quirk "${QUIRK_RADEON_OFF}" && 		radeon_off
-	quirk "${QUIRK_PCI_SAVE}" && 		pci_save
+	quirk "${QUIRK_SAVE_PCI}" && 		save_pci
 	quirk "${QUIRK_VGA_MODE_3}" && 		vbe vbemode set 3
 	quirk "${QUIRK_DPMS_SUSPEND}" && 	vbe dpms suspend
 	save_fbcon
@@ -173,7 +173,7 @@ suspend_video()
 resume_video()
 {
 	# We might need to do one or many of these quirks
-	quirk "${QUIRK_PCI_SAVE}" && 		pci_restore
+	quirk "${QUIRK_SAVE_PCI}" && 		restore_pci
 	quirk "${QUIRK_VBE_POST}" && 		vbe_post
 	quirk "${QUIRK_VBESTATE_RESTORE}" && 	vbe_restorestate
 	quirk "${QUIRK_VBEMODE_RESTORE}" && 	vbe_restoremode
-- 
1.6.2.5


_______________________________________________
Pm-utils mailing list
Pm-utils@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to