Re: [PATCH 02/10] drivers/perf: apple_m1: Support per-implementation event tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nick Chan 於 2025/2/12 凌晨12:07 寫道:
> Use per-implementation event tables to allow supporting implementations
> with a different list of events and event affinities.
>
> Signed-off-by: Nick Chan <towinchenmi@xxxxxxxxx>
> ---
>  drivers/perf/apple_m1_cpu_pmu.c | 65 +++++++++++++++++++++++++----------------
>  1 file changed, 40 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/perf/apple_m1_cpu_pmu.c b/drivers/perf/apple_m1_cpu_pmu.c
> index 06fd317529fcbab0f1485228efe8470be565407c..1bf7ce5c09846c699d66bdfcca129f418a9dad9e 100644
> --- a/drivers/perf/apple_m1_cpu_pmu.c
> +++ b/drivers/perf/apple_m1_cpu_pmu.c
[...]
>  static void m1_pmu_reset(void *info)
> @@ -572,25 +588,16 @@ static int m1_pmu_set_event_filter(struct hw_perf_event *event,
>  	return 0;
>  }
>  
> -static int m1_pmu_init(struct arm_pmu *cpu_pmu, u32 flags)
> +static int apple_pmu_init_common(struct arm_pmu *cpu_pmu, u32 flags)
>  {
>  	cpu_pmu->handle_irq	  = m1_pmu_handle_irq;
>  	cpu_pmu->enable		  = m1_pmu_enable_event;
>  	cpu_pmu->disable	  = m1_pmu_disable_event;
>  	cpu_pmu->read_counter	  = m1_pmu_read_counter;
>  	cpu_pmu->write_counter	  = m1_pmu_write_counter;
> -	cpu_pmu->get_event_idx	  = m1_pmu_get_event_idx;
>  	cpu_pmu->clear_event_idx  = m1_pmu_clear_event_idx;
>  	cpu_pmu->start		  = m1_pmu_start;
>  	cpu_pmu->stop		  = m1_pmu_stop;
> -
> -	if (flags & ARMPMU_EVT_47BIT)
> -		cpu_pmu->map_event = m1_pmu_map_event;
> -	else if (flags & ARMPMU_EVT_63BIT)
> -		cpu_pmu->map_event = m2_pmu_map_event;
> -	else
> -		return WARN_ON(-EINVAL);
> -
>  	cpu_pmu->reset		  = m1_pmu_reset;
>  	cpu_pmu->set_event_filter = m1_pmu_set_event_filter;

[...]

The flags parameter is no longer used, so I will send a v2 with the parameter dropped.

Nick Chan





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux