From: Francesco VIRLINZI <francesco.virlinzi@st.com>
To: linux-sh@vger.kernel.org
Subject: [Proposal][PATCH] Fixed the irq interrupt line after a resume from
Date: Wed, 18 Mar 2009 08:35:58 +0000 [thread overview]
Message-ID: <49C0B26E.7040201@st.com> (raw)
[-- 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
reply other threads:[~2009-03-18 8:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49C0B26E.7040201@st.com \
--to=francesco.virlinzi@st.com \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.