From patchwork Fri Jun 29 16:17:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 937030 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lv0DSMtb"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41HMJc4pxcz9s0n for ; Sat, 30 Jun 2018 02:18:24 +1000 (AEST) 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:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0CFNxCwDov98TtV44MwYH51tSPHXn9fP0YxQvUCKmCs=; b=lv0DSMtbKENOGG /VqH6rDlYZ3I6ZwlsJ50b99ukKw1JNxjISgQPExdw7/+zA9fuSSk7FW3yxE8GEZTDned5n2xfsqO2 u/FSmwVmjpdpf/TgTjzsP5xq3+kTJOh3K7Q5CEocUAu3wftzSSriIbZ4cwfJyO57PrlPajjzAo//G oYqeaEdpWSq9ouV8k/shiAjRB22NmM4hV2quSvzjjbfSmdkg1Hw5zB8rRAkt/7BHIx78ZMintj4Yk oMMR+EXwS0aG5UsvjXTV0jWbXxS/FH1EufYptsAhPFM+EjKYe+yFTnF3+EPYFanIYZ1My49YASS+k IYC6jPvb778/Ro86BBng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYw6H-0004EK-3J; Fri, 29 Jun 2018 16:18:21 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYw6C-0004Bd-5v for linux-arm-kernel@lists.infradead.org; Fri, 29 Jun 2018 16:18:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C4A7D18A; Fri, 29 Jun 2018 09:18:05 -0700 (PDT) Received: from usa.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B316C3F266; Fri, 29 Jun 2018 09:18:03 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org Subject: [PATCH] ACPI/PPTT: use ACPI ID whenever ACPI_PPTT_ACPI_PROCESSOR_ID_VALID is set Date: Fri, 29 Jun 2018 17:17:57 +0100 Message-Id: <1530289077-2444-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180629_091816_226822_92C5D2D5 X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-5.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.101.70 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J. Wysocki" , Andrew Jones , Lorenzo Pieralisi , shunyong.yang@hxt-semitech.com, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, Jeremy Linton , Sudeep Holla , yu.zheng@hxt-semitech.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Currently we use the ACPI processor ID only for the leaf/processor nodes as the specification states it must match the value of ACPI processor ID field in the processor’s entry in the MADT. However, if a PPTT structure represents processors group, it match a processor container UID in the namespace and ACPI_PPTT_ACPI_PROCESSOR_ID_VALID flag describe whether the ACPI processor ID is valid. Lets use UID whenever ACPI_PPTT_ACPI_PROCESSOR_ID_VALID is set to be consistent instead of using table offset as it's currently done for non leaf nodes. Cc: "Rafael J. Wysocki" Signed-off-by: Sudeep Holla Acked-by: Jeremy Linton --- drivers/acpi/pptt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) Hi, There's ongoing discussion on assigning ID based in OS using simple counters. It can never be consistent with firmware's view. So if the firmware provides valid UID for non-processors node, we must use it. Regards, Sudeep diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index e5ea1974d1e3..d1e26cb599bf 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -481,8 +481,14 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table, if (cpu_node) { cpu_node = acpi_find_processor_package_id(table, cpu_node, level, flag); - /* Only the first level has a guaranteed id */ - if (level == 0) + /* + * As per specification if the processor structure represents + * an actual processor, then ACPI processor ID must be valid. + * For processor containers ACPI_PPTT_ACPI_PROCESSOR_ID_VALID + * should be set if the UID is valid + */ + if (level == 0 || + cpu_node->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) return cpu_node->acpi_processor_id; return ACPI_PTR_DIFF(cpu_node, table); }