public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [Proposal][PATCH] Fixed the irq interrupt line after a resume from
@ 2009-03-18  8:35 Francesco VIRLINZI
  0 siblings, 0 replies; only message in thread
From: Francesco VIRLINZI @ 2009-03-18  8:35 UTC (permalink / raw)
  To: linux-sh

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

Hi all

Ad I said in a previous email the current hibernation suppont has a 
problem with
 every interrupt line enabled in the previous session by modules.

This kind of irq line after a resume will remain not initialized in the 
interrupt controller.

The attached patch is a hack to close the issue ( and it works).
I know it isn't a wonderful solution and it has to be taken as a 
momentary solution.
The right thing should be add sysdev device to the intc but it requires 
more work in the intc design.

Let me know.
Regards
 Francesco

[-- Attachment #2: 0002-sh_irq-Added-setup-irq-line-support-on-hibernation.patch --]
[-- Type: text/x-patch, Size: 1806 bytes --]

From 8dd0655b55843957a06f6d2297e07322570b647d Mon Sep 17 00:00:00 2001
From: Francesco Virlinzi <francesco.virlinzi@st.com>
Date: Wed, 18 Mar 2009 09:25:37 +0100
Subject: [PATCH] sh_irq: Added setup irq line support on hibernation

This patch fixes the irq line status after a resume from
hibernation. This is required for all the irq line required
from every module loaded during the runtime of previous session and
not initialized during the system boots.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
---
 arch/sh/kernel/swsusp.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/sh/kernel/swsusp.c b/arch/sh/kernel/swsusp.c
index 12b64a0..3f383a2 100644
--- a/arch/sh/kernel/swsusp.c
+++ b/arch/sh/kernel/swsusp.c
@@ -11,6 +11,8 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/suspend.h>
+#include <linux/irqflags.h>
+#include <linux/irq.h>
 #include <asm/suspend.h>
 #include <asm/sections.h>
 #include <asm/tlbflush.h>
@@ -34,5 +36,28 @@ void save_processor_state(void)
 
 void restore_processor_state(void)
 {
+	int i;
+	unsigned long flags;
+	struct irq_desc *desc;
+	void (*irq_func)(unsigned int irq);
+
+	/* now restore the hw irq setting */
+	local_irq_save(flags);
+	for (i = 0; i < NR_IRQS; ++i) {
+		desc = &irq_desc[i];
+		if (desc->chip != &no_irq_chip && desc->action) {
+			irq_func = (desc->status & IRQ_DISABLED) ?
+				desc->chip->disable : desc->chip->enable;
+			spin_lock(&desc->lock);
+			desc->chip->startup(i);
+			irq_func(i);
+			if (desc->chip->set_wake)
+				desc->chip->set_wake(i,
+					((desc->status & IRQ_WAKEUP) ? 1 : 0));
+			spin_unlock(&desc->lock);
+		}       /* if.. */
+	}               /* for... */
+	local_irq_restore(flags);
+
 	local_flush_tlb_all();
 }
-- 
1.5.6.6


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-18  8:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-18  8:35 [Proposal][PATCH] Fixed the irq interrupt line after a resume from Francesco VIRLINZI

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