Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp144545lqf; Fri, 26 Apr 2024 02:15:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+uHJiZoQPjAvPZDVwm1zKb27Rrg18fRF1+OBaSKGqorBw1IuJQaG1opnxwGCvCNYIMfvqCkqAHyne/fXsvgY2SrcpQ+0uI6Er29zLrw== X-Google-Smtp-Source: AGHT+IEm47K7SkLBY+9kGGY6csfmn+NX+6P4/BJay+Cq4I0Dzd4W0fPi2JmrywEGRiyea0vVWbDR X-Received: by 2002:a17:902:eb91:b0:1e3:f6cb:51fe with SMTP id q17-20020a170902eb9100b001e3f6cb51femr2468622plg.23.1714122942071; Fri, 26 Apr 2024 02:15:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714122942; cv=pass; d=google.com; s=arc-20160816; b=FuE4UJpb3Y4ebCMNO2eyFHn3X27TRZElOvatR3fUkzVb3QnaMPMhiV/gs3KmHJHGFB 1qKqdWwGkFFnvNvZ6bKdTJhnPG5VQpXlSE4c59d7gWc/k1x41LtP16HzCffpTBQYJdK9 JMpZxGW2DXrBERYYWTl0X4ymtI6iN83CCJh3Ej+mng+crnoMcUKMLpa2TdgKaYZ3MgbU dL7gowzPEvOc1iCbxjDISr8CEaZqna/AZ+7q0mg2n4oJR/S6hf6VO0xg9zAtpZVHRX0t b67n7z4DlZi+QBoI0SNdorgyy0Ev5HmJeYPpa+xL2OvF4HnAIhnZwuT32mJXYfP0qMXf D8bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=1jkzt/L+mhv/WzsExsbPIs4x3qKy+eN4N2XWavPkUaM=; fh=JwdDhs3mR2Y/t1NiIQX0vtI6+oLKXgEEejd3bG6n0Aw=; b=cUEIa8LOiaNiGB1iBWLp9gHMLl2xav7gRbnkxtWUsaIg7sYTkjMJDDaU4N1gU7Zdfm /LMta4ZlpOKUjJniIVRmTzsYt2+PACzN34LhlDkSv1jhuzW/pKRCfUzox6IeqOlzWwmT vMBhc2nIsq+XOPGHR0lmjoV7SDqmYF+pOYs3Z/RXNomNBWIMo0C5X9cp2T+EqdFTsm2t 2RvJplup+MkdQdF2aMfSckkf/vkk9aO/KnlCMtufHtJ4TzLCyoR10ZDGp6xos9UJ35la D1MN4y1PD753Ism2eRt5VWgwgvuz71Q2Swx3NJ2OPZdtSmoZZTaXMav+AXZBVEgYG8iy F+cg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zt3Jbq04; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-159766-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g7-20020a1709026b4700b001eab1c688c3si3009093plt.431.2024.04.26.02.15.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159766-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zt3Jbq04; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-159766-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A45F42833C4 for ; Fri, 26 Apr 2024 09:15:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6720513E419; Fri, 26 Apr 2024 09:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Zt3Jbq04" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 098A913DB90 for ; Fri, 26 Apr 2024 09:15:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122933; cv=none; b=SIZwu2wKrm+Ym8wJ8JnL528AMh8V+1x2A+T3IS11269t2AtFj0mnho7xAuybOyJfrre2ciO/lqrYU6BSjEN3I5VRXQx2lvZ/3qC2RjPjDAZ5Gw/ZiAX12g3ol0w6WcmKwHwaBfMMbeY2E+1eG25UsWcRoT+6QkV3JPD0l98L1b0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122933; c=relaxed/simple; bh=+FjPzM84B6BX9czEfRXFDbCKq4ptfl8l7j3daLkKm1k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AbXfjDj9DSUO126BzMPdfvcmoWztde9ZDp8UfkVZK2fx9+lImcAbDO63+Qh7LYiUazG9NUv8lvYCLk7eqDCN+fiFl3Himw3OrC+1C2fsjXYaGe5S2t4uwB4bsFt4L7msZnZD8guNWif9l7mF3pxt1+EFLi3IHEnrqlZCohK3Obw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Zt3Jbq04; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714122930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1jkzt/L+mhv/WzsExsbPIs4x3qKy+eN4N2XWavPkUaM=; b=Zt3Jbq04CN6cjSq6IiIQpokjtDtREgT0DkTtXp+KWopoKX3HtoN17dDtONJPnYMmA/RCL+ mUKgRHqNHAE6REKmtq8vy2ZS2FD/HwtZYgSsBkjWL2B3RO78/HxvUnOndielRi5Hvu77HL ZOQIFar/OOMi2WeoP8VlDDKadh7N2K8= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-637-UkpT2mAMPW6ixhv1BOgt4g-1; Fri, 26 Apr 2024 05:15:28 -0400 X-MC-Unique: UkpT2mAMPW6ixhv1BOgt4g-1 Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-5f80a77b95cso2172644a12.0 for ; Fri, 26 Apr 2024 02:15:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714122927; x=1714727727; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1jkzt/L+mhv/WzsExsbPIs4x3qKy+eN4N2XWavPkUaM=; b=qfFonaZY8p+08bqpOtIV8UxDHU2TtsTOXfs9LPg2aQs/cgic37Z0WZ6tQcUhK6VTH2 eoEFvY+oz03K+1unQo06iBWcuGXOQhagXXVE1DAlt9SwyPidfnLk+KMK0QHsmlQeff2S Et4TFymO5Hix/Hq0WATLRO23mXxKNK8afGbM0uL4Ll29/iP9I1T3gOo4EQBZ2H0pzTBS JYsXedi7akyObjgRtIAqF0ODh9/BcP8Yrp3iXJGO1Mw5dwfn7u4AGjTb7Sc72h/5lQRQ tQ9sA9rI7JbRrnhsUpb3D9WIVObbd8FWw9fg6iBmBf7hKfe/tmoeWyRgKM6enfwScQ/+ 1Yiw== X-Forwarded-Encrypted: i=1; AJvYcCVU54Rsc7uWReSjZLDGq6NvCIQOkWMcP4riIXsdmCEUV3tg1eZ6JtQll15XtFS2/H7QDc62iZOhmfjyniYNWAw6yefVg53WY02Uul10 X-Gm-Message-State: AOJu0YwBbuAOAnMyx9rSIAi4wWh+f2R7FaKY0pvxdMcc7od4QFqg5+JN sbXlZENcaoZeUJuhItEMmVjgDbJEeAq0D0Dtwy2pj2g/SFDbqVEaoqlnQDdpznFqe8AzzmXb+hJ 6570SnvoNhGzszz6hLA8RrkRlthxBqrpovgwP10lIs7rw7LK1vqLn/hvn3wl9TA== X-Received: by 2002:a05:6a20:2713:b0:1a7:5425:3044 with SMTP id u19-20020a056a20271300b001a754253044mr2110978pze.62.1714122927165; Fri, 26 Apr 2024 02:15:27 -0700 (PDT) X-Received: by 2002:a05:6a20:2713:b0:1a7:5425:3044 with SMTP id u19-20020a056a20271300b001a754253044mr2110962pze.62.1714122926856; Fri, 26 Apr 2024 02:15:26 -0700 (PDT) Received: from [192.168.68.50] ([43.252.112.88]) by smtp.gmail.com with ESMTPSA id bm5-20020a056a00320500b006ecf3e302ffsm14955063pfb.174.2024.04.26.02.15.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 02:15:26 -0700 (PDT) Message-ID: <4d4f1a85-7aad-4ea1-aaed-1bb744d3ef99@redhat.com> Date: Fri, 26 Apr 2024 19:15:16 +1000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 05/16] ACPI: processor: Add acpi_get_processor_handle() helper Content-Language: en-US To: Jonathan Cameron , Thomas Gleixner , Peter Zijlstra , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon Cc: Ingo Molnar , Borislav Petkov , Dave Hansen , linuxarm@huawei.com, justin.he@arm.com, jianyong.wu@arm.com References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-6-Jonathan.Cameron@huawei.com> From: Gavin Shan In-Reply-To: <20240418135412.14730-6-Jonathan.Cameron@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/18/24 23:54, Jonathan Cameron wrote: > If CONFIG_ACPI_PROCESSOR provide a helper to retrieve the > acpi_handle for a given CPU allowing access to methods > in DSDT. > > Signed-off-by: Jonathan Cameron > --- > v7: No change > v6: New patch > --- > drivers/acpi/acpi_processor.c | 10 ++++++++++ > include/linux/acpi.h | 7 +++++++ > 2 files changed, 17 insertions(+) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c > index ac7ddb30f10e..127ae8dcb787 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -35,6 +35,16 @@ EXPORT_PER_CPU_SYMBOL(processors); > struct acpi_processor_errata errata __read_mostly; > EXPORT_SYMBOL_GPL(errata); > > +acpi_handle acpi_get_processor_handle(int cpu) > +{ > + acpi_handle handle = NULL; > + struct acpi_processor *pr = per_cpu(processors, cpu);; ^^ s/;;/; > + > + if (pr) > + handle = pr->handle; > + > + return handle; > +} > static int acpi_processor_errata_piix4(struct pci_dev *dev) > { > u8 value1 = 0; > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index 34829f2c517a..9844a3f9c4e5 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -309,6 +309,8 @@ int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id, > int acpi_unmap_cpu(int cpu); > #endif /* CONFIG_ACPI_HOTPLUG_CPU */ > > +acpi_handle acpi_get_processor_handle(int cpu); > + > #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC > int acpi_get_ioapic_id(acpi_handle handle, u32 gsi_base, u64 *phys_addr); > #endif > @@ -1077,6 +1079,11 @@ static inline bool acpi_sleep_state_supported(u8 sleep_state) > return false; > } > > +static inline acpi_handle acpi_get_processor_handle(int cpu) > +{ > + return NULL; > +} > + > #endif /* !CONFIG_ACPI */ > > extern void arch_post_acpi_subsys_init(void); Thanks, Gavin