From patchwork Fri Aug 1 09:48:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 4662061 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2BF509F319 for ; Fri, 1 Aug 2014 09:49:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5050820219 for ; Fri, 1 Aug 2014 09:49:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D60B2020F for ; Fri, 1 Aug 2014 09:48:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753793AbaHAJs7 (ORCPT ); Fri, 1 Aug 2014 05:48:59 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:28558 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750783AbaHAJs6 (ORCPT ); Fri, 1 Aug 2014 05:48:58 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 01 Aug 2014 18:48:57 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 8BBA043E18; Fri, 1 Aug 2014 18:48:57 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 71ED3480A7; Fri, 1 Aug 2014 18:48:57 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 6D6B0480A6; Fri, 1 Aug 2014 18:48:57 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id UAF15353; Fri, 1 Aug 2014 18:48:57 +0900 X-IronPort-AV: E=Sophos;i="5.01,778,1399993200"; d="scan'208";a="165945375" Received: from mail-hk1lp0120.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.120]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 01 Aug 2014 18:48:57 +0900 Received: from [10.161.20.223] (211.11.155.147) by HKNPR06MB115.apcprd06.prod.outlook.com (10.242.102.146) with Microsoft SMTP Server (TLS) id 15.0.995.14; Fri, 1 Aug 2014 09:48:55 +0000 Message-ID: <53DB6284.3090506@renesas.com> Date: Fri, 1 Aug 2014 18:48:52 +0900 From: keita kobayashi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: , CC: , Magnus Damm , Subject: [PATCH 5/6] ARM: shmobile: Add CPU notifier for CPUIdle boot vector X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: HKXPR06CA012.apcprd06.prod.outlook.com (10.141.129.42) To HKNPR06MB115.apcprd06.prod.outlook.com (10.242.102.146) X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 029097202E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(6049001)(6009001)(189002)(199002)(77096002)(74662001)(87976001)(65806001)(59896001)(66066001)(50986999)(87266999)(65956001)(36756003)(42186005)(23736002)(54356999)(99396002)(74502001)(76482001)(85852003)(575784001)(83506001)(80022001)(47776003)(86362001)(79102001)(64706001)(107046002)(20776003)(50466002)(86152002)(46102001)(102836001)(4396001)(80316001)(106356001)(95666004)(19580395003)(33656002)(21056001)(101416001)(83322001)(81342001)(65816999)(81542001)(83072002)(19580405001)(92726001)(77982001)(229853001)(85306004)(105586002); DIR:OUT; SFP:; SCL:1; SRVR:HKNPR06MB115; H:[10.161.20.223]; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; LANG:en; X-OriginatorOrg: renesas.com Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add CPU notifiers for the shared mach-shmobile cpuidle code. Signed-off-by: Keita Kobayashi --- arch/arm/mach-shmobile/cpuidle.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index 19c0c98..1771dd3 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -20,6 +20,27 @@ #include #include "common.h" +static int shmobile_cpuidle_notifier_call(struct notifier_block *nfb, + unsigned long action, void *hcpu) +{ + unsigned int cpu = (long)hcpu; + + switch (action) { + case CPU_ONLINE: + case CPU_STARTING: + case CPU_STARTING_FROZEN: + /* For this particular CPU register CPUIdle boot vector */ + shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0); + break; + }; + + return NOTIFY_OK; +} + +static struct notifier_block shmobile_cpuidle_notifier = { + .notifier_call = shmobile_cpuidle_notifier_call, +}; + static struct cpuidle_driver shmobile_cpuidle_default_driver = { .name = "shmobile_cpuidle", .owner = THIS_MODULE, @@ -51,6 +72,9 @@ int __init shmobile_cpuidle_init(void) } #ifdef CONFIG_ARCH_SHMOBILE_MULTI + /* Use CPU notifier for reset vector control */ + register_cpu_notifier(&shmobile_cpuidle_notifier); + platform_device_register(&shmobile_cpuidle); return 0; #else