From patchwork Tue Sep 11 19:32:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffrey Hugo X-Patchwork-Id: 10596223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E73B13E9D for ; Tue, 11 Sep 2018 19:32:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB87629D31 for ; Tue, 11 Sep 2018 19:32:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF7BB29D5B; Tue, 11 Sep 2018 19:32:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CE7A29D31 for ; Tue, 11 Sep 2018 19:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726743AbeILAd0 (ORCPT ); Tue, 11 Sep 2018 20:33:26 -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= 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-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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.