From patchwork Tue Apr 18 09:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13215330 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C9E8C77B75 for ; Tue, 18 Apr 2023 09:39:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5861710E725; Tue, 18 Apr 2023 09:39:40 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id C6D3E10E12A for ; Tue, 18 Apr 2023 09:39:23 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 56C03625C0; Tue, 18 Apr 2023 09:39:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6AAEC4339B; Tue, 18 Apr 2023 09:39:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681810762; bh=BNb0jfAL1kXRfJrhkG9aaKJBzAVfZ2wABHHYL7NV1RU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F9AzIMTFdVcm7s4YS9nKqDpuXptzv/eBrB7BaTChQlpNe3d+i0HwUg2aqOfWd3LXQ 9rGe4h9q87UdksFcaOAGCbYjIhEit/LVqN9eakpX3HjOKlabM8Fn9Ke8f9IDedirlL eYRbNZcLDLjxp1aHVe5+zf+aqzNWcwEu11PpqwAPqYyA6K0XgHggWqdxM14MN/nybL GNyspjqC1swhxSDrYzqN92+j5XJc4qSBou9AcXST1jiQwa8sFPqC3zGqCAZ0EBwdTg rsAgPSxNfpcRXtMEmlQ0vFauk5TvF77pPNxAGK5QzghcECdA+mXG3FTB1e7e8nMAfM b8fxuZ4D+4jtA== From: Oded Gabbay To: dri-devel@lists.freedesktop.org Subject: [PATCH 02/10] accel/habanalabs: rename fw_{major/minor}_version to fw_inner_{major/minor}_ver Date: Tue, 18 Apr 2023 12:39:08 +0300 Message-Id: <20230418093916.2979728-2-ogabbay@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418093916.2979728-1-ogabbay@kernel.org> References: <20230418093916.2979728-1-ogabbay@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dafna Hirschfeld Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Dafna Hirschfeld We later want to add fields for Firmware SW version. The current extracted FW version is the inner FW versioning so the new name is better and also better differentiate from the FW's SW version. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/firmware_if.c | 8 ++++---- drivers/accel/habanalabs/common/habanalabs.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/accel/habanalabs/common/firmware_if.c b/drivers/accel/habanalabs/common/firmware_if.c index 1400a4430045..6150ab6ba810 100644 --- a/drivers/accel/habanalabs/common/firmware_if.c +++ b/drivers/accel/habanalabs/common/firmware_if.c @@ -105,7 +105,7 @@ static char *extract_u32_until_given_char(char *str, u32 *ver_num, char given_ch */ static int hl_get_preboot_major_minor(struct hl_device *hdev, char *preboot_ver) { - preboot_ver = extract_u32_until_given_char(preboot_ver, &hdev->fw_major_version, '.'); + preboot_ver = extract_u32_until_given_char(preboot_ver, &hdev->fw_inner_major_ver, '.'); if (!preboot_ver) { dev_err(hdev->dev, "Error parsing preboot major version\n"); goto err_zero_ver; @@ -113,7 +113,7 @@ static int hl_get_preboot_major_minor(struct hl_device *hdev, char *preboot_ver) preboot_ver++; - preboot_ver = extract_u32_until_given_char(preboot_ver, &hdev->fw_minor_version, '.'); + preboot_ver = extract_u32_until_given_char(preboot_ver, &hdev->fw_inner_minor_ver, '.'); if (!preboot_ver) { dev_err(hdev->dev, "Error parsing preboot minor version\n"); goto err_zero_ver; @@ -121,8 +121,8 @@ static int hl_get_preboot_major_minor(struct hl_device *hdev, char *preboot_ver) return 0; err_zero_ver: - hdev->fw_major_version = 0; - hdev->fw_minor_version = 0; + hdev->fw_inner_major_ver = 0; + hdev->fw_inner_minor_ver = 0; return -EINVAL; } diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/drivers/accel/habanalabs/common/habanalabs.h index eaae69a9f817..57661cb51621 100644 --- a/drivers/accel/habanalabs/common/habanalabs.h +++ b/drivers/accel/habanalabs/common/habanalabs.h @@ -3225,8 +3225,8 @@ struct hl_reset_info { * @captured_err_info: holds information about errors. * @reset_info: holds current device reset information. * @stream_master_qid_arr: pointer to array with QIDs of master streams. - * @fw_major_version: major version of current loaded preboot. - * @fw_minor_version: minor version of current loaded preboot. + * @fw_inner_major_ver: the major of current loaded preboot inner version. + * @fw_inner_minor_ver: the minor of current loaded preboot inner version. * @dram_used_mem: current DRAM memory consumption. * @memory_scrub_val: the value to which the dram will be scrubbed to using cb scrub_device_dram * @timeout_jiffies: device CS timeout value. @@ -3412,8 +3412,8 @@ struct hl_device { struct hl_reset_info reset_info; u32 *stream_master_qid_arr; - u32 fw_major_version; - u32 fw_minor_version; + u32 fw_inner_major_ver; + u32 fw_inner_minor_ver; atomic64_t dram_used_mem; u64 memory_scrub_val; u64 timeout_jiffies; @@ -3549,7 +3549,7 @@ struct hl_ioctl_desc { static inline bool hl_is_fw_ver_below_1_9(struct hl_device *hdev) { - return (hdev->fw_major_version < 42); + return (hdev->fw_inner_major_ver < 42); } /*