Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8767289rwb; Thu, 24 Nov 2022 04:08:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf66xdKF2nAGabONK9Jkgc8o/jA8M89BVXZdCuci8Ljwpv5TgpLD3TjFCLjashN8b0+PUqfs X-Received: by 2002:aa7:c841:0:b0:45d:2a5:2db8 with SMTP id g1-20020aa7c841000000b0045d02a52db8mr14696649edt.105.1669291714989; Thu, 24 Nov 2022 04:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669291714; cv=none; d=google.com; s=arc-20160816; b=H7cWFyVpGA27JCDT1LrFS+d6IUIvHCj9w+EH/02+2Rx/0QfBRjPp31ddG38+eIPYgi PbrVJ/wE10I3X2C6g8IfVPQfCw/Md2fAHCID7kJOctY/G9/u2AUzmgreeX9slR6ZRv2P eCHf9PyONx2Nclo7uQc/1XocLzy5awLYMRrHe8U0QxzPkWUqp+9yzUqZAIO9RayYgcw9 YzscS7PYhlTB1F5M8AMf9tN+mS1c7yT5L9py1VHxTfREcvXPKorBOpcAGb9hG+b7gHyC XE1QOMxkDQxCamAUmUd3830kVvYxHnMKVmzYTsvW2CN69Srf2RO3uxaH1L3OyvT0cKYH A2Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=kUHiE8a+1lv9ytkeBFtI2aUbZ3z2LKhBsO12Nwyan9Q=; b=G4TPPkNYuwuMxmBqk3Kaax8Zs7DLoa24QSBmq7dGT0RARBSjnBoiyTFgb5yIu9tRWR v5rjgz7jZVuhBHGN7UXG/O+khd70Ec32iiCA81DOJC5DUPh/tT4pnOEEwQmXIdpJV5pH trQrLbR1Njy4+NC4jAXyRtEqWn6YHiter6U2imLDKH15fuLB2a+EOq2SiiEUr3Rh2Jq0 aqqEgRhUMIKQmm64vCkq7VgouVmFsvodkTDJjEL9aC4ndyftGoSIH/9dHqiqutN1W6Mz Uw686aVbtLwOdvKFzrulBhBCf3v60NFmGIuiY22e01zmk5eAzBw6k1YCqELPRXs52ef+ 0k3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=r3NfTtOq; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz6-20020a1709072ce600b007ae127c6c80si793141ejc.672.2022.11.24.04.08.13; Thu, 24 Nov 2022 04:08:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=r3NfTtOq; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbiKXMDf (ORCPT + 86 others); Thu, 24 Nov 2022 07:03:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbiKXMDK (ORCPT ); Thu, 24 Nov 2022 07:03:10 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9F31391DB; Thu, 24 Nov 2022 04:03:01 -0800 (PST) Date: Thu, 24 Nov 2022 12:02:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669291380; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kUHiE8a+1lv9ytkeBFtI2aUbZ3z2LKhBsO12Nwyan9Q=; b=r3NfTtOqmCXc4Y7bkMQpx1kmVoPkrKkokfBjw3TlL3WuTrD3GsUC/jjHevU0Xyg92s9Bvz JAfQWHiZI10gAwN85rqJYxE4nMTiQJSgt7Q7EGhovHt7H1P2M3kH3TUJKiaFxtJii8U8fp CgHAxMocDTR9mShrN3VKAK55+Xtti3LQ64bIJwJLDwI6UXmgDtWy3mE5tG/hkd/HYS/vv2 yNWFMwc09tWFSTkK3MGMfvvTB2QeaSvA7CmCbMp+3tViAC771FiYeoAtIBkKZA6Cg5n4Bc 2UQ2Fpq4WeBq+cHwNFPfBgxhzyNmqLWl1yA7/YLzrDLV/c2HOSIIVVTu2l/q4Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669291380; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kUHiE8a+1lv9ytkeBFtI2aUbZ3z2LKhBsO12Nwyan9Q=; b=I5d7HIU/BshIv/S0ThgDs2ffH1DA83Plz2harpRmDTuIy6wGTO95dAI2moxj7QDsXhZlHi fGhS/lvaRAEOtNCg== From: "tip-bot2 for Alexander Antonov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/intel/uncore: Clear attr_update properly Cc: Alexander Antonov , "Peter Zijlstra (Intel)" , Kan Liang , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221117122833.3103580-4-alexander.antonov@linux.intel.com> References: <20221117122833.3103580-4-alexander.antonov@linux.intel.com> MIME-Version: 1.0 Message-ID: <166929137917.4906.3753361587804959232.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 6532783310e2b2f50dc13f46c49aa6546cb6e7a3 Gitweb: https://git.kernel.org/tip/6532783310e2b2f50dc13f46c49aa6546cb6e7a3 Author: Alexander Antonov AuthorDate: Thu, 17 Nov 2022 12:28:25 Committer: Peter Zijlstra CommitterDate: Thu, 24 Nov 2022 11:09:20 +01:00 perf/x86/intel/uncore: Clear attr_update properly Current clear_attr_update procedure in pmu_set_mapping() sets attr_update field in NULL that is not correct because intel_uncore_type pmu types can contain several groups in attr_update field. For example, SPR platform already has uncore_alias_group to update and then UPI topology group will be added in next patches. Fix current behavior and clear attr_update group related to mapping only. Fixes: bb42b3d39781 ("perf/x86/intel/uncore: Expose an Uncore unit to IIO PMON mapping") Signed-off-by: Alexander Antonov Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221117122833.3103580-4-alexander.antonov@linux.intel.com --- arch/x86/events/intel/uncore_snbep.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index d3323f1..0d06b56 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -3872,6 +3872,21 @@ static const struct attribute_group *skx_iio_attr_update[] = { NULL, }; +static void pmu_clear_mapping_attr(const struct attribute_group **groups, + struct attribute_group *ag) +{ + int i; + + for (i = 0; groups[i]; i++) { + if (groups[i] == ag) { + for (i++; groups[i]; i++) + groups[i - 1] = groups[i]; + groups[i - 1] = NULL; + break; + } + } +} + static int pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag, ssize_t (*show)(struct device*, struct device_attribute*, char*), @@ -3926,7 +3941,7 @@ clear_attrs: clear_topology: pmu_free_topology(type); clear_attr_update: - type->attr_update = NULL; + pmu_clear_mapping_attr(type->attr_update, ag); return ret; }