From patchwork Tue Jan 12 02:05:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoyang Huang X-Patchwork-Id: 59592 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2464911lbb; Mon, 11 Jan 2016 18:05:43 -0800 (PST) X-Received: by 10.98.72.200 with SMTP id q69mr30512807pfi.159.1452564343382; Mon, 11 Jan 2016 18:05:43 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pm5si23086906pac.48.2016.01.11.18.05.42; Mon, 11 Jan 2016 18:05:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761163AbcALCFk (ORCPT + 29 others); Mon, 11 Jan 2016 21:05:40 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35532 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760016AbcALCFj (ORCPT ); Mon, 11 Jan 2016 21:05:39 -0500 Received: by mail-pa0-f41.google.com with SMTP id ho8so69999483pac.2 for ; Mon, 11 Jan 2016 18:05:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=PpuR9C3TEoOrVx4paonLGN45z5dLvVirYWxoTA5waY0=; b=TkVSx/4ym/uPKZPccG4l9yuk5xsmbjHwZAh5/XA41I/Bozptd/ns1+Scw38fB5/XIB Va5vSuLZ/Iae4tERgR6uk5RFpoYLkfvZh/ORn2YF9b8foPR0H66Xp2dmXAabafi9m++h xFjERIVKXxh+q0ooHhZ1f6ItM0Ax/9RBF0hsY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=PpuR9C3TEoOrVx4paonLGN45z5dLvVirYWxoTA5waY0=; b=OQQHMtCy8vWP4vcwFeRVUHD4RMRXDJi/v96bpY5SWvkgAqN5p7e4IYOoRDtZvOJAiF +W8m4I5bG6Kva+D43PcFTV4KwFDogKw5VRJl1kD/oexKU4MvS+v7dd3n2wIFP9avSFmy IxO4eJYE9z0xc9jZOxb8R6wToSo5YlFHvGmXjNpxI0AzdMDLu6JNtpy5IBHcDmouzMts 1ZWe7QZvXX/kNM0uTSQiLZy9qSd8R0Px6KJ1iJc2RibDLxKQ0mVEH3QSeKUWbNDa+5Dj UwQfEj6fE19h3kqPlGaWFerpaJOlfXDNolJPWoLAEkoarzkuu3mIGJ5cfF5uoiyAkec6 XMOQ== X-Gm-Message-State: ALoCoQlnamp9GEy36OzwrCni4vwO9OWQ4QPEoWa2GvgBSLIP92C9HG9uz4tXpYBoak6NvvmrXszLi1/TtnjKLpjmW70LCff1Vw== X-Received: by 10.66.252.198 with SMTP id zu6mr18129233pac.107.1452564338748; Mon, 11 Jan 2016 18:05:38 -0800 (PST) Received: from zyhuangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id 20sm4761700pfa.5.2016.01.11.18.05.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 18:05:38 -0800 (PST) From: Zhaoyang Huang X-Google-Original-From: Zhaoyang Huang To: zhaoyang.huang@spreadtrum.com, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, lorenzo.pieralisi@arm.com, hanjun.guo@linaro.org, suzuki.poulose@arm.com Subject: [RFC PATCH v2] Add IPI entry for CPU UP Date: Tue, 12 Jan 2016 10:05:12 +0800 Message-Id: <1452564312-1265-1-git-send-email-zhaoyang.huang@spreadtrum.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some ARM SOCs, IPI interrupt is used for hotplug in one cpu, that is, sending a IPI to the core in WFI and powerdown status. So Add a IPI entry for handle this kind of cpu up interrupt Launching the IPI can be done within PSCI, while there will be one unknown type of IPI as the dest core come up to the kernel world which will bring a warning so far.So add such type of IPI to handle the interrupt. Signed-off-by: Zhaoyang Huang --- arch/arm64/include/asm/hardirq.h | 2 +- arch/arm64/kernel/smp.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) -- 1.7.9.5 diff --git a/arch/arm64/include/asm/hardirq.h b/arch/arm64/include/asm/hardirq.h index a57601f..bb4edb7 100644 --- a/arch/arm64/include/asm/hardirq.h +++ b/arch/arm64/include/asm/hardirq.h @@ -20,7 +20,7 @@ #include #include -#define NR_IPI 5 +#define NR_IPI 6 typedef struct { unsigned int __softirq_pending; diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index b1adc51..20e63c9 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -70,6 +70,7 @@ enum ipi_msg_type { IPI_CPU_STOP, IPI_TIMER, IPI_IRQ_WORK, + IPI_CPU_UP, }; /* @@ -627,6 +628,7 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = { S(IPI_CPU_STOP, "CPU stop interrupts"), S(IPI_TIMER, "Timer broadcast interrupts"), S(IPI_IRQ_WORK, "IRQ work interrupts"), + S(IPI_CPU_UP, "Hotplug cpu up by ipi"), }; static void smp_cross_call(const struct cpumask *target, unsigned int ipinr) @@ -746,6 +748,8 @@ void handle_IPI(int ipinr, struct pt_regs *regs) irq_exit(); break; #endif + case IPI_CPU_UP: + break; default: pr_crit("CPU%u: Unknown IPI message 0x%x\n", cpu, ipinr); @@ -798,3 +802,9 @@ int setup_profiling_timer(unsigned int multiplier) { return -EINVAL; } + +void smp_send_cpuup(int cpu) +{ + smp_cross_call(cpumask_of(cpu), IPI_CPU_UP); +} +