From patchwork Thu Mar 27 15:38:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 27208 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 63A60202FA for ; Thu, 27 Mar 2014 15:38:58 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f10sf8655389yha.7 for ; Thu, 27 Mar 2014 08:38:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=zaxopfDg1r2V4WWj8BNHIRP+EuKrm9YoIIQ3ooKr7dg=; b=V6B5TpEa6/62soi68DbkQKg7Z7xhLNR3fAz0RkFMlahjFLKzWyMBvEBAbaf/KSRhAY ap+ApSTLZI2fkF8ZjBw9WPoagVutyearQwjTMNpvAII18ZT8ahHxfRTKvs6oOxhsW/Mn o+lkoDcDzJlJ94MZXtuQwHwkJLprlfsoT6ElZlNAgwUlo7t3zRqIvDn3yX5ThocE5IJF fGgoGa722K+gl6X8ayZxry2HviwyrfRW8GQimXRXCUUYkb5hMx8Mjvxk2ZqN8u8/2X+K ANZcl2BG7GG2x3/CXxCREkH4cOgZU3eUnI54Z6FgXabmwG/Mo5A9hiz+QF2zYS/IL5cR 9UPg== X-Gm-Message-State: ALoCoQlZy06rTJ1xgFTSo88PwBm0QTI6bFw1AwWjZiEr/6fRetDnpmOSdkasdAVz5J616bymee6/ X-Received: by 10.59.10.40 with SMTP id dx8mr25261332ved.26.1395934738168; Thu, 27 Mar 2014 08:38:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.120 with SMTP id y111ls1190566qgd.0.gmail; Thu, 27 Mar 2014 08:38:58 -0700 (PDT) X-Received: by 10.58.31.136 with SMTP id a8mr2075249vei.20.1395934738054; Thu, 27 Mar 2014 08:38:58 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id sc7si627687vdc.121.2014.03.27.08.38.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 08:38:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so4265937veb.41 for ; Thu, 27 Mar 2014 08:38:58 -0700 (PDT) X-Received: by 10.52.78.231 with SMTP id e7mr1697541vdx.28.1395934737989; Thu, 27 Mar 2014 08:38:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp37926vck; Thu, 27 Mar 2014 08:38:56 -0700 (PDT) X-Received: by 10.140.23.148 with SMTP id 20mr2757327qgp.89.1395934736141; Thu, 27 Mar 2014 08:38:56 -0700 (PDT) Received: from mail-qc0-f169.google.com (mail-qc0-f169.google.com [209.85.216.169]) by mx.google.com with ESMTPS id 6si1199576qav.44.2014.03.27.08.38.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 08:38:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.216.169 is neither permitted nor denied by best guess record for domain of ashwin.chaugule@linaro.org) client-ip=209.85.216.169; Received: by mail-qc0-f169.google.com with SMTP id i17so4520808qcy.0 for ; Thu, 27 Mar 2014 08:38:56 -0700 (PDT) X-Received: by 10.224.80.201 with SMTP id u9mr2912235qak.5.1395934735293; Thu, 27 Mar 2014 08:38:55 -0700 (PDT) Received: from localhost.localdomain (cpe-098-027-049-158.nc.res.rr.com. [98.27.49.158]) by mx.google.com with ESMTPSA id g7sm1499522qaf.14.2014.03.27.08.38.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 08:38:54 -0700 (PDT) From: Ashwin Chaugule To: mark.rutland@arm.com Cc: linaro-acpi@lists.linaro.org, linux-arm-kernel@lists.infradead.org, rob.herring@linaro.org, christoffer.dall@linaro.org, Marc.Zyngier@arm.com, anup.patel@linaro.org, patches@linaro.org, Ashwin Chaugule Subject: [PATCH v2 3/3] ARM: Check if a CPU has gone offline Date: Thu, 27 Mar 2014 11:38:35 -0400 Message-Id: <1395934715-31348-3-git-send-email-ashwin.chaugule@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395934715-31348-1-git-send-email-ashwin.chaugule@linaro.org> References: <1395934715-31348-1-git-send-email-ashwin.chaugule@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ashwin.chaugule@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , PSCIv0.2 adds a new function called AFFINITY_INFO, which can be used to query if a specified CPU has actually gone offline. Calling this function via cpu_kill ensures that a CPU has quiesced after a call to cpu_die. Signed-off-by: Ashwin Chaugule --- arch/arm/kernel/psci_smp.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/kernel/psci_smp.c b/arch/arm/kernel/psci_smp.c index 570a48c..2407843 100644 --- a/arch/arm/kernel/psci_smp.c +++ b/arch/arm/kernel/psci_smp.c @@ -66,6 +66,24 @@ void __ref psci_cpu_die(unsigned int cpu) /* We should never return */ panic("psci: cpu %d failed to shutdown\n", cpu); } + +int __ref psci_cpu_kill(unsigned int cpu) +{ + int err = 0; + + if (psci_ops.affinity_info) { + err = psci_ops.affinity_info(cpu, 0); + + if (err != 1) { + pr_err("psci: Cannot kill CPU:%d, psci ret val: %d\n", + cpu, err); + /* Make platform_cpu_kill() fail. */ + return 0; + } + } + return err; +} + #endif bool __init psci_smp_available(void) @@ -78,5 +96,6 @@ struct smp_operations __initdata psci_smp_ops = { .smp_boot_secondary = psci_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU .cpu_die = psci_cpu_die, + .cpu_kill = psci_cpu_kill, #endif };