Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp312496pxx; Wed, 28 Oct 2020 05:40:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuYpxQkk+LE5pPlxO94eltTxo40ZesjIIMWibVB/4R9RUoUT3O8zZg6cH47qC0bFBLsxUL X-Received: by 2002:a17:906:bc98:: with SMTP id lv24mr7187011ejb.545.1603888851512; Wed, 28 Oct 2020 05:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603888851; cv=none; d=google.com; s=arc-20160816; b=yxvPkPmEn+2+lgYPXaBDrpVYJtmC87amWhLKuP/FaOfKbQvIM4fRcwStZ2D9ET8CCN /Z2YgMZ/uEeZDLN68XcnOLeTLtiw4vVJAUs+oWrg5EcS2Ta63oRZgtxEbLxpdyIu2hxF Yjf8GxVtqtA52SHlssxSfpM1LKjVe/FJBTxVdf6gQixX44KrZgnfr+MW0B8HqBnGcDJ8 6zLsxzm+Wih8qX8IFt3wNgI3ZncY4p30N80qfv0SaXzbz5u7w7LsfNAmVjdlEkVsJjwl 2qENYs8n2WZ46tliiiaQt2PjQnE3FBEyQlBF0ReUAyxmUtQtkpwGiNlwKV9R/gDHmE8r jffA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/yi7XVpMF09wWgfP3M3RMDoHBx5OCHbTWArNvQvSV6I=; b=gibmL1W1sA/ZCAf64ekAFQn22qfS+T5uJ+gXdGbaCcYI4TSOyksPTZggHNCFVJxuq+ gIUrbhvnZD6je0uk2F2WMtf0YKzvV38p2nBtYhOoO2QhC14zo72u7gPF+kSEDB4wbFji u6e/FQnQq5ormRDDpqwD0h2CgC1V3duJOG7TlcWBj5mPWyjxsT8mSiVgM7jjdi3okdLk cqoUp0gv15Lzsu9InJiaaG4pnMSN5kNxLVLb6WxYPxp3p++PYk+UVyYwVOVwlSgf0fxq Ffm632iNPwsMvmZMyPb/LlNnQ7pzz7NTdqP+TtV+m1u9oiQn+Wkw5CsZ+gcG7ZTnCpRw K/Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jiSkXMmx; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si2897729edy.300.2020.10.28.05.40.30; Wed, 28 Oct 2020 05:40:51 -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; dkim=pass header.i=@kernel.org header.s=default header.b=jiSkXMmx; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1797574AbgJ0PYW (ORCPT + 99 others); Tue, 27 Oct 2020 11:24:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:37622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1796875AbgJ0PWp (ORCPT ); Tue, 27 Oct 2020 11:22:45 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 94CB820728; Tue, 27 Oct 2020 15:22:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812164; bh=Kga7vEfZO3kPRLsus9Py7qIoN3l60BwB1lXwXne9Ku8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jiSkXMmxzT18/aWUcn2rg0J8LcbMfrshl2zWtmVFms9k90A3bIpyIiDchIfth7hBf eEd3GcZK9gVKJ5upNeKfgpVjKnaS3eB/ZnXdevqThtmVCrvTtg0sbf/Y5RoIqxH8ps loRscj8JC12HbKOD3YneAIS+xPtsoF79sJraM+Yo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kyle Meyer , Kan Liang , Alexander Antonov , "Peter Zijlstra (Intel)" , Alexei Budankov , Sasha Levin Subject: [PATCH 5.9 107/757] perf/x86/intel/uncore: Fix for iio mapping on Skylake Server Date: Tue, 27 Oct 2020 14:45:57 +0100 Message-Id: <20201027135455.571628328@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Antonov [ Upstream commit f797f05d917ffef94249ee0aec4c14a5b50517b2 ] 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 Signed-off-by: Alexander Antonov Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Alexei Budankov Reviewed-by: Kan Liang Link: https://lkml.kernel.org/r/20200928102133.61041-1-alexander.antonov@linux.intel.com Signed-off-by: Sasha Levin --- 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 62e88ad919ffc..ccfa1d6b6aa0d 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) -- 2.25.1