Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3844121ybi; Tue, 18 Jun 2019 07:23:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMjuAdlwf4ZAN4WFYLUb8yr4PagnpO9WmzzA8aNtoykIi8iSpiuxT9b09Dif5xPuDtWOKn X-Received: by 2002:a17:902:6b02:: with SMTP id o2mr19598998plk.133.1560867798770; Tue, 18 Jun 2019 07:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560867798; cv=none; d=google.com; s=arc-20160816; b=c5w5WfOBwI2QrOviXo6gVMcZjGCSfdBjIDUY0a24UbxmPASOG09+teF+jSFhPLqzc0 9cWPrC34dPE2g7LTjPMjqBvZ0120uhLgKcGirEEsLni4URTbqETB5gBij0R0beFX0OxJ sTh2aa3bNEI8sAc8cGrzOH3onTMN4COnF4u4fwy4Vpm+0LwDT7bMMVI6RjXf+FTD2tbd GJwuMHjItegB7Ss5G3oDKLqMBlmvGcCnBcslciXX1CEPjbhq8QugqebxOr17qNL3WhRe Z/2uA0RnqO5SAKBD3tQ74S0k/RwHIywTj6/B3aMkHORe66HdVxbcDqcpwvzNH2kXGWAk +UGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=qhGEZblvxIpOwgGdDhN7SP+92VJrS31kY80WkHhAuAY=; b=N/XI1grT+xOlbizbYUl1/O2r1kA/8q3VwcdLaEupQ9qDII+jJ5iOhie67/ORzxDbGd fFuzlbfeFlHY5DswhnHGadZgbGxhWZSOkPfr+velnWqwibDBrEG4Ar6Os2PZbb25xtTB lXKkV9452mr2iTMyLKohkaYyT8qsTCjmCBJdVa9NHP3EDSWoI97QgVN4slYkCNc9fJiB KbEqpbvJnPlqw1fIx/HbHEjeMEl+HjY1FQRY+Kpfd5Da62xMF1d9XY2tqto4ky2hucpx 9G2JozV9dqta5TWrAyw6MwwIigQJqq0mfKPf8mYxOi7Ab5D7WPDchsHwRTcdZtZnr20V 3DuQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d67si332197pgc.62.2019.06.18.07.23.03; Tue, 18 Jun 2019 07:23:18 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729325AbfFROVa (ORCPT + 99 others); Tue, 18 Jun 2019 10:21:30 -0400 Received: from foss.arm.com ([217.140.110.172]:43570 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728881AbfFROV3 (ORCPT ); Tue, 18 Jun 2019 10:21:29 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 39AF22B; Tue, 18 Jun 2019 07:21:29 -0700 (PDT) Received: from [192.168.122.164] (U201426.austin.arm.com [10.118.28.29]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 281FC3F718; Tue, 18 Jun 2019 07:21:29 -0700 (PDT) Subject: Re: [PATCH v2 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag To: Valentin Schneider , linux-arm-kernel@lists.infradead.org Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, sudeep.holla@arm.com, lenb@kernel.org References: <20190614223158.49575-1-jeremy.linton@arm.com> <20190614223158.49575-2-jeremy.linton@arm.com> <667f95c0-5aa9-f460-a49a-e6dfefc027d8@arm.com> From: Jeremy Linton Message-ID: <2d1b547f-f9ee-391c-c4f3-0232a08a86bc@arm.com> Date: Tue, 18 Jun 2019 09:21:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <667f95c0-5aa9-f460-a49a-e6dfefc027d8@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/17/19 7:34 AM, Valentin Schneider wrote: > Hi Jeremy, > > Few nits below. > > Also, I had a look at the other PPTT processor flags that were introduced > in 6.3, and the only other one being used is ACPI_LEAF_NODE in > acpi_pptt_leaf_node(). However that one already has a handle on the table > header, so the check_acpi_cpu_flag() isn't of much help there. > > I don't believe the other existing flags will benefit from the helper since > they are more about describing the PPTT tree, but I think it doesn't hurt > to keep it around for potential future flags. That was the thought process. > > On 14/06/2019 23:31, Jeremy Linton wrote: > [...] >> @@ -517,6 +517,43 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag) >> return retval; >> } >> >> +/** >> + * check_acpi_cpu_flag() - Determine if CPU node has a flag set >> + * @cpu: Kernel logical CPU number >> + * @rev: The PPTT revision defining the flag >> + * @flag: The flag itself >> + * >> + * Check the node representing a CPU for a given flag. >> + * >> + * Return: -ENOENT if the PPTT doesn't exist, the CPU cannot be found or >> + * the table revision isn't new enough. >> + * Otherwise returns flag value >> + */ > > Nit: strictly speaking we're not returning the flag value but its mask > applied to the flags field. I don't think anyone will care about getting > the actual flag value, but it should be made obvious in the doc: Or I clarify the code to actually do what the comments says. Maybe that is what John G was also pointing out too? > > -ENOENT if ... > 0 if the flag isn't set >> 0 if it is set. > > [...] >> @@ -581,6 +618,21 @@ int cache_setup_acpi(unsigned int cpu) >> return status; >> } >> >> +/** >> + * acpi_pptt_cpu_is_thread() - Determine if CPU is a thread >> + * @cpu: Kernel logical CPU number >> + * >> + * > > Nit: extra newline > >> + * Return: 1, a thread >> + * 0, not a thread >> + * -ENOENT ,if the PPTT doesn't exist, the CPU cannot be found or >> + * the table revision isn't new enough. >> + */ >> +int acpi_pptt_cpu_is_thread(unsigned int cpu) >> +{ >> + return check_acpi_cpu_flag(cpu, 2, ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD); >> +} >> + >> /** >> * find_acpi_cpu_topology() - Determine a unique topology value for a given CPU >> * @cpu: Kernel logical CPU number >> @@ -641,7 +693,6 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level) > [...] >