Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2905732pxk; Mon, 28 Sep 2020 03:26:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaXO7SUIS7WJEfKStYzMSxobbsCddRf9CvEqiej9myoVhBkQgCxnM6feUTy2QhZAvZKHzY X-Received: by 2002:a17:906:b053:: with SMTP id bj19mr907910ejb.146.1601288766719; Mon, 28 Sep 2020 03:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601288766; cv=none; d=google.com; s=arc-20160816; b=0A4P4xjASysGqYFrYwKn5lcxpwy2b+XHLUD81lWe6ypzUj9V7EppjdibNIZvFpTeNe xNIUBbuCRYeI6TdYBofv9XO49vsjJDzDqGndJM/bbSmjea9RREYBkkLRNn6juGPFRbJY XWOf74Bjtqusgp/LGdbmtkoqLVBykiKZ0nB4P3ppfVsJlXaRPWnMubuHY3DbgSwDENGH YVuZv3CiAoyvEQPZTmfZgqm4ueYfQB8ATr8O1gHWDJx+HytR8A2NtlJrhhm5eJHOlEZo I0xUz2xtPKUZVo1350j+TYZK+oqpWarW02JrpeX6iEapi2E/f4P6LWiTh6gDHQmlzC2P ak/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=fEW2H4IjHepwg0inU1RUGlvFvr1yBPpHuTUCQMf446M=; b=ChfeGvaSxIAFyWeTZfzo7jC8Y+66A5+pnqnf5ZdH3OpyH8pKOz675yWzS+gl2vjsFR czreF+eXkYgDlWlknkHY7y9hdgKCf94IarZT+PK2c2a4y+whOyzoebbUk7NaPODAPLaq Xhxp/pkM9qX3YRcUajMFyo3Zv86qAbSysajk2mZuQwRpM30Dn5hdFJnRkv+Amg6wIVL5 wxWyn3F+q2XbOOWl6lwgFMCgCckmMW+NcGRwJRBWyRoiUVa+iXCZFCKpxEoFFFGK1ydJ 1/63tOwgsKdd4P1eqGMY1ldizWOi2JRSq9u/mogJOUcCNddQYMahKeais4rzkBqLDJqs /cig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si354761ejj.237.2020.09.28.03.25.43; Mon, 28 Sep 2020 03:26:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbgI1KVj (ORCPT + 99 others); Mon, 28 Sep 2020 06:21:39 -0400 Received: from mga04.intel.com ([192.55.52.120]:22496 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726565AbgI1KVi (ORCPT ); Mon, 28 Sep 2020 06:21:38 -0400 IronPort-SDR: mEb6xMHiTdlQDExpKlPS3ceolmM7r/s5hJ7RMWQOTp/v8FA1vXYVrO/O5+SRQ70bOOZQEIo//i +5MGwvFac3lQ== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="159351029" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="159351029" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 03:21:38 -0700 IronPort-SDR: 6Gu2ZVPTI0r/8o7SDpYDBe9cF637XDsOJQaAS/U6JcMswPij9ndIyeE4MGGxLmsveVoNWpcsrt lhNqNvQsp4Hw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="456769086" Received: from nntpdsd52-183.inn.intel.com ([10.125.52.183]) by orsmga004.jf.intel.com with ESMTP; 28 Sep 2020 03:21:34 -0700 From: alexander.antonov@linux.intel.com To: peterz@infradead.org, linux-kernel@vger.kernel.org, x86@kernel.org Cc: alexander.shishkin@linux.intel.com, kan.liang@linux.intel.com, alexey.budankov@linux.intel.com, ak@linux.intel.com, acme@kernel.org, mingo@redhat.com, alexander.antonov@linux.intel.com, kyle.meyer@hpe.com, rja@hpe.com Subject: [PATCH] perf/x86/intel/uncore: Fix for iio mapping on Skylake Server Date: Mon, 28 Sep 2020 13:21:33 +0300 Message-Id: <20200928102133.61041-1-alexander.antonov@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Antonov Introduced early attributes /sys/devices/uncore_iio_/die* are initialized by skx_iio_set_mapping(), however, for example, for multiple segment platforms skx_iio_get_topology() returns -EPERM before a list of attributes in skx_iio_mapping_group will have been initialized. As a result the list is being NULL. Thus the warning "sysfs: (bin_)attrs not set by subsystem for group: uncore_iio_*/" appears and uncore_iio pmus are not available in sysfs. Clear IIO attr_update to properly handle the cases when topology information cannot be retrieved. Fixes: bb42b3d39781 ("perf/x86/intel/uncore: Expose an Uncore unit to IIO PMON mapping") Reported-by: Kyle Meyer Suggested-by: Kan Liang Reviewed-by: Alexei Budankov Reviewed-by: Kan Liang Signed-off-by: Alexander Antonov --- arch/x86/events/intel/uncore_snbep.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index 62e88ad919ff..ccfa1d6b6aa0 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -3749,7 +3749,9 @@ static int skx_iio_set_mapping(struct intel_uncore_type *type) ret = skx_iio_get_topology(type); if (ret) - return ret; + goto clear_attr_update; + + ret = -ENOMEM; /* One more for NULL. */ attrs = kcalloc((uncore_max_dies() + 1), sizeof(*attrs), GFP_KERNEL); @@ -3781,8 +3783,9 @@ static int skx_iio_set_mapping(struct intel_uncore_type *type) kfree(eas); kfree(attrs); kfree(type->topology); +clear_attr_update: type->attr_update = NULL; - return -ENOMEM; + return ret; } static void skx_iio_cleanup_mapping(struct intel_uncore_type *type) base-commit: a1b8638ba1320e6684aa98233c15255eb803fac7 -- 2.19.1