From patchwork Tue Sep 26 08:13:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398817 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 7965EE7D24F for ; Tue, 26 Sep 2023 08:13:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA31410E364; Tue, 26 Sep 2023 08:13:53 +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 06DF210E0D0 for ; Tue, 26 Sep 2023 08:13:51 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 89E6C61326 for ; Tue, 26 Sep 2023 08:13:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61D96C433C8; Tue, 26 Sep 2023 08:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716030; bh=Y3Kww83IPJHuqjpVOClGOuciaIoTdLgIMjwrVTvKf5M=; h=From:To:Subject:Date:From; b=Rn5a+7AspmfXtoTSHXsUAzLzVE3YayWoPPQWyhlOx5inRPFJ7GARtANtPTanzv3ez PJFYWbji1Of41+wCUrv2iDqD77AMMP8A/cywW/coreI1znXQub64I5YRG9jHeZdeg2 BgtYBPbAxeC9Fn3Caab/s3AYdYmS8rTwJZdtZ2TWzDkj8xHXrPPLh53pEa/M2USDu5 +EksIkmCgaZafY2oynlt9bjgM7i9igGIvGf6vhlWZP6QLrxB+E2T5i0IbtqcTOcXWA z3bLxKDJbUbhyzpu/yFffCdnUlFy0mu2WG/Dswz3K0JPxd8UohqXDWnwo9BtxKWRrv FKD7PSFRYG3lA== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/9] accel/habanalabs: minor cosmetics update to cpucp_if.h Date: Tue, 26 Sep 2023 11:13:37 +0300 Message-Id: <20230926081345.240927-1-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" - Update copyright years - Align comments Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton --- include/linux/habanalabs/cpucp_if.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/include/linux/habanalabs/cpucp_if.h b/include/linux/habanalabs/cpucp_if.h index 84d74c4ee4d3..86ea7c63a0d2 100644 --- a/include/linux/habanalabs/cpucp_if.h +++ b/include/linux/habanalabs/cpucp_if.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 * - * Copyright 2020-2022 HabanaLabs, Ltd. + * Copyright 2020-2023 HabanaLabs, Ltd. * All Rights Reserved. * */ @@ -668,18 +668,15 @@ enum pq_init_status { * Obsolete. * * CPUCP_PACKET_GENERIC_PASSTHROUGH - - * Generic opcode for all firmware info that is only passed to host - * through the LKD, without getting parsed there. + * Generic opcode for all firmware info that is only passed to host + * through the LKD, without getting parsed there. * * CPUCP_PACKET_ACTIVE_STATUS_SET - * LKD sends FW indication whether device is free or in use, this indication is reported * also to the BMC. * - * CPUCP_PACKET_REGISTER_INTERRUPTS - - * Packet to register interrupts indicating LKD is ready to receive events from FW. - * * CPUCP_PACKET_SOFT_RESET - - * Packet to perform soft-reset. + * Packet to perform soft-reset. * * CPUCP_PACKET_INTS_REGISTER - * Packet to inform FW that queues have been established and LKD is ready to receive @@ -750,9 +747,9 @@ enum cpucp_packet_id { CPUCP_PACKET_RESERVED11, /* not used */ CPUCP_PACKET_RESERVED12, /* internal */ CPUCP_PACKET_RESERVED13, /* internal */ - CPUCP_PACKET_SOFT_RESET, /* internal */ - CPUCP_PACKET_INTS_REGISTER, /* internal */ - CPUCP_PACKET_ID_MAX /* must be last */ + CPUCP_PACKET_SOFT_RESET, /* internal */ + CPUCP_PACKET_INTS_REGISTER, /* internal */ + CPUCP_PACKET_ID_MAX /* must be last */ }; #define CPUCP_PACKET_FENCE_VAL 0xFE8CE7A5 From patchwork Tue Sep 26 08:13:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398818 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 6C945E7D24D for ; Tue, 26 Sep 2023 08:14:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 247A910E367; Tue, 26 Sep 2023 08:13:57 +0000 (UTC) Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B71410E0D0 for ; Tue, 26 Sep 2023 08:13:55 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 5889ACE0628 for ; Tue, 26 Sep 2023 08:13:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0309C433C9; Tue, 26 Sep 2023 08:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716031; bh=tr50ODn4xLi0WPzL73tIwSx34xkSXd0njW0b++RwK7A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Kq+5t1H1RqRZ7/wfRgoMtkAfWgZfRarFun74Y/EOoE/bL1/tbdSyOvbYZbQWVtHN9 o+3n+7m+0cr3Z2tzmMCDp5FGAAGDQPFJpTFZovNmIFDykj307HiaHew4HLkIIUXy4H mttE0LUr2Oi+c4RKzS6PdV1Vnlstva0pROLHRYXcZp7KWMIYWEly6ZKGOLnXL4tbzq lryQwjFv89mr28563UU0FssZbNdq+NGIDrGGyStsICfWDLnAAAXZlWS04KSXkTdsPQ zTGb8CR8D2a+822TYO7hw99/2AeF7wtiGYrdCIWEzdlRNuPZhgapdUuwU9zL/YVk4z Yrx5y/KwDlP/Q== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] accel/habanalabs: minor cosmetics update to trace file Date: Tue, 26 Sep 2023 11:13:38 +0300 Message-Id: <20230926081345.240927-2-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926081345.240927-1-ogabbay@kernel.org> References: <20230926081345.240927-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" - Update copyright years - Add missing newline at end of file Signed-off-by: Oded Gabbay --- include/trace/events/habanalabs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/trace/events/habanalabs.h b/include/trace/events/habanalabs.h index 0d3667399d01..cf85753a33b1 100644 --- a/include/trace/events/habanalabs.h +++ b/include/trace/events/habanalabs.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 * - * Copyright 2016-2021 HabanaLabs, Ltd. + * Copyright 2022-2023 HabanaLabs, Ltd. * All Rights Reserved. * */ @@ -209,3 +209,4 @@ DEFINE_EVENT(habanalabs_reg_access_template, habanalabs_elbi_write, /* This part must be outside protection */ #include + From patchwork Tue Sep 26 08:13:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398819 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 A1CACE7D24F for ; Tue, 26 Sep 2023 08:14:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D77A10E368; Tue, 26 Sep 2023 08:13:57 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id C862510E0D0 for ; Tue, 26 Sep 2023 08:13:53 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5133361326 for ; Tue, 26 Sep 2023 08:13:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B3F2C433CA; Tue, 26 Sep 2023 08:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716033; bh=0F0SAeCjM5+ld4tRE0MEkHClEX9ddoIr9GAust7RuEI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qMBDN/Frng2txPZQ96POwkshymQNiZsiNL/eiH2V5nCId37TqlVHUn8Pz3FI+2QxK yEU9NXTNJ7VVU+kC49pJ+WQamz0dNHC5CG8xES4R5cHkf+1joqbnX6maskCaWQ4kpg A+X88CJaEs6Vpb7wY21nTcOxBICBupwTmcTx99seieegPJY+/WZsST2ghVu9VUP8q9 pEHGzY0il/8ZfYJjXjaL7UJehwT2lfpglLJbbKRicoAAgpQhMZESqnCa+wIERQKk8Z SReIxHFAKaoIFp9mLh7QiE0277sHkQojACm16MdLw3CCw+RJQ2ane+ve+mjd4RcH2O 1v1zneVVX/Ztg== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/9] accel/habanalabs: change Greco to Gaudi2 Date: Tue, 26 Sep 2023 11:13:39 +0300 Message-Id: <20230926081345.240927-3-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926081345.240927-1-ogabbay@kernel.org> References: <20230926081345.240927-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Greco was not upstreamed so no point of mentioning it here. Signed-off-by: Oded Gabbay --- include/uapi/drm/habanalabs_accel.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/uapi/drm/habanalabs_accel.h b/include/uapi/drm/habanalabs_accel.h index dfe47db24ae6..347c7b62e60e 100644 --- a/include/uapi/drm/habanalabs_accel.h +++ b/include/uapi/drm/habanalabs_accel.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note * - * Copyright 2016-2022 HabanaLabs, Ltd. + * Copyright 2016-2023 HabanaLabs, Ltd. * All Rights Reserved. * */ @@ -885,11 +885,11 @@ enum hl_server_type { * @dram_enabled: Whether the DRAM is enabled. * @security_enabled: Whether security is enabled on device. * @mme_master_slave_mode: Indicate whether the MME is working in master/slave - * configuration. Relevant for Greco and later. + * configuration. Relevant for Gaudi2 and later. * @cpucp_version: The CPUCP f/w version. * @card_name: The card name as passed by the f/w. * @tpc_enabled_mask_ext: Bit-mask that represents which TPCs are enabled. - * Relevant for Greco and later. + * Relevant for Gaudi2 and later. * @dram_page_size: The DRAM physical page size. * @edma_enabled_mask: Bit-mask that represents which EDMAs are enabled. * Relevant for Gaudi2 and later. @@ -1425,7 +1425,7 @@ union hl_cb_args { * * HL_CS_CHUNK_FLAGS_USER_ALLOC_CB: * Indicates if the CB was allocated and mapped by userspace - * (relevant to greco and above). User allocated CB is a command buffer, + * (relevant to Gaudi2 and later). User allocated CB is a command buffer, * allocated by the user, via malloc (or similar). After allocating the * CB, the user invokes - “memory ioctl” to map the user memory into a * device virtual address. The user provides this address via the @@ -1450,7 +1450,7 @@ struct hl_cs_chunk { * a DRAM address of the internal CB. In Gaudi, this might also * represent a mapped host address of the CB. * - * Greco onwards: + * Gaudi2 onwards: * For H/W queue, this represents either a Handle of CB on the * Host, or an SRAM, a DRAM, or a mapped host address of the CB. * @@ -2227,7 +2227,7 @@ struct hl_debug_args { * internal. The driver will get completion notifications from the device only * on JOBS which are enqueued in the external queues. * - * Greco onwards: + * Gaudi2 onwards: * There is a single type of queue for all types of engines, either DMA engines * for transfers from/to the host or inside the device, or compute engines. * The driver will get completion notifications from the device for all queues. From patchwork Tue Sep 26 08:13:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398824 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 A381CE7D250 for ; Tue, 26 Sep 2023 08:14:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72FA610E36D; Tue, 26 Sep 2023 08:14:18 +0000 (UTC) Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2020610E0D0 for ; Tue, 26 Sep 2023 08:13:57 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 1DA4ACE1266 for ; Tue, 26 Sep 2023 08:13:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87DD9C433C8; Tue, 26 Sep 2023 08:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716034; bh=pKML1Q84Z5SEjVT09kSvwqPgs9xlFPfVVJN4cdzzSiI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WTZoA1A8l5GpeHggQBfByHd8MQSCG+dENDaAe1zxWoBY1epfBYB/7vbP7rzTPeYOD EC83++RQYMu2YtgMQJIJ4FlscHLj/Pnx+KBJY7ZU1hYTYZQskF6W1xUE6jddFG2sil RjdI/NBF7VfPZKF+DF5kAAYwImHD7Cp3BWh56L2eg3ial5iARtjJCojyVxWf+2pgOC VMC8tf3O9rncz8iS4uUb2PorvgNYXjFi04o0iwlGENge74rpp9Yb+sNlRLj2ngYXLg nROBqpk5n9J7/Z1XMUmzjfgbKA1idMdZaSLB5DlKyjCDcNC09aaUBSjGHWlIZkOHVX wnLlzppIhj9kw== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/9] accel/habanalabs/gaudi: remove unused structure definition Date: Tue, 26 Sep 2023 11:13:40 +0300 Message-Id: <20230926081345.240927-4-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926081345.240927-1-ogabbay@kernel.org> References: <20230926081345.240927-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" struct gaudi_nic_status is not used anywhere in the code. Signed-off-by: Oded Gabbay --- .../habanalabs/include/gaudi/gaudi_fw_if.h | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/drivers/accel/habanalabs/include/gaudi/gaudi_fw_if.h b/drivers/accel/habanalabs/include/gaudi/gaudi_fw_if.h index 2dba02757d37..a2547f306750 100644 --- a/drivers/accel/habanalabs/include/gaudi/gaudi_fw_if.h +++ b/drivers/accel/habanalabs/include/gaudi/gaudi_fw_if.h @@ -44,38 +44,6 @@ struct eq_nic_sei_event { __u8 pad[6]; }; -/* - * struct gaudi_nic_status - describes the status of a NIC port. - * @port: NIC port index. - * @bad_format_cnt: e.g. CRC. - * @responder_out_of_sequence_psn_cnt: e.g NAK. - * @high_ber_reinit_cnt: link reinit due to high BER. - * @correctable_err_cnt: e.g. bit-flip. - * @uncorrectable_err_cnt: e.g. MAC errors. - * @retraining_cnt: re-training counter. - * @up: is port up. - * @pcs_link: has PCS link. - * @phy_ready: is PHY ready. - * @auto_neg: is Autoneg enabled. - * @timeout_retransmission_cnt: timeout retransmission events - * @high_ber_cnt: high ber events - */ -struct gaudi_nic_status { - __u32 port; - __u32 bad_format_cnt; - __u32 responder_out_of_sequence_psn_cnt; - __u32 high_ber_reinit; - __u32 correctable_err_cnt; - __u32 uncorrectable_err_cnt; - __u32 retraining_cnt; - __u8 up; - __u8 pcs_link; - __u8 phy_ready; - __u8 auto_neg; - __u32 timeout_retransmission_cnt; - __u32 high_ber_cnt; -}; - struct gaudi_cold_rst_data { union { struct { From patchwork Tue Sep 26 08:13:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398825 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 D7049E7D24F for ; Tue, 26 Sep 2023 08:14:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2315910E370; Tue, 26 Sep 2023 08:14:19 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id F251A10E0D0 for ; Tue, 26 Sep 2023 08:13:57 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 7323FB80C66 for ; Tue, 26 Sep 2023 08:13:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3A31C433C7; Tue, 26 Sep 2023 08:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716035; bh=kovFpRcan5fPXYAx/LeKp5+4tn0cbVZMFIjVCi84H3s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DauZIdmLV6XvDKn1Zi6JhgBVcEwwstjxEzXkni7SQtCzFA01YKgc823ARNkcV4Tfn 7lYtiexYQ6BhD+BvBLNGfqqR9H5ksaUZPMbftwrw4ev855iqAa+uQ+DxWnn4rb4qJ/ pg0SQ6quqkTvIz5nwfxSRpiCpPsTReUXWHKW8ulQAvPw5Xw8A+RIeY6cVTIkaPd4Ob Vgw6YSp7N9Mzklzr27CE+t/kUWbCQYmGahVjVD7cqBOGgHTLFbr2Tba4nFsKNsRZ0E 6V/NY/BCHNR7tnJbCeDfXX/c1WMSemJm1vaJ4DUYJjho9FmzEkdQ0qLSAMpPEP7j0A CJrr6/r4tdAag== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/9] accel/habanalabs: remove unused field Date: Tue, 26 Sep 2023 11:13:41 +0300 Message-Id: <20230926081345.240927-5-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926081345.240927-1-ogabbay@kernel.org> References: <20230926081345.240927-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" flags in struct wait_interrupt_data is not used anywhere so remove it. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/command_submission.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c index 751d2c7d3fb8..e5ca490b7fca 100644 --- a/drivers/accel/habanalabs/common/command_submission.c +++ b/drivers/accel/habanalabs/common/command_submission.c @@ -47,7 +47,6 @@ struct wait_interrupt_data { u64 cq_offset; u64 target_value; u64 intr_timeout_us; - unsigned long flags; }; static void job_wq_completion(struct work_struct *work); From patchwork Tue Sep 26 08:13:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398821 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 5DBD8E7D24D for ; Tue, 26 Sep 2023 08:14:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9061B10E369; Tue, 26 Sep 2023 08:14:06 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id C83A910E0D0 for ; Tue, 26 Sep 2023 08:13:58 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2FDE661337 for ; Tue, 26 Sep 2023 08:13:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55A11C433C8; Tue, 26 Sep 2023 08:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716037; bh=c2byi9VLht35+07GvYDKXq5iwgVqSZPYJVjeHGyVh5I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=t29FIkWIvtQkJlTnlokSQ+55bAIH6AKaaMbKlt71yrSEBsjX10+d4hpCCv8/pnIXU gkYXDtOceKN9Cs0ijf5ILs+jgT0+TIUM2HTqbcvBtIAjmsRK83g6PwRxMX5OYa9qh3 mp9LdYSGGPJP2TLncpK/Snzb3n6kajL2C29tgSxh3SZ90MT4eNZ7RfC7TQ/T0zsddR hW56SNlnH6awedCxgRk+Ei/pX+ZUVZuuU6HwujS74bmDaiGtKoekWrtkk+fqQm83gf V5IN1497w3iy/cR28F6BnSRWz+DbVVumTosI97g32/nkg5PGnJWNa5vEys1KdsZ96+ ok6eilu97NOYA== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/9] accel/habanalabs: print device name when it is removed Date: Tue, 26 Sep 2023 11:13:42 +0300 Message-Id: <20230926081345.240927-6-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926081345.240927-1-ogabbay@kernel.org> References: <20230926081345.240927-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Notifies the user which device was removed. It is important in a server with multiple devices. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index b1d330cd2537..9711e8fc979d 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -2420,7 +2420,7 @@ void hl_device_fini(struct hl_device *hdev) u64 reset_sec; int i, rc; - dev_info(hdev->dev, "Removing device\n"); + dev_info(hdev->dev, "Removing device %s\n", dev_name(&(hdev)->pdev->dev)); hdev->device_fini_pending = 1; flush_delayed_work(&hdev->device_reset_work.reset_work); From patchwork Tue Sep 26 08:13:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398823 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 E5F32E7D24F for ; Tue, 26 Sep 2023 08:14:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39F8C10E36C; Tue, 26 Sep 2023 08:14:18 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F55710E0D0 for ; Tue, 26 Sep 2023 08:14:00 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id DB8C2B80FA0 for ; Tue, 26 Sep 2023 08:13:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B16E6C433C7; Tue, 26 Sep 2023 08:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716038; bh=b8JoGCZ+fQG0J2KkZ2rDS/O6LpZsi2zykWH7oEBRPBE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ptVd18rGlQAYTKLFtC6pJ2PZYZfFkDljPqar5Q8wDm1xaHdb4LGw1+j/EnIz7dmjy u2+AyooLP7Ueuhn5Aoz4j39MXqD0YNcO8IiMz9ooX45Mg63AC6+wuqDzTkfPYCIfrE DorC5K4wxftri4ejIhqGdI9fq0X293HgrKms+XSeTDFUv2yeAFMgV9vEXhB1GVIHD9 3UWJ/g/MdRYEOf/zL7FyJm0Z1XcNk2cf1lhUE6ERkvV/bwvel0N/F/iynbaSRjSV5p +017iPhZvgp2AG+N9MNPdw0/wLmVsmwSKs+ZfhKmE+R3G+1ARJ1r0SxpmITRN0j16t Tfpkog9lby6Sg== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/9] accel/habanalabs: remove leftover code Date: Tue, 26 Sep 2023 11:13:43 +0300 Message-Id: <20230926081345.240927-7-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926081345.240927-1-ogabbay@kernel.org> References: <20230926081345.240927-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This code was added as part of a bigger feature which was never upstreamed, so remove this code. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/command_submission.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c index e5ca490b7fca..4f7b70d9754c 100644 --- a/drivers/accel/habanalabs/common/command_submission.c +++ b/drivers/accel/habanalabs/common/command_submission.c @@ -1751,16 +1751,11 @@ static int hl_cs_ctx_switch(struct hl_fpriv *hpriv, union hl_cs_args *args, /* Need to wait for restore completion before execution phase */ if (num_chunks) { enum hl_cs_wait_status status; -wait_again: + ret = _hl_cs_wait_ioctl(hdev, ctx, jiffies_to_usecs(hdev->timeout_jiffies), *cs_seq, &status, NULL); if (ret) { - if (ret == -ERESTARTSYS) { - usleep_range(100, 200); - goto wait_again; - } - dev_err(hdev->dev, "Restore CS for context %d failed to complete %d\n", ctx->asid, ret); From patchwork Tue Sep 26 08:13:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398820 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 A0FF0E7D24F for ; Tue, 26 Sep 2023 08:14:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 50C3310E0D0; Tue, 26 Sep 2023 08:14:06 +0000 (UTC) Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB4C510E369 for ; Tue, 26 Sep 2023 08:14:02 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A6074CE1266 for ; Tue, 26 Sep 2023 08:14:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18B19C433CA; Tue, 26 Sep 2023 08:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716039; bh=Zj1LbCF+4qNSxbYeKTNC7s+VtkpmrrJmwaIr6viPOS0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NKwBwIkX+PbX7WRGiC1ezRUi5L+rofVbX4/U24pNvcZ2r9nDoOx+LTRwfW780fY9e OoiLolkibQYzcRwLH1E59VLwEI6Y5pTX7D+mPvNI/Ja9Wd45i1jOzfJTdeWF/R3SnX +iqWMcWfhlTdcHMtCIt9pf7QXDJwhWDHVNZR07JB9RsOqfWYEFPF9SYs8e1nSOGO0R xzHznsW/zcHX0kOrOugdpEueLZT54pcauYOlE8lT6178YtxXeJaX1BTlgvMWTWWKRJ ZkkIAnImLR+CbArfkFJn0SDEMcvnfe+4dCa/YsB9+bqEZwYl/oKSdmluQCymArjjQ7 wJNGz4pF0MM2w== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/9] accel/habanalabs/gaudi: remove define used for simulator Date: Tue, 26 Sep 2023 11:13:44 +0300 Message-Id: <20230926081345.240927-8-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926081345.240927-1-ogabbay@kernel.org> References: <20230926081345.240927-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We don't support simulator in upstream. Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 2 -- drivers/accel/habanalabs/gaudi/gaudi.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/drivers/accel/habanalabs/common/habanalabs.h index b1b1c51aa5b1..a8ccc04e7f92 100644 --- a/drivers/accel/habanalabs/common/habanalabs.h +++ b/drivers/accel/habanalabs/common/habanalabs.h @@ -85,8 +85,6 @@ struct hl_fpriv; #define HL_PCI_ELBI_TIMEOUT_MSEC 10 /* 10ms */ -#define HL_SIM_MAX_TIMEOUT_US 100000000 /* 100s */ - #define HL_INVALID_QUEUE UINT_MAX #define HL_COMMON_USER_CQ_INTERRUPT_ID 0xFFF diff --git a/drivers/accel/habanalabs/gaudi/gaudi.c b/drivers/accel/habanalabs/gaudi/gaudi.c index 31e04af46876..53292d4c15c8 100644 --- a/drivers/accel/habanalabs/gaudi/gaudi.c +++ b/drivers/accel/habanalabs/gaudi/gaudi.c @@ -4623,8 +4623,7 @@ static int gaudi_scrub_device_dram(struct hl_device *hdev, u64 val) static int gaudi_scrub_device_mem(struct hl_device *hdev) { struct asic_fixed_properties *prop = &hdev->asic_prop; - u64 wait_to_idle_time = hdev->pdev ? HBM_SCRUBBING_TIMEOUT_US : - min_t(u64, HBM_SCRUBBING_TIMEOUT_US * 10, HL_SIM_MAX_TIMEOUT_US); + u64 wait_to_idle_time = HBM_SCRUBBING_TIMEOUT_US; u64 addr, size, val = hdev->memory_scrub_val; ktime_t timeout; int rc = 0; From patchwork Tue Sep 26 08:13:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13398822 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 90243E7D250 for ; Tue, 26 Sep 2023 08:14:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC2E610E36A; Tue, 26 Sep 2023 08:14:06 +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 792DD10E0D0 for ; Tue, 26 Sep 2023 08:14:02 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EF5C761331 for ; Tue, 26 Sep 2023 08:14:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74B18C433C9; Tue, 26 Sep 2023 08:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695716041; bh=Wc6oOu7MTbbmpU3cjtCGSKKfAvkHPvs3/mMSRMDuGqc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IsaCXZ0U0jO0vTENmemGLv1pY/Id8z5utXMYhYursmphhjKqM8zOz/kwzXr6RhG76 pBw5UxrHRAq4cE8bgUyzmF5O09PofCQ4Gq8vV9DdX/YSNuWnz3WGjTlTN5qYtirfi8 5zUdvsTTdcTFZ0Xw3VjfC3p1K6kLIGApvT5Var4jrLKzRguO7wBbCuGJ3jEfZMMxK8 vSg00dydmO1MKm+iwDs0eTQYxlsS8jvQcJ3OJXtYDJs684965hIkEv3RVpoV86P5aC SX7ohOTF+GKu1j1U63Ny1YnrW5IMJwXOqpmBFXSe8joVj1lFG3WINulc17NdfyYo1Q bHIyAV2103tFg== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] accel/habanalabs: minor cosmetic update to habanalabs.h Date: Tue, 26 Sep 2023 11:13:45 +0300 Message-Id: <20230926081345.240927-9-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926081345.240927-1-ogabbay@kernel.org> References: <20230926081345.240927-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" - Update copyright years - Align fields in struct hl_userptr - Fix comments Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs.h | 31 ++++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/drivers/accel/habanalabs/common/habanalabs.h index a8ccc04e7f92..2a3acdbf9171 100644 --- a/drivers/accel/habanalabs/common/habanalabs.h +++ b/drivers/accel/habanalabs/common/habanalabs.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 * - * Copyright 2016-2022 HabanaLabs, Ltd. + * Copyright 2016-2023 HabanaLabs, Ltd. * All Rights Reserved. * */ @@ -553,8 +553,7 @@ struct hl_hints_range { * allocated with huge pages. * @hints_dram_reserved_va_range: dram hint addresses reserved range. * @hints_host_reserved_va_range: host hint addresses reserved range. - * @hints_host_hpage_reserved_va_range: host huge page hint addresses reserved - * range. + * @hints_host_hpage_reserved_va_range: host huge page hint addresses reserved range. * @sram_base_address: SRAM physical start address. * @sram_end_address: SRAM physical end address. * @sram_user_base_address - SRAM physical start address for user access. @@ -593,7 +592,7 @@ struct hl_hints_range { * @mmu_pte_size: PTE size in MMU page tables. * @mmu_hop_table_size: MMU hop table size. * @mmu_hop0_tables_total_size: total size of MMU hop0 tables. - * @dram_page_size: page size for MMU DRAM allocation. + * @dram_page_size: The DRAM physical page size. * @cfg_size: configuration space size on SRAM. * @sram_size: total size of SRAM. * @max_asid: maximum number of open contexts (ASIDs). @@ -695,7 +694,7 @@ struct hl_hints_range { * @configurable_stop_on_err: is stop-on-error option configurable via debugfs. * @set_max_power_on_device_init: true if need to set max power in F/W on device init. * @supports_user_set_page_size: true if user can set the allocation page size. - * @dma_mask: the dma mask to be set for this device + * @dma_mask: the dma mask to be set for this device. * @supports_advanced_cpucp_rc: true if new cpucp opcodes are supported. * @supports_engine_modes: true if changing engines/engine_cores modes is supported. * @support_dynamic_resereved_fw_size: true if we support dynamic reserved size for fw. @@ -1959,17 +1958,17 @@ struct hl_ctx_mgr { * @dma_mapped: true if the SG was mapped to DMA addresses, false otherwise. */ struct hl_userptr { - enum vm_type vm_type; /* must be first */ - struct list_head job_node; - struct page **pages; - unsigned int npages; - struct sg_table *sgt; - enum dma_data_direction dir; - struct list_head debugfs_list; - pid_t pid; - u64 addr; - u64 size; - u8 dma_mapped; + enum vm_type vm_type; /* must be first */ + struct list_head job_node; + struct page **pages; + unsigned int npages; + struct sg_table *sgt; + enum dma_data_direction dir; + struct list_head debugfs_list; + pid_t pid; + u64 addr; + u64 size; + u8 dma_mapped; }; /**