Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17927915ybl; Thu, 2 Jan 2020 15:00:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxDTokyYPhqASKLiWOKmKDhXasEnYlynwyrVYwPOfB1Mmpp4kK3kq7gtLxH+hwRQ42CCA9P X-Received: by 2002:a05:6830:1555:: with SMTP id l21mr88446035otp.41.1578006019653; Thu, 02 Jan 2020 15:00:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578006019; cv=none; d=google.com; s=arc-20160816; b=wat0WQVk2B6HLuriALNJ6PzTBHhuK6kLeqVVTA6OzNjRTX4OeaAFxLVM1zDO/eUaxS qMgUOqwsaxHzHqKZyF4j4xCVQWB3b5CRxxeZCoxhgyrKV+PCqW/JQ0vsGW25Dr5hpySo ZMQ/qa9kyJibYD8x2HGqyCsKMxFOZsqRxscp8SVlDVjdZZLfOOkX2AeSgfkZQ3M3PzAO m/ZHgt5PPXrCcBsU4V6GRBd4BRaCEY6pNzi+mfGUbHK8jOth0e2yl3PR/LCaseZPiNz9 tyqABxt0jmbdbYkFAeUTJgYlperOvvb45tUGzwmyYUX6z6nqlcNSHayOQ92aLUIfTb94 d/1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tB5WNtvfpZzT5w2ISgOC1TljTzQyFVqbIeb25fhMh/k=; b=wxQZMPZswonY6ES3kYpAYYZZrGE5sAx1u3XXZnYzoDRyqnm48t9hgySEsluvVrULr5 VrYrJqBgeafgTPbEPDFGog36c5EBf62Nd3fVGIunUYwZiKX44VzdJJmeTxzSWOjXn2TL NHrqQ8IjPLbaH8eDAiIAj5pxMb9kzq10WpMpocPRBTZ8wBt2ucrxSisyClJrT8xMzRke Yb4pyJBCBRX1FPryNux4L4xwTJudFcqiQDcA/IavkLb5Fmm46SnQDIi0pWB/6ZFxNkBv 47lPVqqx9UFXMH19MptKfb59dcrvkbPvPuBUkluO7bFtT9lriF3dVhgFLvurDaEFNsg9 9PiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AuMeN+0r; 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 i10si30456451otk.195.2020.01.02.15.00.07; Thu, 02 Jan 2020 15:00:19 -0800 (PST) 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=@kernel.org header.s=default header.b=AuMeN+0r; 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 S1727999AbgABWPB (ORCPT + 99 others); Thu, 2 Jan 2020 17:15:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:55474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727989AbgABWO5 (ORCPT ); Thu, 2 Jan 2020 17:14:57 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57DB8227BF; Thu, 2 Jan 2020 22:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003296; bh=kk9yOZTwuv8VYKJ05BvJm+gyiXuuNdCaC8RdEZ+r5Sw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AuMeN+0rAU5tkdPvfkjiaUPViYF5Qgqb6h8zrV4QST2X7pY5mAfmJBL81A5HcCO57 5MNs5sh8KgIO62KjNFd7QRE7oO/mX/7pb/mbNlcSxyuXRB5XWiqRWKv3O6tIv+gFzn 23x+5Penk5M3Lgc6sEPCt1N6JNq689k5XuYl/1XE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Pandruvada , Andy Shevchenko , Sasha Levin Subject: [PATCH 5.4 102/191] tools/power/x86/intel-speed-select: Ignore missing config level Date: Thu, 2 Jan 2020 23:06:24 +0100 Message-Id: <20200102215840.854346558@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Pandruvada [ Upstream commit 20183ccd3e4d01d23b0a01fe9f3ee73fbae312fa ] It is possible that certain config levels are not available, even if the max level includes the level. There can be missing levels in some platforms. So ignore the level when called for information dump for all levels and fail if specifically ask for the missing level. Here the changes is to continue reading information about other levels even if we fail to get information for the current level. But use the "processed" flag to indicate the failure. When the "processed" flag is not set, don't dump information about that level. Signed-off-by: Srinivas Pandruvada Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin --- tools/power/x86/intel-speed-select/isst-core.c | 8 ++++---- tools/power/x86/intel-speed-select/isst-display.c | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/power/x86/intel-speed-select/isst-core.c b/tools/power/x86/intel-speed-select/isst-core.c index 6dee5332c9d3..fde3f9cefc6d 100644 --- a/tools/power/x86/intel-speed-select/isst-core.c +++ b/tools/power/x86/intel-speed-select/isst-core.c @@ -553,7 +553,6 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev) i); ctdp_level = &pkg_dev->ctdp_level[i]; - ctdp_level->processed = 1; ctdp_level->level = i; ctdp_level->control_cpu = cpu; ctdp_level->pkg_id = get_physical_package_id(cpu); @@ -561,7 +560,10 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev) ret = isst_get_ctdp_control(cpu, i, ctdp_level); if (ret) - return ret; + continue; + + pkg_dev->processed = 1; + ctdp_level->processed = 1; ret = isst_get_tdp_info(cpu, i, ctdp_level); if (ret) @@ -614,8 +616,6 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev) } } - pkg_dev->processed = 1; - return 0; } diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c index 40346d534f78..b11575c3e886 100644 --- a/tools/power/x86/intel-speed-select/isst-display.c +++ b/tools/power/x86/intel-speed-select/isst-display.c @@ -314,7 +314,8 @@ void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level, char value[256]; int i, base_level = 1; - print_package_info(cpu, outf); + if (pkg_dev->processed) + print_package_info(cpu, outf); for (i = 0; i <= pkg_dev->levels; ++i) { struct isst_pkg_ctdp_level_info *ctdp_level; -- 2.20.1