[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090529172138.GC5176@lenovo>
Date: Fri, 29 May 2009 21:21:38 +0400
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Jiri Slaby <jirislaby@...il.com>
Cc: mingo@...e.hu, x86@...nel.org, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH 1/3] x86: apic, restore irqs on fail paths
[Jiri Slaby - Thu, May 28, 2009 at 09:54:47AM +0200]
|
| lapic_resume forgets to restore interrupts on fail paths.
| Fix that.
Good catch, Jiri!
Acked-by: Cyrill Gorcunov <gorcunov@...nvz.org>
Though I really doubt if the system will be functional after such a fail :)
But it's definitely better then having it irq-locked.
Yinghai CC'ed just to be sure.
|
| Signed-off-by: Jiri Slaby <jirislaby@...il.com>
| Cc: Ingo Molnar <mingo@...hat.com>
| Cc: Thomas Gleixner <tglx@...utronix.de>
| Cc: H. Peter Anvin <hpa@...or.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
|
|
-- Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists