Skip to content

Commit 65a3f5b

Browse files
aaviadaiKobyElbaz
authored andcommitted
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 <[email protected]> Reviewed-by: Koby Elbaz <[email protected]> Signed-off-by: Koby Elbaz <[email protected]>
1 parent eeb38d0 commit 65a3f5b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/accel/habanalabs/common/habanalabs_ioctl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,9 @@ static int send_fw_generic_request(struct hl_device *hdev, struct hl_info_args *
964964
case HL_GET_ERR_COUNTERS_CMD:
965965
need_input_buff = true;
966966
break;
967+
case HL_GET_P_STATE:
968+
need_input_buff = false;
969+
break;
967970
default:
968971
return -EINVAL;
969972
}

include/linux/habanalabs/cpucp_if.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,10 +1426,12 @@ struct cpucp_monitor_dump {
14261426
*
14271427
* HL_PASSTHROUGHT_VERSIONS - Fetch all firmware versions.
14281428
* HL_GET_ERR_COUNTERS_CMD - Command to get error counters
1429+
* HL_GET_P_STATE - get performance state
14291430
*/
14301431
enum hl_passthrough_type {
14311432
HL_PASSTHROUGH_VERSIONS,
14321433
HL_GET_ERR_COUNTERS_CMD,
1434+
HL_GET_P_STATE,
14331435
};
14341436

14351437
#endif /* CPUCP_IF_H */

0 commit comments

Comments
 (0)