From patchwork Fri Mar 7 04:58:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenhui zhao X-Patchwork-Id: 327800 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 7055E2C049E for ; Fri, 7 Mar 2014 16:01:09 +1100 (EST) Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe002.messaging.microsoft.com [65.55.88.12]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2554C2C0349 for ; Fri, 7 Mar 2014 15:58:36 +1100 (EST) Received: from mail59-tx2-R.bigfish.com (10.9.14.252) by TX2EHSOBE015.bigfish.com (10.9.40.35) with Microsoft SMTP Server id 14.1.225.22; Fri, 7 Mar 2014 04:58:32 +0000 Received: from mail59-tx2 (localhost [127.0.0.1]) by mail59-tx2-R.bigfish.com (Postfix) with ESMTP id 3383E2A030E; Fri, 7 Mar 2014 04:58:32 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah21bch1fc6hzz1de098h8275bh1de097hz2dh2a8h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h1354h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e23h1fe8h1ff5h2218h2216h226dh22d0h24afh2327h2336h2438h2461h2487h24d7h2516h2545h255eh25cch25f6h2605h1155h) Received: from mail59-tx2 (localhost.localdomain [127.0.0.1]) by mail59-tx2 (MessageSwitch) id 1394168308954186_27507; Fri, 7 Mar 2014 04:58:28 +0000 (UTC) Received: from TX2EHSMHS020.bigfish.com (unknown [10.9.14.253]) by mail59-tx2.bigfish.com (Postfix) with ESMTP id DED94100085; Fri, 7 Mar 2014 04:58:28 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS020.bigfish.com (10.9.99.120) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 7 Mar 2014 04:58:28 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.3.158.2; Fri, 7 Mar 2014 04:58:28 +0000 Received: from localhost.localdomain ([10.193.20.174]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s274w9Dw005153; Thu, 6 Mar 2014 21:58:25 -0700 From: Chenhui Zhao To: Subject: [PATCH 5/9] powerpc/85xx: disable irq by hardware when suspend for 64-bit Date: Fri, 7 Mar 2014 12:58:01 +0800 Message-ID: <1394168285-32275-5-git-send-email-chenhui.zhao@freescale.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: <1394168285-32275-1-git-send-email-chenhui.zhao@freescale.com> References: <1394168285-32275-1-git-send-email-chenhui.zhao@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-FOPE-CONNECTOR: Id%0$Dn%FREESCALE.MAIL.ONMICROSOFT.COM$RO%1$TLS%0$FQDN%$TlsDn% Cc: scottwood@freescale.com, linux-kernel@vger.kernel.org, Jason.Jin@freescale.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In 64-bit mode, kernel just clears the irq soft-enable flag in struct paca_struct to disable external irqs. But, in the case of suspend, irqs should be disabled by hardware. Therefore, hook a function to ppc_md.suspend_disable_irqs to really disable irqs. Signed-off-by: Chenhui Zhao --- arch/powerpc/platforms/85xx/corenet_generic.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c index 3fdf9f3..983d81f 100644 --- a/arch/powerpc/platforms/85xx/corenet_generic.c +++ b/arch/powerpc/platforms/85xx/corenet_generic.c @@ -32,6 +32,13 @@ #include #include "smp.h" +#if defined(CONFIG_PPC64) && defined(CONFIG_SUSPEND) +static void fsl_suspend_disable_irqs(void) +{ + __hard_irq_disable(); +} +#endif + void __init corenet_gen_pic_init(void) { struct mpic *mpic; @@ -58,6 +65,11 @@ void __init corenet_gen_setup_arch(void) fsl_rcpm_init(); +#if defined(CONFIG_PPC64) && defined(CONFIG_SUSPEND) + /* physically disable irq for 64-bit mode when suspend */ + ppc_md.suspend_disable_irqs = fsl_suspend_disable_irqs; +#endif + pr_info("%s board from Freescale Semiconductor\n", ppc_md.name); }