From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB837C5B578 for ; Wed, 3 Jul 2019 21:57:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F4D4218A0 for ; Wed, 3 Jul 2019 21:57:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="X7jCwRuq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F4D4218A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hIYOZjhHWMNrWhYvfb0aO8CmDVx9j2szKe3SkONcRt8=; b=X7jCwRuqaqx0IS FXhks27z9sA2UIOouBELkk2YZ1zRTC6x5vX+O5BQs8Nedd/Za+URUlnROuTAcqArUr/poVqdtGzU4 kLUN58oSTdGD4wYpKcknngfw8cgMTa4Z05tx4c2xFCvVWZwNH8bwI1L1ReTWHFlBFi7O4/bUaZZA4 libLrm1+E+vZa00V2G/mCHHkvUe9T37SDkkPDQrfDX59OboM0joxPHGaO2ekIyt8wrPTNlrh+XLH2 pRikctFb75nngqOsCRtAdb/r1k/uI+m0G48518V7RPIBg3szHJL0rgOqmq3C24xAjJDtUZpVSlUvV xym2fccEwWcrtFLqbasw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hinFp-0002VZ-BD; Wed, 03 Jul 2019 21:57:29 +0000 Received: from mail-oi1-f195.google.com ([209.85.167.195]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hinFm-0002VD-QP for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2019 21:57:28 +0000 Received: by mail-oi1-f195.google.com with SMTP id u15so3374491oiv.0 for ; Wed, 03 Jul 2019 14:57:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=facAcgFC+XTI+qNs39LIa4BXwWP87/6c178m8FLgQfQ=; b=Q47MCQD7arHrsWbK82J4nMbCFEt9dpLco34fATyj7g8bT9C0digi6FnS4mzRphERrv /xjnA/USmSfAKHAhwMpW1j4+DCXHc1hh5hk0UPuemWtWUMbQYyks2zcWu7O+m6SgpS6M E0rJLwXfJO4wcggSZeaAnhy69AopVGCFinSlNL3gfT6fygCj/neNzn4RdyZZaW1QqxbD 8g9+SkRlf4ELbyi1Kq94mxuML+ZT5XVePgaRnH9mYXDs7HaspaGWt1hriwSuTMn9eiEe xW+FtcdEedlyzfDUVZFjdzzYtQaprsdLlfk4v+7xjG5++j8acCtUIkK/p5PwgZk7C2dg AJbA== X-Gm-Message-State: APjAAAUCK2oHJYtAC5LLToR/h7Ns3TVpdbIixFXwtzQwUIqKhh5ZTY1P MP1WeGv36e/7CxO5iRb/yRFJhCrAENBQJfOLEPE= X-Google-Smtp-Source: APXvYqzbb/QOqIuPIhxbKWonTtHMaRerzldSRDFJhW+ynUsKgKiTuWJwzd94OrgPXubso2zMBpaspTzhRLIkfY2kyCo= X-Received: by 2002:aca:5a41:: with SMTP id o62mr446353oib.110.1562191044904; Wed, 03 Jul 2019 14:57:24 -0700 (PDT) MIME-Version: 1.0 References: <20190628181457.6609-1-jeremy.linton@arm.com> <20190628181457.6609-2-jeremy.linton@arm.com> <1745d9ee-a4e0-9a6f-138c-c0d5b42b5281@arm.com> In-Reply-To: <1745d9ee-a4e0-9a6f-138c-c0d5b42b5281@arm.com> From: "Rafael J. Wysocki" Date: Wed, 3 Jul 2019 23:57:12 +0200 Message-ID: Subject: Re: [PATCH v3 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag To: Jeremy Linton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190703_145726_864991_BF9D0868 X-CRM114-Status: GOOD ( 20.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Sudeep Holla , Will Deacon , ACPI Devel Maling List , Catalin Marinas , Linux ARM , Len Brown Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 3, 2019 at 5:11 PM Jeremy Linton wrote: > > Hi, > > Thanks for taking a look at this. > > On 7/3/19 4:24 AM, Rafael J. Wysocki wrote: > > On Fri, Jun 28, 2019 at 8:15 PM Jeremy Linton wrote: > >> > >> ACPI 6.3 adds a flag to the CPU node to indicate whether > >> the given PE is a thread. Add a function to return that > >> information for a given linux logical CPU. > >> > >> Signed-off-by: Jeremy Linton > >> --- > >> drivers/acpi/pptt.c | 62 +++++++++++++++++++++++++++++++++++++++++++- > >> include/linux/acpi.h | 5 ++++ > >> 2 files changed, 66 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c > >> index b72e6afaa8fb..bb6196422fad 100644 > >> --- a/drivers/acpi/pptt.c > >> +++ b/drivers/acpi/pptt.c > >> @@ -517,6 +517,52 @@ 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. > >> + * 1, any passed flag set > >> + * 0, flag unset > >> + */ > >> +static int check_acpi_cpu_flag(unsigned int cpu, int rev, u32 flag) > > > > Why not bool? > > At least for the thread flag we need the three states so that we can > fall back to the CPU's description of itself on machines without ACPI > 6.3 tables. > > The ThunderX2 is threaded and without a firmware update a change like > this will break it. Fair enough. > > > >> +{ > >> + struct acpi_table_header *table; > >> + acpi_status status; > >> + u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu); > >> + struct acpi_pptt_processor *cpu_node = NULL; > >> + int ret = -ENOENT; > >> + static int saved_pptt_rev = -1; > >> + > >> + /* Cache the PPTT revision to avoid repeat table get/put on failure */ > > > > This is a rather questionable optimization. > > > > Does the extra table get/put really matter? > > AFAIK, Probably not. Then why to optimize it? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel