Skip to contentSkip to conversation

call device_shutdown with interrupts enabled

PATCH In review Pavel Machek 3 participants 3 messages Jul 3, 2005 – Jul 4, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 call device_shutdown with interrupts enabled

Do not call device_shutdown with interrupts disabled. It is wrong and produces ugly warnings.

---
commit 325107c7d4a5a28dee6eecce1ee8fa01753414c7 tree ea824a39656ae9da70f6738e9452b1ac7b561ab3 parent b61ea835309d0fb87cf1c7a2d83d5832ae8eb116 author <pavel@amd.(none)> Sun, 03 Jul 2005 23:48:35 +0200 committer <pavel@amd.(none)> Sun, 03 Jul 2005 23:48:35 +0200

 kernel/power/disk.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
kernel/power/disk.c +4 -2
@@ -50,19 +50,21 @@ static void power_down(suspend_disk_meth
 	unsigned long flags;
 	int error = 0;
 
-	local_irq_save(flags);
 	switch(mode) {
 	case PM_DISK_PLATFORM:
- 		device_shutdown();
+		device_shutdown();
+		local_irq_save(flags);
 		error = pm_ops->enter(PM_SUSPEND_DISK);
 		break;
 	case PM_DISK_SHUTDOWN:
 		printk("Powering off system\n");
 		device_shutdown();
+		local_irq_save(flags);
 		machine_power_off();
 		break;
 	case PM_DISK_REBOOT:
 		device_shutdown();
+		local_irq_save(flags);
 		machine_restart(NULL);
 		break;
 	}
Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
#1 lore raw
Quoted 2 lines · Pavel Machek

Do not call device_shutdown with interrupts disabled. It is wrong and produces ugly warnings.

Hm. How about (possible whitespace damage):

kernel/power/disk.c renamed from kernel/power/disk.c~ +1 -3
@@ -53,19 +53,17 @@ static void power_down(suspend_disk_meth
 	unsigned long flags;
 	int error = 0;
 
+	device_shutdown();
 	local_irq_save(flags);
 	switch(mode) {
 	case PM_DISK_PLATFORM:
- 		device_shutdown();
 		error = pm_ops->enter(PM_SUSPEND_DISK);
 		break;
 	case PM_DISK_SHUTDOWN:
 		printk("Powering off system\n");
-		device_shutdown();
 		machine_power_off();
 		break;
 	case PM_DISK_REBOOT:
-		device_shutdown();
 		machine_restart(NULL);
 		break;
 	}
Signature · 3 lines
Stefan Seyfried                  \ "I didn't want to write for pay. I
QA / R&D Team Mobile Devices      \ wanted to be paid for what I write."
SUSE LINUX Products GmbH, Nürnberg \                    -- Leonard Cohen
#2 lore raw

Hi!

Quoted 4 lines
Quoted 2 lines

Do not call device_shutdown with interrupts disabled. It is wrong and produces ugly warnings.

Hm. How about (possible whitespace damage):

Hmm, right, that's better patch. Applied (will push upstream with next batch).
Pavel

Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.