Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

accel/habanalabs: add HL_GET_P_STATE passthrough type

Add a new passthrough type HL_GET_P_STATE to the cpucp generic ioctl
to allow userspace to read the device performance state via firmware.

Signed-off-by: Ariel Aviad <ariel.aviad@intel.com>
Reviewed-by: Koby Elbaz <koby.elbaz@intel.com>
Signed-off-by: Koby Elbaz <koby.elbaz@intel.com>

authored by

Ariel Aviad and committed by
Koby Elbaz
65a3f5bc eeb38d0e

+5
+3
drivers/accel/habanalabs/common/habanalabs_ioctl.c
··· 964 964 case HL_GET_ERR_COUNTERS_CMD: 965 965 need_input_buff = true; 966 966 break; 967 + case HL_GET_P_STATE: 968 + need_input_buff = false; 969 + break; 967 970 default: 968 971 return -EINVAL; 969 972 }
+2
include/linux/habanalabs/cpucp_if.h
··· 1426 1426 * 1427 1427 * HL_PASSTHROUGHT_VERSIONS - Fetch all firmware versions. 1428 1428 * HL_GET_ERR_COUNTERS_CMD - Command to get error counters 1429 + * HL_GET_P_STATE - get performance state 1429 1430 */ 1430 1431 enum hl_passthrough_type { 1431 1432 HL_PASSTHROUGH_VERSIONS, 1432 1433 HL_GET_ERR_COUNTERS_CMD, 1434 + HL_GET_P_STATE, 1433 1435 }; 1434 1436 1435 1437 #endif /* CPUCP_IF_H */