From patchwork Mon May 22 11:25:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13250201 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 AC7DBC77B75 for ; Mon, 22 May 2023 11:26:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7CDA10E02B; Mon, 22 May 2023 11:26: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 9308E10E2D5 for ; Mon, 22 May 2023 11:25:59 +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 0B27661A28 for ; Mon, 22 May 2023 11:25:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAD97C433EF for ; Mon, 22 May 2023 11:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684754758; bh=361gGao6ac3Vqb7eZUYFJ8CAIZIdjpvzLKR0VlUa/6k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AvgrlThYqqAReytJluQSC0Iohf/UnIOZHceMw9+3KRInQgFL7/V018wAWOik2WBsx M0T3Xk5wf5RXmc/84GMhEH6Zrbf9M7KdbpcshANY2uF3XIHAnIhEbK1hIKPJ4ByrSx mYjDOEx++o6MM/jdfh+/wnJSnjk/MdbaJcCATr36O7Pf7P9HJX+pg7wytPthGFJwew TtOzcpS9JDk7O45RzGerXt9t+QHCXIxcCxS0WJ9Ecm6zdhPOJ3sr+Iv0uJhcwagaxP 8gj2s2nE+vfFYk62o/uk+mil8nN/UndqlYhkOTQrDTiGjh/XSXnP4iEOjMfzCPbf4Y ahAVPV7RpcCIg== From: Oded Gabbay To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/4] accel/habanalabs: move ioctl error print to debug level Date: Mon, 22 May 2023 14:25:48 +0300 Message-Id: <20230522112548.1577359-4-ogabbay@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522112548.1577359-1-ogabbay@kernel.org> References: <20230522112548.1577359-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 want to allow users to spam the kernel log and sending ioctls with bad opcodes is a sure way to do it. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton --- drivers/accel/habanalabs/common/habanalabs_ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c index 9a8be9395fb2..6a45a92344e9 100644 --- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c +++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c @@ -1195,7 +1195,7 @@ static long _hl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg, out_err: if (retcode) - dev_dbg(dev, "error in ioctl: pid=%d, cmd=0x%02x, nr=0x%02x\n", + dev_dbg_ratelimited(dev, "error in ioctl: pid=%d, cmd=0x%02x, nr=0x%02x\n", task_pid_nr(current), cmd, nr); if (kdata != stack_kdata) @@ -1219,7 +1219,7 @@ long hl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) if ((nr >= HL_COMMAND_START) && (nr < HL_COMMAND_END)) { ioctl = &hl_ioctls[nr]; } else { - dev_err(hdev->dev, "invalid ioctl: pid=%d, nr=0x%02x\n", + dev_dbg_ratelimited(hdev->dev, "invalid ioctl: pid=%d, nr=0x%02x\n", task_pid_nr(current), nr); return -ENOTTY; } @@ -1242,7 +1242,7 @@ long hl_ioctl_control(struct file *filep, unsigned int cmd, unsigned long arg) if (nr == _IOC_NR(HL_IOCTL_INFO)) { ioctl = &hl_ioctls_control[nr]; } else { - dev_err(hdev->dev_ctrl, "invalid ioctl: pid=%d, nr=0x%02x\n", + dev_dbg_ratelimited(hdev->dev_ctrl, "invalid ioctl: pid=%d, nr=0x%02x\n", task_pid_nr(current), nr); return -ENOTTY; }