s390/pai: fix sampling event removal for PMU device driver
authorThomas Richter <tmricht@linux.ibm.com>
Thu, 29 Feb 2024 14:00:28 +0000 (15:00 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 3 Apr 2024 13:00:20 +0000 (15:00 +0200)
commite9f3af02f63909f41b43c28330434cc437639c5c
treee5b5b84cfbabd3865fa6b4b8b64bf2476795352b
parentc9c260681f521e4ad9f9f4cc71fe35b978e06222
s390/pai: fix sampling event removal for PMU device driver

In case of a sampling event, the PAI PMU device drivers need a
reference to this event.  Currently to PMU device driver reference
is removed when a sampling event is destroyed. This may lead to
situations where the reference of the PMU device driver is removed
while being used by a different sampling event.
Reset the event reference pointer of the PMU device driver when
a sampling event is deleted and before the next one might be added.

Fixes: 39d62336f5c1 ("s390/pai: add support for cryptography counters")
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/perf_pai_crypto.c
arch/s390/kernel/perf_pai_ext.c