From patchwork Mon Nov 4 21:35:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 13862128 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03933D1BDFA for ; Mon, 4 Nov 2024 21:35:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3940D10E4E2; Mon, 4 Nov 2024 21:35:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="OJUumKW/"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 76A1210E4DC for ; Mon, 4 Nov 2024 21:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730756135; x=1762292135; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=w5SktQyGKbBe8qPKvgzsxLWrebJygdTFb7XRNX/il1k=; b=OJUumKW/oskFywznLGz1rYbAK7XsJ9dNf4pWORxOZ/TNJ47W2yUNfBEn q1W6f/iL+VG7oxdr2FwFU3e0A17gcLPVfWx3EcplpL2Ya7n0Xt5u996Wc 0bSqnKopXJPjoAvmkIlYTR/GSy7h6ycQvrwBg0BIQ1jOGHKAXuUUZMnpf c8w6TTG4K+afg8Zl+i1lEhsYV9t2irlwfIyEeU8xhQuEfyTBRyVJpSz7B S07fZBPQxGZc2wxtQqw+BWS2Wp6X9aM84jFVT9LsPwYNs+qH2G5StBbg2 ENgJ0h3eBtgcH443qdy9wQVEiSsZLa55ttAvyoSSGZUVS8OHVIWL+hDjm w==; X-CSE-ConnectionGUID: ZlYMYjpURzqR6BW/Hg8GVg== X-CSE-MsgGUID: +kU8xSaHStmSv8IDEmpnBQ== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30420299" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30420299" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 13:35:35 -0800 X-CSE-ConnectionGUID: X4VnAC+/ROeHdASvf/faJA== X-CSE-MsgGUID: Nv7U7RFxQGaedfmzcGmlrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,258,1725346800"; d="scan'208";a="114562843" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 13:35:35 -0800 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 1/4] drm/i915/pmu: Rename cpuhp_slot to cpuhp_state Date: Mon, 4 Nov 2024 13:35:09 -0800 Message-ID: <20241104213512.2314930-2-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104213512.2314930-1-lucas.demarchi@intel.com> References: <20241104213512.2314930-1-lucas.demarchi@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Both the documentation and most of other users call the return of cpuhp_setup_state_multi() as "state". Follow that. Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/i915_pmu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 93fbf53578da2..8706957ddc0a3 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -1218,7 +1218,7 @@ static int i915_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node) return 0; } -static enum cpuhp_state cpuhp_slot = CPUHP_INVALID; +static enum cpuhp_state cpuhp_state = CPUHP_INVALID; int i915_pmu_init(void) { @@ -1232,28 +1232,28 @@ int i915_pmu_init(void) pr_notice("Failed to setup cpuhp state for i915 PMU! (%d)\n", ret); else - cpuhp_slot = ret; + cpuhp_state = ret; return 0; } void i915_pmu_exit(void) { - if (cpuhp_slot != CPUHP_INVALID) - cpuhp_remove_multi_state(cpuhp_slot); + if (cpuhp_state != CPUHP_INVALID) + cpuhp_remove_multi_state(cpuhp_state); } static int i915_pmu_register_cpuhp_state(struct i915_pmu *pmu) { - if (cpuhp_slot == CPUHP_INVALID) + if (cpuhp_state == CPUHP_INVALID) return -EINVAL; - return cpuhp_state_add_instance(cpuhp_slot, &pmu->cpuhp.node); + return cpuhp_state_add_instance(cpuhp_state, &pmu->cpuhp.node); } static void i915_pmu_unregister_cpuhp_state(struct i915_pmu *pmu) { - cpuhp_state_remove_instance(cpuhp_slot, &pmu->cpuhp.node); + cpuhp_state_remove_instance(cpuhp_state, &pmu->cpuhp.node); } void i915_pmu_register(struct drm_i915_private *i915) From patchwork Mon Nov 4 21:35:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 13862124 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F326D1BDF6 for ; Mon, 4 Nov 2024 21:35:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A924F10E4DC; Mon, 4 Nov 2024 21:35:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="MGH33f0n"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 83E0A10E4DD for ; Mon, 4 Nov 2024 21:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730756135; x=1762292135; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=XUIgoSvjIy3+XdnESvJsWCoK2mzXfzrmQfRc7QpS9M4=; b=MGH33f0n37hKso7cjVWCBsY4FqnFvNXTVO7APGCTcJg72XpUEsvGMi/s UgH3gqh7+an5iKqsht64fs9i74zENTAy3UCCBf98sB5NZEhStwD4QwYw4 5KjDpJcGToM0R3ntuDDWt73mMRdEi930Eax2uXLeLQzM6/D5Zq0/pwIpx BwUnXz6SGyoSDLkG5RVBNpRN15kTnqF1lh5KrsfY9csE3qUHqUfoyu9xz prWMXAPfO2mXnOGTyTg4k65Oc5a4KSsHZki8lsGD+764h32Ms47F3173l ePWhsg11ST2aE04enUHPflj7pR6sN++4r6MJNCTqURlHxGlnzD0i0d8++ A==; X-CSE-ConnectionGUID: KUB2st5lSyCbc2Kw2ALsUg== X-CSE-MsgGUID: 7pDTHExsRxmLoTsnNQO9ZA== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30420300" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30420300" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 13:35:35 -0800 X-CSE-ConnectionGUID: dJk0E3GvTQiboIs2ZVaaVA== X-CSE-MsgGUID: yk8oR1h5Q8e2CyNW9uUqSQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,258,1725346800"; d="scan'208";a="114562846" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 13:35:35 -0800 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/4] drm/i915/pmu: Stop setting event_init to NULL Date: Mon, 4 Nov 2024 13:35:10 -0800 Message-ID: <20241104213512.2314930-3-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104213512.2314930-1-lucas.demarchi@intel.com> References: <20241104213512.2314930-1-lucas.demarchi@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Setting event_init to NULL is mostly done to detect when the driver is partially working: i915 probed, but pmu is not registered. However, checking for event_init is odd as it was supposed to always be set and kernel/events/ would just crash if it found it set to NULL. Since there's already a "closed" boolean, use that instead and extend it's meaning to unregistered/unregistering. Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/i915_pmu.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 8706957ddc0a3..86faa5705fd8f 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -302,7 +302,7 @@ void i915_pmu_gt_parked(struct intel_gt *gt) { struct i915_pmu *pmu = >->i915->pmu; - if (!pmu->base.event_init) + if (pmu->closed) return; spin_lock_irq(&pmu->lock); @@ -324,7 +324,7 @@ void i915_pmu_gt_unparked(struct intel_gt *gt) { struct i915_pmu *pmu = >->i915->pmu; - if (!pmu->base.event_init) + if (pmu->closed) return; spin_lock_irq(&pmu->lock); @@ -1177,8 +1177,6 @@ static int i915_pmu_cpu_online(unsigned int cpu, struct hlist_node *node) { struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), cpuhp.node); - GEM_BUG_ON(!pmu->base.event_init); - /* Select the first online CPU as a designated reader. */ if (cpumask_empty(&i915_pmu_cpumask)) cpumask_set_cpu(cpu, &i915_pmu_cpumask); @@ -1191,8 +1189,6 @@ static int i915_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node) struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), cpuhp.node); unsigned int target = i915_pmu_target_cpu; - GEM_BUG_ON(!pmu->base.event_init); - /* * Unregistering an instance generates a CPU offline event which we must * ignore to avoid incorrectly modifying the shared i915_pmu_cpumask. @@ -1265,9 +1261,10 @@ void i915_pmu_register(struct drm_i915_private *i915) &i915_pmu_cpumask_attr_group, NULL }; - int ret = -ENOMEM; + pmu->closed = true; + spin_lock_init(&pmu->lock); hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); pmu->timer.function = i915_sample; @@ -1316,6 +1313,8 @@ void i915_pmu_register(struct drm_i915_private *i915) if (ret) goto err_unreg; + pmu->closed = false; + return; err_unreg: @@ -1323,7 +1322,6 @@ void i915_pmu_register(struct drm_i915_private *i915) err_groups: kfree(pmu->base.attr_groups); err_attr: - pmu->base.event_init = NULL; free_event_attributes(pmu); err_name: if (IS_DGFX(i915)) @@ -1336,9 +1334,6 @@ void i915_pmu_unregister(struct drm_i915_private *i915) { struct i915_pmu *pmu = &i915->pmu; - if (!pmu->base.event_init) - return; - /* * "Disconnect" the PMU callbacks - since all are atomic synchronize_rcu * ensures all currently executing ones will have exited before we @@ -1352,7 +1347,6 @@ void i915_pmu_unregister(struct drm_i915_private *i915) i915_pmu_unregister_cpuhp_state(pmu); perf_pmu_unregister(&pmu->base); - pmu->base.event_init = NULL; kfree(pmu->base.attr_groups); if (IS_DGFX(i915)) kfree(pmu->name); From patchwork Mon Nov 4 21:35:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 13862125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4105D1BDF7 for ; Mon, 4 Nov 2024 21:35:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE61310E4DD; Mon, 4 Nov 2024 21:35:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="g9Rt+FK/"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9105B10E4D9 for ; Mon, 4 Nov 2024 21:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730756135; x=1762292135; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=qVxRXDEhXme3sc4CeOvbJPkfZjHF7bv3YJ4Jq6IKdCA=; b=g9Rt+FK/+madPHycz2FZUYsxC41y60edKsLQxw2fEBIMo0fcLb1bUyHq U259JLA2KP5Ka/fFauyZu+qORm5x9LkZNizwJvJlbkrRB3iiMRQoKdGHP DVRiUZ/j1+NN4RgqLMX3w52mwL8bxYulM/7yOYdoq0Axj0a2n+nw1qBhz 6eSuCn1XRHFKUu/V5OrvwhiAH78wY7lbSP/x/BC5O0gVUMloXcY/K6uPT ehoIWjuI+aCYqlAgxzovZkM9Q+BaECXWrNV2GtZ9yF5y4wehzUd9RDbzu JjNvD9zcyizkqm4e2x/y0ZpaJbZb4M3EyBAEHtEbKhsHupEL122vPqVZo Q==; X-CSE-ConnectionGUID: fyAE9GugT32gWQWpfvV6Eg== X-CSE-MsgGUID: 5lSKEkcKRe6nH6bybrSGkw== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30420301" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30420301" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 13:35:35 -0800 X-CSE-ConnectionGUID: DAVgaMlVQoCB5n3u87qqiw== X-CSE-MsgGUID: ZIax6oV3RF6Wi57hKUTxHQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,258,1725346800"; d="scan'208";a="114562850" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 13:35:35 -0800 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 3/4] drm/i915/pmu: Replace closed with registered Date: Mon, 4 Nov 2024 13:35:11 -0800 Message-ID: <20241104213512.2314930-4-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104213512.2314930-1-lucas.demarchi@intel.com> References: <20241104213512.2314930-1-lucas.demarchi@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Since i915 calls perf_pmu_register/perf_pmu_unregister, let's call the variable "registered" so we can flip the logic and rely on it being false by default. Looking at other drivers, it's also more common. Examples: arch/x86/events/intel/uncore.c and drivers/powercap/intel_rapl_common.c. Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/i915_pmu.c | 25 +++++++++++++------------ drivers/gpu/drm/i915/i915_pmu.h | 4 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 86faa5705fd8f..bd476297ed0a1 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -302,7 +302,7 @@ void i915_pmu_gt_parked(struct intel_gt *gt) { struct i915_pmu *pmu = >->i915->pmu; - if (pmu->closed) + if (!pmu->registered) return; spin_lock_irq(&pmu->lock); @@ -324,7 +324,7 @@ void i915_pmu_gt_unparked(struct intel_gt *gt) { struct i915_pmu *pmu = >->i915->pmu; - if (pmu->closed) + if (!pmu->registered) return; spin_lock_irq(&pmu->lock); @@ -626,7 +626,7 @@ static int i915_pmu_event_init(struct perf_event *event) struct drm_i915_private *i915 = pmu_to_i915(pmu); int ret; - if (pmu->closed) + if (!pmu->registered) return -ENODEV; if (event->attr.type != event->pmu->type) @@ -724,7 +724,7 @@ static void i915_pmu_event_read(struct perf_event *event) struct hw_perf_event *hwc = &event->hw; u64 prev, new; - if (pmu->closed) { + if (!pmu->registered) { event->hw.state = PERF_HES_STOPPED; return; } @@ -850,7 +850,7 @@ static void i915_pmu_event_start(struct perf_event *event, int flags) { struct i915_pmu *pmu = event_to_pmu(event); - if (pmu->closed) + if (!pmu->registered) return; i915_pmu_enable(event); @@ -861,7 +861,7 @@ static void i915_pmu_event_stop(struct perf_event *event, int flags) { struct i915_pmu *pmu = event_to_pmu(event); - if (pmu->closed) + if (!pmu->registered) goto out; if (flags & PERF_EF_UPDATE) @@ -877,7 +877,7 @@ static int i915_pmu_event_add(struct perf_event *event, int flags) { struct i915_pmu *pmu = event_to_pmu(event); - if (pmu->closed) + if (!pmu->registered) return -ENODEV; if (flags & PERF_EF_START) @@ -1193,7 +1193,7 @@ static int i915_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node) * Unregistering an instance generates a CPU offline event which we must * ignore to avoid incorrectly modifying the shared i915_pmu_cpumask. */ - if (pmu->closed) + if (!pmu->registered) return 0; if (cpumask_test_and_clear_cpu(cpu, &i915_pmu_cpumask)) { @@ -1263,8 +1263,6 @@ void i915_pmu_register(struct drm_i915_private *i915) }; int ret = -ENOMEM; - pmu->closed = true; - spin_lock_init(&pmu->lock); hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); pmu->timer.function = i915_sample; @@ -1313,7 +1311,7 @@ void i915_pmu_register(struct drm_i915_private *i915) if (ret) goto err_unreg; - pmu->closed = false; + pmu->registered = true; return; @@ -1334,12 +1332,15 @@ void i915_pmu_unregister(struct drm_i915_private *i915) { struct i915_pmu *pmu = &i915->pmu; + if (!pmu->registered) + return; + /* * "Disconnect" the PMU callbacks - since all are atomic synchronize_rcu * ensures all currently executing ones will have exited before we * proceed with unregistration. */ - pmu->closed = true; + pmu->registered = false; synchronize_rcu(); hrtimer_cancel(&pmu->timer); diff --git a/drivers/gpu/drm/i915/i915_pmu.h b/drivers/gpu/drm/i915/i915_pmu.h index 41af038c37388..8e66d63d0c9f9 100644 --- a/drivers/gpu/drm/i915/i915_pmu.h +++ b/drivers/gpu/drm/i915/i915_pmu.h @@ -68,9 +68,9 @@ struct i915_pmu { */ struct pmu base; /** - * @closed: i915 is unregistering. + * @registered: PMU is registered and not in the unregistering process. */ - bool closed; + bool registered; /** * @name: Name as registered with perf core. */ From patchwork Mon Nov 4 21:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 13862126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 673BDD1BDF8 for ; Mon, 4 Nov 2024 21:35:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E183E10E4E0; Mon, 4 Nov 2024 21:35:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="ZhVhjJYn"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9E4B910E4DC for ; Mon, 4 Nov 2024 21:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730756135; x=1762292135; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=3UPM3g7GFLDrc7L2rPvBTVJcMLXTUsWvYwInBQwjnaM=; b=ZhVhjJYnQJ+e7BII/ZYb9Ult1hUKhfPGpxDxgaI0ifRpLCVAQ1Ned0uO OsqZ3jp+Mgy5TjgOnJfM8IsIDC8ptk3o8FsIIBAzdz3oHM/gpiJwx28tg gR8RfcpJtkj7NQMZDg2sHI5lnL9/fJzuhFHXZ8MtB7/sfgHZClP3FbwV0 zYwYPIHiYR/bC+bHm+NUvdA5Crcwdos9GWS73rISwwEYpMz9F9KNIErqf jgimT/V9tgfLPQ5bHO36QC8BVK98mIlV9dkbEbXZsumKqMXgDASWEnrKC WlZy+xpmKqWtxMZBks3UMNOsufrMJD5lhvX3fPJUoYgdcoNFiCtXQJsQ1 Q==; X-CSE-ConnectionGUID: JzDRYhdAQMaUv3N1Xgrpew== X-CSE-MsgGUID: SI9WxNKWQxW+BV+u860Mjg== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30420302" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30420302" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 13:35:35 -0800 X-CSE-ConnectionGUID: B33b9XJfQPC03ej4LupN4A== X-CSE-MsgGUID: q1st3iAaT9K5W4mHyxBe8w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,258,1725346800"; d="scan'208";a="114562853" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 13:35:35 -0800 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 4/4] drm/i915/pmu: Remove pointless synchronize_rcu() call Date: Mon, 4 Nov 2024 13:35:12 -0800 Message-ID: <20241104213512.2314930-5-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104213512.2314930-1-lucas.demarchi@intel.com> References: <20241104213512.2314930-1-lucas.demarchi@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This is already done inside perf_pmu_unregister() - no need to do it before. Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/i915_pmu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index bd476297ed0a1..e55db036be1bb 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -1335,13 +1335,8 @@ void i915_pmu_unregister(struct drm_i915_private *i915) if (!pmu->registered) return; - /* - * "Disconnect" the PMU callbacks - since all are atomic synchronize_rcu - * ensures all currently executing ones will have exited before we - * proceed with unregistration. - */ + /* Disconnect the PMU callbacks */ pmu->registered = false; - synchronize_rcu(); hrtimer_cancel(&pmu->timer);