]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.1/s390-pai-rename-structure-member-users-to-active_eve.patch
6.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-6.1 / s390-pai-rename-structure-member-users-to-active_eve.patch
1 From f0ecea58cbe224aa614e12a7d24d14cfb5e6ef10 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Thu, 20 Oct 2022 11:55:52 +0200
4 Subject: s390/pai: rename structure member users to active_events
5
6 From: Thomas Richter <tmricht@linux.ibm.com>
7
8 [ Upstream commit 58354c7d35d35dd119ada18ff84a6686ccc8743f ]
9
10 Rename structure member users to active_events to make it consistent
11 with PMU pai_ext. Also use the same prefix syntax for increment and
12 decrement operators in both PMUs.
13
14 Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
15 Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
16 Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
17 Stable-dep-of: e9f3af02f639 ("s390/pai: fix sampling event removal for PMU device driver")
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 ---
20 arch/s390/kernel/perf_pai_crypto.c | 12 ++++++------
21 1 file changed, 6 insertions(+), 6 deletions(-)
22
23 diff --git a/arch/s390/kernel/perf_pai_crypto.c b/arch/s390/kernel/perf_pai_crypto.c
24 index 68a6132937f3e..a7e815563f411 100644
25 --- a/arch/s390/kernel/perf_pai_crypto.c
26 +++ b/arch/s390/kernel/perf_pai_crypto.c
27 @@ -35,7 +35,7 @@ struct pai_userdata {
28 struct paicrypt_map {
29 unsigned long *page; /* Page for CPU to store counters */
30 struct pai_userdata *save; /* Page to store no-zero counters */
31 - unsigned int users; /* # of PAI crypto users */
32 + unsigned int active_events; /* # of PAI crypto users */
33 unsigned int refcnt; /* Reference count mapped buffers */
34 enum paievt_mode mode; /* Type of event */
35 struct perf_event *event; /* Perf event for sampling */
36 @@ -58,8 +58,8 @@ static void paicrypt_event_destroy(struct perf_event *event)
37 mutex_lock(&pai_reserve_mutex);
38 debug_sprintf_event(cfm_dbg, 5, "%s event %#llx cpu %d users %d"
39 " mode %d refcnt %d\n", __func__,
40 - event->attr.config, event->cpu, cpump->users,
41 - cpump->mode, cpump->refcnt);
42 + event->attr.config, event->cpu,
43 + cpump->active_events, cpump->mode, cpump->refcnt);
44 if (!--cpump->refcnt) {
45 debug_sprintf_event(cfm_dbg, 4, "%s page %#lx save %p\n",
46 __func__, (unsigned long)cpump->page,
47 @@ -174,7 +174,7 @@ static int paicrypt_busy(struct perf_event_attr *a, struct paicrypt_map *cpump)
48 }
49 debug_sprintf_event(cfm_dbg, 5, "%s sample_period %#llx users %d"
50 " mode %d refcnt %d page %#lx save %p rc %d\n",
51 - __func__, a->sample_period, cpump->users,
52 + __func__, a->sample_period, cpump->active_events,
53 cpump->mode, cpump->refcnt,
54 (unsigned long)cpump->page, cpump->save, rc);
55 mutex_unlock(&pai_reserve_mutex);
56 @@ -260,7 +260,7 @@ static int paicrypt_add(struct perf_event *event, int flags)
57 struct paicrypt_map *cpump = this_cpu_ptr(&paicrypt_map);
58 unsigned long ccd;
59
60 - if (cpump->users++ == 0) {
61 + if (++cpump->active_events == 1) {
62 ccd = virt_to_phys(cpump->page) | PAI_CRYPTO_KERNEL_OFFSET;
63 WRITE_ONCE(S390_lowcore.ccd, ccd);
64 __ctl_set_bit(0, 50);
65 @@ -291,7 +291,7 @@ static void paicrypt_del(struct perf_event *event, int flags)
66 if (!event->attr.sample_period)
67 /* Only counting needs to read counter */
68 paicrypt_stop(event, PERF_EF_UPDATE);
69 - if (cpump->users-- == 1) {
70 + if (--cpump->active_events == 0) {
71 __ctl_clear_bit(0, 50);
72 WRITE_ONCE(S390_lowcore.ccd, 0);
73 }
74 --
75 2.43.0
76