From patchwork Thu Nov 27 05:07:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 41593 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E541825E18 for ; Thu, 27 Nov 2014 05:08:24 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id n15sf2549299lbi.4 for ; Wed, 26 Nov 2014 21:08:23 -0800 (PST) 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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=N5hh6VXHQKF6hE+37FBBrTEtcFXUoRzeb0w3zAMjaFU=; b=V9SIBWqOwl487du3jqp/nbzwkU9N/FJ/gt01OXlz0b9ETk4o8JFQbGcb518Vpk8j66 WAzAlG1WYE+km3raORqANqZ/1LRuHa1swnGMYE7+s2cCCSCx3FmMKc5Tcp36WPg/p8Gp 82wjeASaXQsPce+LQrWhwlOLOB4RcuFZMfW5X998oslJ4aCwzH4F25pSUH6TBiTLfgn2 T7hTtifXpJ3r3CoIOSdOt9dHJ78NnHe8stVZ/tihPGWprwHXVGEjmyvOP6dxrl3hY+pc qCjaHC+0XOWCYNV+wxP5lHXpbL0t+UK/cuTqiTOifvCCKQwLooKI4NQ2eb9V510LKLaB 90RA== X-Gm-Message-State: ALoCoQnM8d07RlB4eq9C7AMAzMx7lC6jie4jDjzS5RniLV7AGganSB+G0prihDrN/RZuSi6bcorD X-Received: by 10.181.12.37 with SMTP id en5mr7987970wid.6.1417064903813; Wed, 26 Nov 2014 21:08:23 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.17 with SMTP id s17ls511612lal.52.gmail; Wed, 26 Nov 2014 21:08:23 -0800 (PST) X-Received: by 10.153.6.33 with SMTP id cr1mr37705924lad.63.1417064903631; Wed, 26 Nov 2014 21:08:23 -0800 (PST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id y8si6166747lag.85.2014.11.26.21.08.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Nov 2014 21:08:23 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id l4so3588321lbv.11 for ; Wed, 26 Nov 2014 21:08:23 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr36555111laz.27.1417064903547; Wed, 26 Nov 2014 21:08:23 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp746002lbc; Wed, 26 Nov 2014 21:08:22 -0800 (PST) X-Received: by 10.68.241.130 with SMTP id wi2mr59080684pbc.89.1417064901769; Wed, 26 Nov 2014 21:08:21 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bt16si9777081pdb.179.2014.11.26.21.08.20 for ; Wed, 26 Nov 2014 21:08:21 -0800 (PST) Received-SPF: none (google.com: linux-acpi-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804AbaK0FIU (ORCPT + 6 others); Thu, 27 Nov 2014 00:08:20 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:33955 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbaK0FIT (ORCPT ); Thu, 27 Nov 2014 00:08:19 -0500 Received: by mail-pa0-f49.google.com with SMTP id eu11so4242885pac.22 for ; Wed, 26 Nov 2014 21:08:19 -0800 (PST) X-Received: by 10.68.110.4 with SMTP id hw4mr16650192pbb.48.1417064899209; Wed, 26 Nov 2014 21:08:19 -0800 (PST) Received: from localhost ([183.247.163.231]) by mx.google.com with ESMTPSA id va2sm5863559pac.15.2014.11.26.21.08.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Nov 2014 21:08:18 -0800 (PST) From: Hanjun Guo To: "Rafael J. Wysocki" Cc: Jiang Liu , Lorenzo Pieralisi , Sudeep Holla , Mark Rutland , Tony Luck , "H. Peter Anvin" , Lv Zheng , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v2 3/3] ACPI / processor: Rename acpi_(un)map_lsapic() to acpi_(un)map_cpu() Date: Thu, 27 Nov 2014 13:07:33 +0800 Message-Id: <1417064853-27905-4-git-send-email-hanjun.guo@linaro.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417064853-27905-1-git-send-email-hanjun.guo@linaro.com> References: <1417064853-27905-1-git-send-email-hanjun.guo@linaro.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , acpi_map_lsapic() will allocate a logical CPU number and map it to physical CPU id (such as APIC id) for the hot-added CPU, it will also do some mapping for NUMA node id and etc, acpi_unmap_lsapic() will do the reverse. We can see that the name of the function is a little bit confusing and arch (IA64) dependent so rename them as acpi_(un)map_cpu() to make arch agnostic and explicit. Signed-off-by: Hanjun Guo --- arch/ia64/kernel/acpi.c | 9 ++++----- arch/x86/kernel/acpi/boot.c | 9 ++++----- drivers/acpi/acpi_processor.c | 6 +++--- include/linux/acpi.h | 4 ++-- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 615ef81..e795cb8 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -893,13 +893,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) } /* wrapper to silence section mismatch warning */ -int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) +int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu) { return _acpi_map_lsapic(handle, physid, pcpu); } -EXPORT_SYMBOL(acpi_map_lsapic); +EXPORT_SYMBOL(acpi_map_cpu); -int acpi_unmap_lsapic(int cpu) +int acpi_unmap_cpu(int cpu) { ia64_cpu_to_sapicid[cpu] = -1; set_cpu_present(cpu, false); @@ -910,8 +910,7 @@ int acpi_unmap_lsapic(int cpu) return (0); } - -EXPORT_SYMBOL(acpi_unmap_lsapic); +EXPORT_SYMBOL(acpi_unmap_cpu); #endif /* CONFIG_ACPI_HOTPLUG_CPU */ #ifdef CONFIG_ACPI_NUMA diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 4433a4b..d162636 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -750,13 +750,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) } /* wrapper to silence section mismatch warning */ -int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) +int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu) { return _acpi_map_lsapic(handle, physid, pcpu); } -EXPORT_SYMBOL(acpi_map_lsapic); +EXPORT_SYMBOL(acpi_map_cpu); -int acpi_unmap_lsapic(int cpu) +int acpi_unmap_cpu(int cpu) { #ifdef CONFIG_ACPI_NUMA set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE); @@ -768,8 +768,7 @@ int acpi_unmap_lsapic(int cpu) return (0); } - -EXPORT_SYMBOL(acpi_unmap_lsapic); +EXPORT_SYMBOL(acpi_unmap_cpu); #endif /* CONFIG_ACPI_HOTPLUG_CPU */ int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index f02b29e..1020b1b 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -180,13 +180,13 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) cpu_maps_update_begin(); cpu_hotplug_begin(); - ret = acpi_map_lsapic(pr->handle, pr->phys_id, &pr->id); + ret = acpi_map_cpu(pr->handle, pr->phys_id, &pr->id); if (ret) goto out; ret = arch_register_cpu(pr->id); if (ret) { - acpi_unmap_lsapic(pr->id); + acpi_unmap_cpu(pr->id); goto out; } @@ -461,7 +461,7 @@ static void acpi_processor_remove(struct acpi_device *device) /* Remove the CPU. */ arch_unregister_cpu(pr->id); - acpi_unmap_lsapic(pr->id); + acpi_unmap_cpu(pr->id); cpu_hotplug_done(); cpu_maps_update_done(); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d22e0a8..0b5d4f0 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -143,8 +143,8 @@ void acpi_numa_arch_fixup(void); #ifdef CONFIG_ACPI_HOTPLUG_CPU /* Arch dependent functions for cpu hotplug support */ -int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu); -int acpi_unmap_lsapic(int cpu); +int acpi_map_cpu(acpi_handle handle, int physid, int *pcpu); +int acpi_unmap_cpu(int cpu); #endif /* CONFIG_ACPI_HOTPLUG_CPU */ #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC