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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2A4CAC433EF for ; Thu, 16 Dec 2021 23:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CgYstoHbWse2h4ysq0cg9eQGe+f6AnvUF+l35z9WQ+I=; b=KY8So/VDyaj/ZU EuuJxcdC3qz8LiV9hU6hqklbj2D7yUSFA+z8yDNHaUMhGF2pGNa0a8FtZ2X4STyT3Y2tUGlNiJ/Ut p72tFhCcdG7uBvK6/B5o40Kq5LGnz9IfYzXrcuRkbGg7V2JbTF2xjeJkl7gCOLtkCuLdTAWT7T/3M hnouRq1LLjkeVTY22MhyYeeipVCKLmGQegQxbkFn3QFfxCYsPMFLkqzxlGIsvV0TUSg3Z4L06/w9K 3ez8KzJ7j6q6EyilUonUap34jDUXooNYx+XNHUObRxaqE2n/awwBC1sxw4aaxGBMbcq7xvDRiifqd KBhj5x3K+FE6YLW5wBHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1my0EP-007wTL-Qh; Thu, 16 Dec 2021 23:32:14 +0000 Received: from mail-oi1-f180.google.com ([209.85.167.180]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1my0Dl-007wI6-9q for linux-arm-kernel@lists.infradead.org; Thu, 16 Dec 2021 23:31:34 +0000 Received: by mail-oi1-f180.google.com with SMTP id m6so1171675oim.2 for ; Thu, 16 Dec 2021 15:31:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fStO5BsDAphXFibF4lRjLZT7FGTV609d5dBo3Se1e80=; b=UXQpsjFG3GXm5JDbIa0G7UuzrB2kfDUgQ71/hQevgmeBUok3P+ZlEA3xFKpBkrukM5 1Lu+JW7iarbuNEf9toXaxiSunqvMRc9V4UcunQJOBRE+j8lGO7nJoFPQ/3BtpzahC+5e FR+j/L4FPTa3uhc4wA8jJFQxwXZR13aTSFLouisOcSug+IyPWAUvPkm5Vxs/9zgVKsDJ 6Y6povOgBO3ROpgKSGXNCSYnup6MEawZOrUbKj6vqgYUftUnv2EVGiIA3Vv/V7/7b42d +UGo8ILciXBpfPzMZ2C6GkjM9XxDBgvecwMKzTPCXn70vaafSbgSyzOuG5hIqKM+j61Z RZ0w== X-Gm-Message-State: AOAM532OElWxxR/X/SU3aXsF1qF3tBJ62zHni3mZg4qRn04m4p/im2eX j4mnhmy6Z0UiBhM7dU1wqQNBJhfmyw== X-Google-Smtp-Source: ABdhPJx/pvFlJR8Gy0p3sOQ+0qXrZMYTlyfTf5U3XrIIVBVC1Am5JLBvV/CdZf5UED59JsXXYVeuaw== X-Received: by 2002:aca:120f:: with SMTP id 15mr154257ois.132.1639697492411; Thu, 16 Dec 2021 15:31:32 -0800 (PST) Received: from xps15.herring.priv (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.googlemail.com with ESMTPSA id n11sm1256646oor.9.2021.12.16.15.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Dec 2021 15:31:31 -0800 (PST) From: Rob Herring To: Greg Kroah-Hartman , James Morse , Jeremy Linton Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , "Rafael J. Wysocki" , Len Brown , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH 4/6] ACPI / PPTT: Populate the cacheinfo.cpu_affinity_map Date: Thu, 16 Dec 2021 17:31:23 -0600 Message-Id: <20211216233125.1130793-5-robh@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211216233125.1130793-1-robh@kernel.org> References: <20211216233125.1130793-1-robh@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211216_153133_369572_C7524061 X-CRM114-Status: GOOD ( 13.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The cacheinfo.cpu_affinity_map was added to list the possible CPUs a cache is associated with. Populate the cpu_affinity_map when parsing the ACPI PPTT for cacheinfo. With this, the cache CPU affinities are represented in the same way for DT and ACPI. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Signed-off-by: Rob Herring --- drivers/acpi/pptt.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index 701f61c01359..686018f4e7ed 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -418,6 +418,30 @@ static void update_cache_properties(struct cacheinfo *this_leaf, } } +static void acpi_set_cache_cpumask(struct acpi_table_header *table, + struct cacheinfo *this_leaf, + struct acpi_pptt_processor *match_cpu_node) +{ + int cpu; + + /* + * If we found the cache first, we'd still need to walk from each cpu. + */ + for_each_possible_cpu(cpu) { + u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu); + struct acpi_pptt_processor *cpu_node; + struct acpi_pptt_cache *cache; + + cache = acpi_find_cache_node(table, acpi_cpu_id, + this_leaf->type, + this_leaf->level, &cpu_node); + if (!cache || cpu_node != match_cpu_node) + continue; + + cpumask_set_cpu(cpu, &this_leaf->cpu_affinity_map); + } +} + static void cache_setup_acpi_cpu(struct acpi_table_header *table, unsigned int cpu) { @@ -435,10 +459,11 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table, this_leaf->level, &cpu_node); pr_debug("found = %p %p\n", found_cache, cpu_node); - if (found_cache) + if (found_cache) { update_cache_properties(this_leaf, found_cache, cpu_node, table->revision); - + acpi_set_cache_cpumask(table, this_leaf, cpu_node); + } index++; } } -- 2.32.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel