Skip to content

Commit

Permalink
fix(driver): use smp_call_function_single that was already present …
Browse files Browse the repository at this point in the history
…in 2.6.x.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Jan 22, 2025
1 parent 8aa9e04 commit 5cc6f10
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions driver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2772,7 +2772,7 @@ struct hotplug_st {
long cpu;
};

static int do_cpu_callback(void *payload) {
static void do_cpu_callback(void *payload) {
struct ppm_ring_buffer_context *ring;
struct ppm_consumer_t *consumer;
struct event_data_t event_data;
Expand Down Expand Up @@ -2805,23 +2805,22 @@ static int do_cpu_callback(void *payload) {
event_data.event_info.context_data.sched_next = (void *)st->sd_action;
record_event_all_consumers(PPME_CPU_HOTPLUG_E, UF_NEVER_DROP, &event_data, INTERNAL_EVENTS);
}
return 0;
}

static int scap_cpu_online(unsigned int cpu) {
vpr_info("scap_cpu_online on cpu %d\n", cpu);
struct hotplug_st st;
st.sd_action = 1;
st.cpu = cpu;
return smp_call_on_cpu(0, do_cpu_callback, &st, true);
return smp_call_function_single(0, do_cpu_callback, &st, 1);
}

static int scap_cpu_offline(unsigned int cpu) {
vpr_info("scap_cpu_offline on cpu %d\n", cpu);
struct hotplug_st st;
st.sd_action = 2;
st.cpu = cpu;
return smp_call_on_cpu(0, do_cpu_callback, &st, true);
return smp_call_function_single(0, do_cpu_callback, &st, 1);
}

#if(LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0))
Expand Down

0 comments on commit 5cc6f10

Please sign in to comment.