]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
accel/habanalabs: add HL_GET_P_STATE passthrough type
authorAriel Aviad <ariel.aviad@intel.com>
Tue, 24 Sep 2024 08:02:49 +0000 (11:02 +0300)
committerKoby Elbaz <koby.elbaz@intel.com>
Thu, 25 Sep 2025 06:09:31 +0000 (09:09 +0300)
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>
drivers/accel/habanalabs/common/habanalabs_ioctl.c
include/linux/habanalabs/cpucp_if.h

index ed0dee5aa9be66576fea0d6d5f72e94cf3248fca..fdfdabc85e546f6627c76b4eb521872fb644fbac 100644 (file)
@@ -964,6 +964,9 @@ static int send_fw_generic_request(struct hl_device *hdev, struct hl_info_args *
        case  HL_GET_ERR_COUNTERS_CMD:
                need_input_buff = true;
                break;
+       case HL_GET_P_STATE:
+               need_input_buff = false;
+               break;
        default:
                return -EINVAL;
        }
index 29c50e7427d1b880121c2d1d11a339e537d51d70..45f181bcf8900a13694001a818fa63c313974256 100644 (file)
@@ -1426,10 +1426,12 @@ struct cpucp_monitor_dump {
  *
  * HL_PASSTHROUGHT_VERSIONS    - Fetch all firmware versions.
  * HL_GET_ERR_COUNTERS_CMD     - Command to get error counters
+ * HL_GET_P_STATE              - get performance state
  */
 enum hl_passthrough_type {
        HL_PASSTHROUGH_VERSIONS,
        HL_GET_ERR_COUNTERS_CMD,
+       HL_GET_P_STATE,
 };
 
 #endif /* CPUCP_IF_H */