tools/power/x86/intel-speed-select: Abstract pm_qos_config
[platform/kernel/linux-starfive.git] / tools / power / x86 / intel-speed-select / isst-core.c
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Intel Speed Select -- Enumerate and control features
4  * Copyright (c) 2019 Intel Corporation.
5  */
6
7 #include "isst.h"
8
9 static int mbox_delay;
10 static int mbox_retries = 3;
11
12 static struct isst_platform_ops         *isst_ops;
13
14 #define CHECK_CB(_name) \
15         do {    \
16                 if (!isst_ops || !isst_ops->_name) {    \
17                         fprintf(stderr, "Invalid ops\n");       \
18                         exit(0);        \
19                 }       \
20         } while (0)
21
22 int isst_set_platform_ops(void)
23 {
24         isst_ops = mbox_get_platform_ops();
25
26         if (!isst_ops)
27                 return -1;
28         return 0;
29 }
30
31 void isst_update_platform_param(enum isst_platform_param param, int value)
32 {
33         switch (param) {
34         case ISST_PARAM_MBOX_DELAY:
35                 mbox_delay = value;
36                 break;
37         case ISST_PARAM_MBOX_RETRIES:
38                 mbox_retries = value;
39                 break;
40         default:
41                 break;
42         }
43 }
44
45 int isst_get_disp_freq_multiplier(void)
46 {
47         CHECK_CB(get_disp_freq_multiplier);
48         return isst_ops->get_disp_freq_multiplier();
49 }
50
51 int isst_get_trl_max_levels(void)
52 {
53         CHECK_CB(get_trl_max_levels);
54         return isst_ops->get_trl_max_levels();
55 }
56
57 char *isst_get_trl_level_name(int level)
58 {
59         CHECK_CB(get_trl_level_name);
60         return isst_ops->get_trl_level_name(level);
61 }
62
63 int isst_is_punit_valid(struct isst_id *id)
64 {
65         CHECK_CB(is_punit_valid);
66         return isst_ops->is_punit_valid(id);
67 }
68
69 static int isst_send_mmio_command(unsigned int cpu, unsigned int reg, int write,
70                                   unsigned int *value)
71 {
72         struct isst_if_io_regs io_regs;
73         const char *pathname = "/dev/isst_interface";
74         int cmd;
75         FILE *outf = get_output_file();
76         int fd;
77
78         debug_printf("mmio_cmd cpu:%d reg:%d write:%d\n", cpu, reg, write);
79
80         fd = open(pathname, O_RDWR);
81         if (fd < 0)
82                 err(-1, "%s open failed", pathname);
83
84         io_regs.req_count = 1;
85         io_regs.io_reg[0].logical_cpu = cpu;
86         io_regs.io_reg[0].reg = reg;
87         cmd = ISST_IF_IO_CMD;
88         if (write) {
89                 io_regs.io_reg[0].read_write = 1;
90                 io_regs.io_reg[0].value = *value;
91         } else {
92                 io_regs.io_reg[0].read_write = 0;
93         }
94
95         if (ioctl(fd, cmd, &io_regs) == -1) {
96                 if (errno == ENOTTY) {
97                         perror("ISST_IF_IO_COMMAND\n");
98                         fprintf(stderr, "Check presence of kernel modules: isst_if_mmio\n");
99                         exit(0);
100                 }
101                 fprintf(outf, "Error: mmio_cmd cpu:%d reg:%x read_write:%x\n",
102                         cpu, reg, write);
103         } else {
104                 if (!write)
105                         *value = io_regs.io_reg[0].value;
106
107                 debug_printf(
108                         "mmio_cmd response: cpu:%d reg:%x rd_write:%x resp:%x\n",
109                         cpu, reg, write, *value);
110         }
111
112         close(fd);
113
114         return 0;
115 }
116
117 int isst_send_mbox_command(unsigned int cpu, unsigned char command,
118                            unsigned char sub_command, unsigned int parameter,
119                            unsigned int req_data, unsigned int *resp)
120 {
121         const char *pathname = "/dev/isst_interface";
122         int fd, retry;
123         struct isst_if_mbox_cmds mbox_cmds = { 0 };
124
125         debug_printf(
126                 "mbox_send: cpu:%d command:%x sub_command:%x parameter:%x req_data:%x\n",
127                 cpu, command, sub_command, parameter, req_data);
128
129         if (!is_skx_based_platform() && command == CONFIG_CLOS &&
130             sub_command != CLOS_PM_QOS_CONFIG) {
131                 unsigned int value;
132                 int write = 0;
133                 int clos_id, core_id, ret = 0;
134
135                 debug_printf("CPU %d\n", cpu);
136
137                 if (parameter & BIT(MBOX_CMD_WRITE_BIT)) {
138                         value = req_data;
139                         write = 1;
140                 }
141
142                 switch (sub_command) {
143                 case CLOS_PQR_ASSOC:
144                         core_id = parameter & 0xff;
145                         ret = isst_send_mmio_command(
146                                 cpu, PQR_ASSOC_OFFSET + core_id * 4, write,
147                                 &value);
148                         if (!ret && !write)
149                                 *resp = value;
150                         break;
151                 case CLOS_PM_CLOS:
152                         clos_id = parameter & 0x03;
153                         ret = isst_send_mmio_command(
154                                 cpu, PM_CLOS_OFFSET + clos_id * 4, write,
155                                 &value);
156                         if (!ret && !write)
157                                 *resp = value;
158                         break;
159                 case CLOS_STATUS:
160                         break;
161                 default:
162                         break;
163                 }
164                 return ret;
165         }
166
167         mbox_cmds.cmd_count = 1;
168         mbox_cmds.mbox_cmd[0].logical_cpu = cpu;
169         mbox_cmds.mbox_cmd[0].command = command;
170         mbox_cmds.mbox_cmd[0].sub_command = sub_command;
171         mbox_cmds.mbox_cmd[0].parameter = parameter;
172         mbox_cmds.mbox_cmd[0].req_data = req_data;
173
174         if (mbox_delay)
175                 usleep(mbox_delay * 1000);
176
177         fd = open(pathname, O_RDWR);
178         if (fd < 0)
179                 err(-1, "%s open failed", pathname);
180
181         retry = mbox_retries;
182
183         do {
184                 if (ioctl(fd, ISST_IF_MBOX_COMMAND, &mbox_cmds) == -1) {
185                         if (errno == ENOTTY) {
186                                 perror("ISST_IF_MBOX_COMMAND\n");
187                                 fprintf(stderr, "Check presence of kernel modules: isst_if_mbox_pci or isst_if_mbox_msr\n");
188                                 exit(0);
189                         }
190                         debug_printf(
191                                 "Error: mbox_cmd cpu:%d command:%x sub_command:%x parameter:%x req_data:%x errorno:%d\n",
192                                 cpu, command, sub_command, parameter, req_data, errno);
193                         --retry;
194                 } else {
195                         *resp = mbox_cmds.mbox_cmd[0].resp_data;
196                         debug_printf(
197                                 "mbox_cmd response: cpu:%d command:%x sub_command:%x parameter:%x req_data:%x resp:%x\n",
198                                 cpu, command, sub_command, parameter, req_data, *resp);
199                         break;
200                 }
201         } while (retry);
202
203         close(fd);
204
205         if (!retry) {
206                 debug_printf("Failed mbox command even after retries\n");
207                 return -1;
208
209         }
210         return 0;
211 }
212
213 int isst_send_msr_command(unsigned int cpu, unsigned int msr, int write,
214                           unsigned long long *req_resp)
215 {
216         struct isst_if_msr_cmds msr_cmds;
217         const char *pathname = "/dev/isst_interface";
218         FILE *outf = get_output_file();
219         int fd;
220
221         fd = open(pathname, O_RDWR);
222         if (fd < 0)
223                 err(-1, "%s open failed", pathname);
224
225         msr_cmds.cmd_count = 1;
226         msr_cmds.msr_cmd[0].logical_cpu = cpu;
227         msr_cmds.msr_cmd[0].msr = msr;
228         msr_cmds.msr_cmd[0].read_write = write;
229         if (write)
230                 msr_cmds.msr_cmd[0].data = *req_resp;
231
232         if (ioctl(fd, ISST_IF_MSR_COMMAND, &msr_cmds) == -1) {
233                 perror("ISST_IF_MSR_COMMAND");
234                 fprintf(outf, "Error: msr_cmd cpu:%d msr:%x read_write:%d\n",
235                         cpu, msr, write);
236         } else {
237                 if (!write)
238                         *req_resp = msr_cmds.msr_cmd[0].data;
239
240                 debug_printf(
241                         "msr_cmd response: cpu:%d msr:%x rd_write:%x resp:%llx %llx\n",
242                         cpu, msr, write, *req_resp, msr_cmds.msr_cmd[0].data);
243         }
244
245         close(fd);
246
247         return 0;
248 }
249
250 int isst_read_pm_config(struct isst_id *id, int *cp_state, int *cp_cap)
251 {
252         unsigned int resp;
253         int ret;
254
255         ret = isst_send_mbox_command(id->cpu, READ_PM_CONFIG, PM_FEATURE, 0, 0,
256                                      &resp);
257         if (ret)
258                 return ret;
259
260         debug_printf("cpu:%d READ_PM_CONFIG resp:%x\n", id->cpu, resp);
261
262         *cp_state = resp & BIT(16);
263         *cp_cap = resp & BIT(0) ? 1 : 0;
264
265         return 0;
266 }
267
268 int isst_get_ctdp_levels(struct isst_id *id, struct isst_pkg_ctdp *pkg_dev)
269 {
270         CHECK_CB(get_config_levels);
271         return isst_ops->get_config_levels(id, pkg_dev);
272 }
273
274 int isst_get_ctdp_control(struct isst_id *id, int config_index,
275                           struct isst_pkg_ctdp_level_info *ctdp_level)
276 {
277         CHECK_CB(get_ctdp_control);
278         return isst_ops->get_ctdp_control(id, config_index, ctdp_level);
279 }
280
281 int isst_get_tdp_info(struct isst_id *id, int config_index,
282                       struct isst_pkg_ctdp_level_info *ctdp_level)
283 {
284         CHECK_CB(get_tdp_info);
285         return isst_ops->get_tdp_info(id, config_index, ctdp_level);
286 }
287
288 int isst_get_pwr_info(struct isst_id *id, int config_index,
289                       struct isst_pkg_ctdp_level_info *ctdp_level)
290 {
291         CHECK_CB(get_pwr_info);
292         return isst_ops->get_pwr_info(id, config_index, ctdp_level);
293 }
294
295 int isst_get_coremask_info(struct isst_id *id, int config_index,
296                            struct isst_pkg_ctdp_level_info *ctdp_level)
297 {
298         CHECK_CB(get_coremask_info);
299         return isst_ops->get_coremask_info(id, config_index, ctdp_level);
300 }
301
302 int isst_get_get_trl_from_msr(struct isst_id *id, int *trl)
303 {
304         unsigned long long msr_trl;
305         int ret;
306
307         ret = isst_send_msr_command(id->cpu, 0x1AD, 0, &msr_trl);
308         if (ret)
309                 return ret;
310
311         trl[0] = msr_trl & GENMASK(7, 0);
312         trl[1] = (msr_trl & GENMASK(15, 8)) >> 8;
313         trl[2] = (msr_trl & GENMASK(23, 16)) >> 16;
314         trl[3] = (msr_trl & GENMASK(31, 24)) >> 24;
315         trl[4] = (msr_trl & GENMASK(39, 32)) >> 32;
316         trl[5] = (msr_trl & GENMASK(47, 40)) >> 40;
317         trl[6] = (msr_trl & GENMASK(55, 48)) >> 48;
318         trl[7] = (msr_trl & GENMASK(63, 56)) >> 56;
319
320         return 0;
321 }
322
323 int isst_get_get_trl(struct isst_id *id, int level, int avx_level, int *trl)
324 {
325         CHECK_CB(get_get_trl);
326         return isst_ops->get_get_trl(id, level, avx_level, trl);
327 }
328
329 int isst_get_get_trls(struct isst_id *id, int level, struct isst_pkg_ctdp_level_info *ctdp_level)
330 {
331         CHECK_CB(get_get_trls);
332         return isst_ops->get_get_trls(id, level, ctdp_level);
333 }
334
335 int isst_get_trl_bucket_info(struct isst_id *id, int level, unsigned long long *buckets_info)
336 {
337         CHECK_CB(get_trl_bucket_info);
338         return isst_ops->get_trl_bucket_info(id, level, buckets_info);
339 }
340
341 int isst_set_tdp_level(struct isst_id *id, int tdp_level)
342 {
343         CHECK_CB(set_tdp_level);
344         return isst_ops->set_tdp_level(id, tdp_level);
345 }
346
347 int isst_get_pbf_info(struct isst_id *id, int level, struct isst_pbf_info *pbf_info)
348 {
349         struct isst_pkg_ctdp_level_info ctdp_level;
350         struct isst_pkg_ctdp pkg_dev;
351         int ret;
352
353         ret = isst_get_ctdp_levels(id, &pkg_dev);
354         if (ret) {
355                 isst_display_error_info_message(1, "Failed to get number of levels", 0, 0);
356                 return ret;
357         }
358
359         if (level > pkg_dev.levels) {
360                 isst_display_error_info_message(1, "Invalid level", 1, level);
361                 return -1;
362         }
363
364         ret = isst_get_ctdp_control(id, level, &ctdp_level);
365         if (ret)
366                 return ret;
367
368         if (!ctdp_level.pbf_support) {
369                 isst_display_error_info_message(1, "base-freq feature is not present at this level", 1, level);
370                 return -1;
371         }
372
373         pbf_info->core_cpumask_size = alloc_cpu_set(&pbf_info->core_cpumask);
374
375         CHECK_CB(get_pbf_info);
376         return isst_ops->get_pbf_info(id, level, pbf_info);
377 }
378
379 int isst_set_pbf_fact_status(struct isst_id *id, int pbf, int enable)
380 {
381         CHECK_CB(set_pbf_fact_status);
382         return isst_ops->set_pbf_fact_status(id, pbf, enable);
383 }
384
385
386
387 int isst_get_fact_info(struct isst_id *id, int level, int fact_bucket, struct isst_fact_info *fact_info)
388 {
389         struct isst_pkg_ctdp_level_info ctdp_level;
390         struct isst_pkg_ctdp pkg_dev;
391         int ret;
392
393         ret = isst_get_ctdp_levels(id, &pkg_dev);
394         if (ret) {
395                 isst_display_error_info_message(1, "Failed to get number of levels", 0, 0);
396                 return ret;
397         }
398
399         if (level > pkg_dev.levels) {
400                 isst_display_error_info_message(1, "Invalid level", 1, level);
401                 return -1;
402         }
403
404         ret = isst_get_ctdp_control(id, level, &ctdp_level);
405         if (ret)
406                 return ret;
407
408         if (!ctdp_level.fact_support) {
409                 isst_display_error_info_message(1, "turbo-freq feature is not present at this level", 1, level);
410                 return -1;
411         }
412         CHECK_CB(get_fact_info);
413         return isst_ops->get_fact_info(id, level, fact_bucket, fact_info);
414 }
415
416 int isst_get_trl(struct isst_id *id, unsigned long long *trl)
417 {
418         int ret;
419
420         ret = isst_send_msr_command(id->cpu, 0x1AD, 0, trl);
421         if (ret)
422                 return ret;
423
424         return 0;
425 }
426
427 int isst_set_trl(struct isst_id *id, unsigned long long trl)
428 {
429         int ret;
430
431         if (!trl)
432                 trl = 0xFFFFFFFFFFFFFFFFULL;
433
434         ret = isst_send_msr_command(id->cpu, 0x1AD, 1, &trl);
435         if (ret)
436                 return ret;
437
438         return 0;
439 }
440
441 int isst_set_trl_from_current_tdp(struct isst_id *id, unsigned long long trl)
442 {
443         unsigned long long msr_trl;
444         int ret;
445
446         if (trl) {
447                 msr_trl = trl;
448         } else {
449                 struct isst_pkg_ctdp pkg_dev;
450                 int trl[8];
451                 int i;
452
453                 ret = isst_get_ctdp_levels(id, &pkg_dev);
454                 if (ret)
455                         return ret;
456
457                 ret = isst_get_get_trl(id, pkg_dev.current_level, 0, trl);
458                 if (ret)
459                         return ret;
460
461                 msr_trl = 0;
462                 for (i = 0; i < 8; ++i) {
463                         unsigned long long _trl = trl[i];
464
465                         msr_trl |= (_trl << (i * 8));
466                 }
467         }
468         ret = isst_send_msr_command(id->cpu, 0x1AD, 1, &msr_trl);
469         if (ret)
470                 return ret;
471
472         return 0;
473 }
474
475 /* Return 1 if locked */
476 int isst_get_config_tdp_lock_status(struct isst_id *id)
477 {
478         unsigned long long tdp_control = 0;
479         int ret;
480
481         ret = isst_send_msr_command(id->cpu, 0x64b, 0, &tdp_control);
482         if (ret)
483                 return ret;
484
485         ret = !!(tdp_control & BIT(31));
486
487         return ret;
488 }
489
490 void isst_get_process_ctdp_complete(struct isst_id *id, struct isst_pkg_ctdp *pkg_dev)
491 {
492         int i;
493
494         if (!pkg_dev->processed)
495                 return;
496
497         for (i = 0; i < pkg_dev->levels; ++i) {
498                 struct isst_pkg_ctdp_level_info *ctdp_level;
499
500                 ctdp_level = &pkg_dev->ctdp_level[i];
501                 if (ctdp_level->pbf_support)
502                         free_cpu_set(ctdp_level->pbf_info.core_cpumask);
503                 free_cpu_set(ctdp_level->core_cpumask);
504         }
505 }
506
507 void isst_get_uncore_p0_p1_info(struct isst_id *id, int config_index,
508                                 struct isst_pkg_ctdp_level_info *ctdp_level)
509 {
510         CHECK_CB(get_uncore_p0_p1_info);
511         return isst_ops->get_uncore_p0_p1_info(id, config_index, ctdp_level);
512 }
513
514 int isst_get_process_ctdp(struct isst_id *id, int tdp_level, struct isst_pkg_ctdp *pkg_dev)
515 {
516         int i, ret, valid = 0;
517
518         if (pkg_dev->processed)
519                 return 0;
520
521         ret = isst_get_ctdp_levels(id, pkg_dev);
522         if (ret)
523                 return ret;
524
525         debug_printf("cpu: %d ctdp enable:%d current level: %d levels:%d\n",
526                      id->cpu, pkg_dev->enabled, pkg_dev->current_level,
527                      pkg_dev->levels);
528
529         if (tdp_level != 0xff && tdp_level > pkg_dev->levels) {
530                 isst_display_error_info_message(1, "Invalid level", 0, 0);
531                 return -1;
532         }
533
534         if (!pkg_dev->enabled)
535                 isst_display_error_info_message(0, "perf-profile feature is not supported, just base-config level 0 is valid", 0, 0);
536
537         for (i = 0; i <= pkg_dev->levels; ++i) {
538                 struct isst_pkg_ctdp_level_info *ctdp_level;
539
540                 if (tdp_level != 0xff && i != tdp_level)
541                         continue;
542
543                 debug_printf("cpu:%d Get Information for TDP level:%d\n", id->cpu,
544                              i);
545                 ctdp_level = &pkg_dev->ctdp_level[i];
546
547                 ctdp_level->level = i;
548                 ctdp_level->control_cpu = id->cpu;
549                 ctdp_level->pkg_id = id->pkg;
550                 ctdp_level->die_id = id->die;
551
552                 ret = isst_get_ctdp_control(id, i, ctdp_level);
553                 if (ret)
554                         continue;
555
556                 valid = 1;
557                 pkg_dev->processed = 1;
558                 ctdp_level->processed = 1;
559
560                 if (ctdp_level->pbf_support) {
561                         ret = isst_get_pbf_info(id, i, &ctdp_level->pbf_info);
562                         if (!ret)
563                                 ctdp_level->pbf_found = 1;
564                 }
565
566                 if (ctdp_level->fact_support) {
567                         ret = isst_get_fact_info(id, i, 0xff,
568                                                  &ctdp_level->fact_info);
569                         if (ret)
570                                 return ret;
571                 }
572
573                 if (!pkg_dev->enabled && is_skx_based_platform()) {
574                         int freq;
575
576                         freq = get_cpufreq_base_freq(id->cpu);
577                         if (freq > 0) {
578                                 ctdp_level->sse_p1 = freq / 100000;
579                                 ctdp_level->tdp_ratio = ctdp_level->sse_p1;
580                         }
581
582                         isst_get_get_trl_from_msr(id, ctdp_level->trl_ratios[0]);
583                         isst_get_trl_bucket_info(id, i, &ctdp_level->trl_cores);
584                         continue;
585                 }
586
587                 ret = isst_get_tdp_info(id, i, ctdp_level);
588                 if (ret)
589                         return ret;
590
591                 ret = isst_get_pwr_info(id, i, ctdp_level);
592                 if (ret)
593                         return ret;
594
595                 ctdp_level->core_cpumask_size =
596                         alloc_cpu_set(&ctdp_level->core_cpumask);
597                 ret = isst_get_coremask_info(id, i, ctdp_level);
598                 if (ret)
599                         return ret;
600
601                 ret = isst_get_trl_bucket_info(id, i, &ctdp_level->trl_cores);
602                 if (ret)
603                         return ret;
604
605                 ret = isst_get_get_trls(id, i, ctdp_level);
606                 if (ret)
607                         return ret;
608         }
609
610         if (!valid)
611                 isst_display_error_info_message(0, "Invalid level, Can't get TDP control information at specified levels on cpu", 1, id->cpu);
612
613         return 0;
614 }
615
616 int isst_clos_get_clos_information(struct isst_id *id, int *enable, int *type)
617 {
618         CHECK_CB(get_clos_information);
619         return isst_ops->get_clos_information(id, enable, type);
620 }
621
622 int isst_pm_qos_config(struct isst_id *id, int enable_clos, int priority_type)
623 {
624         CHECK_CB(pm_qos_config);
625         return isst_ops->pm_qos_config(id, enable_clos, priority_type);
626 }
627
628 int isst_pm_get_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
629 {
630         unsigned int resp;
631         int ret;
632
633         ret = isst_send_mbox_command(id->cpu, CONFIG_CLOS, CLOS_PM_CLOS, clos, 0,
634                                      &resp);
635         if (ret)
636                 return ret;
637
638         clos_config->epp = resp & 0x0f;
639         clos_config->clos_prop_prio = (resp >> 4) & 0x0f;
640         clos_config->clos_min = (resp >> 8) & 0xff;
641         clos_config->clos_max = (resp >> 16) & 0xff;
642         clos_config->clos_desired = (resp >> 24) & 0xff;
643
644         return 0;
645 }
646
647 int isst_set_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
648 {
649         unsigned int req, resp;
650         unsigned int param;
651         int ret;
652
653         req = clos_config->epp & 0x0f;
654         req |= (clos_config->clos_prop_prio & 0x0f) << 4;
655         req |= (clos_config->clos_min & 0xff) << 8;
656         req |= (clos_config->clos_max & 0xff) << 16;
657         req |= (clos_config->clos_desired & 0xff) << 24;
658
659         param = BIT(MBOX_CMD_WRITE_BIT) | clos;
660
661         ret = isst_send_mbox_command(id->cpu, CONFIG_CLOS, CLOS_PM_CLOS, param, req,
662                                      &resp);
663         if (ret)
664                 return ret;
665
666         debug_printf("cpu:%d CLOS_PM_CLOS param:%x req:%x\n", id->cpu, param, req);
667
668         return 0;
669 }
670
671 int isst_clos_get_assoc_status(struct isst_id *id, int *clos_id)
672 {
673         unsigned int resp;
674         unsigned int param;
675         int core_id, ret;
676
677         core_id = find_phy_core_num(id->cpu);
678         param = core_id;
679
680         ret = isst_send_mbox_command(id->cpu, CONFIG_CLOS, CLOS_PQR_ASSOC, param, 0,
681                                      &resp);
682         if (ret)
683                 return ret;
684
685         debug_printf("cpu:%d CLOS_PQR_ASSOC param:%x resp:%x\n", id->cpu, param,
686                      resp);
687         *clos_id = (resp >> 16) & 0x03;
688
689         return 0;
690 }
691
692 int isst_clos_associate(struct isst_id *id, int clos_id)
693 {
694         unsigned int req, resp;
695         unsigned int param;
696         int core_id, ret;
697
698         req = (clos_id & 0x03) << 16;
699         core_id = find_phy_core_num(id->cpu);
700         param = BIT(MBOX_CMD_WRITE_BIT) | core_id;
701
702         ret = isst_send_mbox_command(id->cpu, CONFIG_CLOS, CLOS_PQR_ASSOC, param,
703                                      req, &resp);
704         if (ret)
705                 return ret;
706
707         debug_printf("cpu:%d CLOS_PQR_ASSOC param:%x req:%x\n", id->cpu, param,
708                      req);
709
710         return 0;
711 }