From patchwork Wed Mar 18 08:35:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco VIRLINZI X-Patchwork-Id: 12777 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2I8ZQWo022357 for ; Wed, 18 Mar 2009 08:36:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752593AbZCRIgc (ORCPT ); Wed, 18 Mar 2009 04:36:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752680AbZCRIgb (ORCPT ); Wed, 18 Mar 2009 04:36:31 -0400 Received: from eu1sys200aog115.obsmtp.com ([207.126.144.139]:53526 "EHLO eu1sys200aog115.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752593AbZCRIga (ORCPT ); Wed, 18 Mar 2009 04:36:30 -0400 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKScCyi8H8ebRKW8wLOCm/7l4mtAQKZyYK@postini.com; Wed, 18 Mar 2009 08:36:29 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6C882DA89 for ; Wed, 18 Mar 2009 08:35:25 +0000 (GMT) Received: from mail1.ctn.st.com (mail1.ctn.st.com [164.130.116.128]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 13EB64BDB7 for ; Wed, 18 Mar 2009 08:36:23 +0000 (GMT) Received: from [10.52.139.41] (mdt-dhcp41.ctn.st.com [10.52.139.41]) by mail1.ctn.st.com (MOS 3.8.7a) with ESMTP id CZY51567 (AUTH virlinzi); Wed, 18 Mar 2009 09:36:23 +0100 (CET) Message-ID: <49C0B26E.7040201@st.com> Date: Wed, 18 Mar 2009 09:35:58 +0100 From: Francesco VIRLINZI User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Linux-sh Subject: [Proposal][PATCH] Fixed the irq interrupt line after a resume from hibenration Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org 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 From 8dd0655b55843957a06f6d2297e07322570b647d Mon Sep 17 00:00:00 2001 From: Francesco Virlinzi 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 --- 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 #include #include +#include +#include #include #include #include @@ -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