public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] x86: apic, restore irqs on fail paths
@ 2009-05-28  7:54 Jiri Slaby
  2009-05-28  7:54 ` [PATCH 2/3] x86: amd_iommu, fix lock imbalance Jiri Slaby
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jiri Slaby @ 2009-05-28  7:54 UTC (permalink / raw)
  To: mingo
  Cc: x86, linux-kernel, Jiri Slaby, Ingo Molnar, Thomas Gleixner,
	H. Peter Anvin

lapic_resume forgets to restore interrupts on fail paths.
Fix that.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: H. Peter Anvin <hpa@zytor.com>
---
 arch/x86/kernel/apic/apic.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 07cffc1..fc65544 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2029,7 +2029,7 @@ static int lapic_resume(struct sys_device *dev)
 	unsigned int l, h;
 	unsigned long flags;
 	int maxlvt;
-	int ret;
+	int ret = 0;
 	struct IO_APIC_route_entry **ioapic_entries = NULL;
 
 	if (!apic_pm_state.active)
@@ -2040,14 +2040,15 @@ static int lapic_resume(struct sys_device *dev)
 		ioapic_entries = alloc_ioapic_entries();
 		if (!ioapic_entries) {
 			WARN(1, "Alloc ioapic_entries in lapic resume failed.");
-			return -ENOMEM;
+			ret = -ENOMEM;
+			goto restore;
 		}
 
 		ret = save_IO_APIC_setup(ioapic_entries);
 		if (ret) {
 			WARN(1, "Saving IO-APIC state failed: %d\n", ret);
 			free_ioapic_entries(ioapic_entries);
-			return ret;
+			goto restore;
 		}
 
 		mask_IO_APIC_setup(ioapic_entries);
@@ -2099,10 +2100,10 @@ static int lapic_resume(struct sys_device *dev)
 		restore_IO_APIC_setup(ioapic_entries);
 		free_ioapic_entries(ioapic_entries);
 	}
-
+restore:
 	local_irq_restore(flags);
 
-	return 0;
+	return ret;
 }
 
 /*
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-06-03  8:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-28  7:54 [PATCH 1/3] x86: apic, restore irqs on fail paths Jiri Slaby
2009-05-28  7:54 ` [PATCH 2/3] x86: amd_iommu, fix lock imbalance Jiri Slaby
2009-06-03  8:36   ` Joerg Roedel
2009-05-28  7:54 ` [PATCH 3/3] trace: events_filter, fix lock imbalances Jiri Slaby
2009-05-29  1:14   ` Li Zefan
2009-05-29 15:57     ` Jiri Slaby
2009-05-29 17:21 ` [PATCH 1/3] x86: apic, restore irqs on fail paths Cyrill Gorcunov
2009-06-02  0:51 ` [tip:irq/numa] x86, apic: Restore " tip-bot for Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox