Commit ac03223f authored by Thomas Richter's avatar Thomas Richter Committed by Heiko Carstens
Browse files

s390/pai_crypto: Add common pai_stop() function



To support one common PAI PMU device driver which handles
both PMUs pai_crypto and pai_ext, use a common naming scheme
for structures and variables suitable for both device drivers.

Add a common usable function pai_stop() for the event on a CPU.
Call this common pai_stop() from paicrypt_del().

Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Reviewed-by: default avatarJan Polensky <japo@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent a65a4d7e
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -435,13 +435,14 @@ static int paicrypt_add(struct perf_event *event, int flags)
}

static void pai_have_sample(struct perf_event *, struct pai_map *);
static void paicrypt_stop(struct perf_event *event, int flags)
static void pai_stop(struct perf_event *event, int flags)
{
	struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);
	struct pai_map *cpump = mp->mapptr;
	int idx = PAI_PMU_IDX(event);

	if (!event->attr.sample_period) {	/* Counting */
		paicrypt_read(event);
		pai_pmu[idx].pmu->read(event);
	} else {				/* Sampling */
		if (!(event->attach_state & PERF_ATTACH_TASK)) {
			perf_sched_cb_dec(event->pmu);
@@ -454,6 +455,11 @@ static void paicrypt_stop(struct perf_event *event, int flags)
	event->hw.state = PERF_HES_STOPPED;
}

static void paicrypt_stop(struct perf_event *event, int flags)
{
	pai_stop(event, flags);
}

static void paicrypt_del(struct perf_event *event, int flags)
{
	struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);