Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4481056imm; Tue, 11 Sep 2018 12:35:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaLn4aH6FzfdhBz2xM84BeY8UGiNQeGaSla9OiLUjF3wzaKRFYZZEiBdHFNstMWHqQw8eKQ X-Received: by 2002:a62:444d:: with SMTP id r74-v6mr31031761pfa.96.1536694511170; Tue, 11 Sep 2018 12:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536694511; cv=none; d=google.com; s=arc-20160816; b=wBun24VjJsJxDn4BdELLiac2WpNtekFeIO59ayNvt16D8wvPnNXs/8rLK+jOXx6Ps6 rXyH3be9XgIZ722uC+ExyGiHAnU2l21zRU5chpPVx0JRrGRRtVuqNXyYPeBGi9WliIvZ Hnv77fXDElsYeH48aC+hkxlMZphjgAnVznyHpLFq2qgxYgi8WqJ2MYttgVCyg8ff5Xs0 fK0ub0PxsXWN3e2tmmbdQtdvmadK7qCgxDsLjMV92r1ODDSRDq+sTXvFNzL8cY3O76u9 QeFV00Dthks3CxegckJ514xGxYkf8+Nx2Sib+Rfnt01aY6i35mcf6nxzhn8yUbw8+ocX 4AXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=Pp1zdyQ2fRcQpWdnLtnBf8coIo6O/F2j8sTh9B/0Xss=; b=UMMX8Fdb0jjcwnDKL+WU+YWszVHvYrYgi+dQpoaaExn7QhvjDVeZVEDe+KUt+WjdaT GT8UFff8VXJLW+0Tzqxb/UUeg9cHlIi57/c3eSXu1ekunslt+sz7MouKQ4NlIkUWTBVt UvNMOz8SpcB68qBQWYfn3h+9LfkWbpqyMacE9r/Oj6Gv2YA8u9g1Qwqyz0e3eXHPkc4Y kMp1+2r9ogQiS188DMupjyD7qWU53ZsJurecAMLIdrSC8+q60Y4p8MWCKtWj3ASZ7L9B drrY/T6QxGlqoAyZfxQdCdNHGA0uIWDIELXZ9uAbde0MRuDSEW4G/LSAot/Xf/csZznf f0kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=nqujDIUu; dkim=pass header.i=@codeaurora.org header.s=default header.b=o8pB3392; 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 34-v6si20559748plm.205.2018.09.11.12.34.55; Tue, 11 Sep 2018 12:35:11 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=nqujDIUu; dkim=pass header.i=@codeaurora.org header.s=default header.b=o8pB3392; 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 S1728004AbeILAd1 (ORCPT + 99 others); Tue, 11 Sep 2018 20:33:27 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53244 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbeILAd0 (ORCPT ); Tue, 11 Sep 2018 20:33:26 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 40FA8607C6; Tue, 11 Sep 2018 19:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536694358; bh=iN843eDPY2wSQrCsjtacWkwVYAC3Eh44Pu1soY5v+V4=; h=From:To:Cc:Subject:Date:From; b=nqujDIUu/5XewpNInHKiwqqpI3ReginRBupVJQHo6GrmO14rnS3laYL0Ec92jfxgg GXVHRD1ILs/xbgNe0OB/xBj7UkF01et3qBbysQIPgd6ypQ45yBn2z+3CVGWTwU+yeX nuLTDaZAsEVu2XRJ09Or2rT9FQcCcGi8cae+yKg8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from jhugo-perf-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1A18760721; Tue, 11 Sep 2018 19:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536694357; bh=iN843eDPY2wSQrCsjtacWkwVYAC3Eh44Pu1soY5v+V4=; h=From:To:Cc:Subject:Date:From; b=o8pB3392Mep5g4NYLO6X/vE7EBSg84k5RvQ7IVXpVmbzNm6zoxF8w1D7CFgQb3DI1 i6KPX8hnXp8eCdGGzYPlQ2lWyi87SMQNTMYEX0AzCQEWhAgCwJTzh9b00b7ard/oqg 403NIIRyUasnmMiOUrEz0FLUfvbzPeaj4470B85A= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1A18760721 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jhugo@codeaurora.org From: Jeffrey Hugo To: rjw@rjwysocki.net, linux-acpi@vger.kernel.org, jeremy.linton@arm.com Cc: linux-kernel@vger.kernel.org, vkilari@codeaurora.org, Jeffrey Hugo Subject: [PATCH] ACPI/PPTT: Handle architecturally unknown cache types Date: Tue, 11 Sep 2018 13:32:14 -0600 Message-Id: <1536694334-5811-1-git-send-email-jhugo@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The type of a cache might not be specified by architectural mechanisms (ie system registers), but its type might be specified in the PPTT. In this case, following the PPTT specification, we should identify the cache as the type specified by PPTT. This fixes the following lscpu issue where only the cache type sysfs file is missing which results in no output providing a poor user experience in the above system configuration- lscpu: cannot open /sys/devices/system/cpu/cpu0/cache/index3/type: No such file or directory Fixes: 2bd00bcd73e5 (ACPI/PPTT: Add Processor Properties Topology Table parsing) Reported-by: Vijaya Kumar K Signed-off-by: Jeffrey Hugo --- drivers/acpi/pptt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index d1e26cb..3c6db09 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -401,6 +401,21 @@ static void update_cache_properties(struct cacheinfo *this_leaf, break; } } + if ((this_leaf->type == CACHE_TYPE_NOCACHE) && + (found_cache->flags & ACPI_PPTT_CACHE_TYPE_VALID)) { + switch (found_cache->attributes & ACPI_PPTT_MASK_CACHE_TYPE) { + case ACPI_PPTT_CACHE_TYPE_DATA: + this_leaf->type = CACHE_TYPE_DATA; + break; + case ACPI_PPTT_CACHE_TYPE_INSTR: + this_leaf->type = CACHE_TYPE_INST; + break; + case ACPI_PPTT_CACHE_TYPE_UNIFIED: + case ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT: + this_leaf->type = CACHE_TYPE_UNIFIED; + break; + } + } /* * If the above flags are valid, and the cache type is NOCACHE * update the cache type as well. -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.