From patchwork Wed Mar 1 12:34:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13155918 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 970F9C64ED6 for ; Wed, 1 Mar 2023 12:35:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 556B510E22F; Wed, 1 Mar 2023 12:35:05 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF31810E22F for ; Wed, 1 Mar 2023 12:35:02 +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 ams.source.kernel.org (Postfix) with ESMTPS id A6879B81029; Wed, 1 Mar 2023 12:35:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C78FC433D2; Wed, 1 Mar 2023 12:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677674100; bh=3z2vuX9OeEtzEwQn4heGy9NK4W0pJgp70LJBu9Z5FoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gRtXIbuY+s7SO0girCle+3Sec+SWVvJATqpI1mRwHqj+FwBR2EMA6vAxIYMdhpV22 VR9D6AB+S/G4giU95ag8rK8/dbszTqARW4GtgTOL/eP81vEbYlWmEYSuroY4GY8Wte wS/LISlcLTTaQgtu7u+Hy65gcrML699yhPO9Yyjp5CEWxk+XYldFaFbAvPLslh6IB5 a/Xqg3hqh2I4KABr1IQPZvLiBokV5vPHnCyMdi52xwSGcF9S/c4f9aO29pHq9Hzwe5 IweTYpd8psjeowzPeVoCQ2AJ8kd3cEGj2oyWTqumfYv0F8b8fEQpCe96YGrDluhw9Z IlvcERpTGcvqA== From: Oded Gabbay To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/5] habanalabs: allow getting HL_INFO_DRAM_USAGE during soft-reset Date: Wed, 1 Mar 2023 14:34:49 +0200 Message-Id: <20230301123450.4127848-4-ogabbay@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230301123450.4127848-1-ogabbay@kernel.org> References: <20230301123450.4127848-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 can allow userspace to query the dram usage during soft-reset. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/habanalabs_ioctl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c index 100282fc82fc..0997ede359d7 100644 --- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c +++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c @@ -1002,6 +1002,8 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, case HL_INFO_FW_ERR_EVENT: return fw_err_info(hpriv, args); + case HL_INFO_DRAM_USAGE: + return dram_usage_info(hpriv, args); default: break; } @@ -1014,10 +1016,6 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, } switch (args->op) { - case HL_INFO_DRAM_USAGE: - rc = dram_usage_info(hpriv, args); - break; - case HL_INFO_HW_IDLE: rc = hw_idle(hdev, args); break;