Skip to content

Commit 3abb6b1

Browse files
Thomas Richterhcahca
authored andcommitted
s390/pai_crypto: Introduce PAI crypto specific event delete function
Introduce PAI crypto specific event delete function to handle additional actions to be done at event removal. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Reviewed-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent 35a27ba commit 3abb6b1

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ static void pai_event_destroy(struct perf_event *event)
138138
{
139139
int cpu;
140140

141-
static_branch_dec(&pai_key);
142141
free_page(PAI_SAVE_AREA(event));
143142
if (event->cpu == -1) {
144143
struct cpumask *mask = PAI_CPU_MASK(event);
@@ -151,6 +150,12 @@ static void pai_event_destroy(struct perf_event *event)
151150
}
152151
}
153152

153+
static void paicrypt_event_destroy(struct perf_event *event)
154+
{
155+
static_branch_dec(&pai_key);
156+
pai_event_destroy(event);
157+
}
158+
154159
static u64 pai_getctr(unsigned long *page, int nr, unsigned long offset)
155160
{
156161
if (offset)
@@ -360,7 +365,7 @@ static int paicrypt_event_init(struct perf_event *event)
360365
int rc = pai_event_init(event, PAI_PMU_CRYPTO);
361366

362367
if (!rc) {
363-
event->destroy = pai_event_destroy;
368+
event->destroy = paicrypt_event_destroy;
364369
static_branch_inc(&pai_key);
365370
}
366371
return rc;

0 commit comments

Comments
 (0)