Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4802275pxj; Tue, 22 Jun 2021 08:19:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuyqcRkf7gel6Buzm80nAwAPVPNL58H7anohO6MY1oo1ayGcXKDnuXLDZ8Fkd6PxGFY2qN X-Received: by 2002:a17:907:d92:: with SMTP id go18mr4590560ejc.317.1624375184489; Tue, 22 Jun 2021 08:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624375184; cv=none; d=google.com; s=arc-20160816; b=srgJWJXH52FglnsiPH+YYWAmoy5ROgb6lFXxtjD9d+P+6+r8u4HrqkFsPUjFC9I7lS Q4150X19oAdqQxRK8YNF4vBYK2ezGJ0zE/oAM0WSmCLWyBd5QkPPQQgiSgZ2v5PhDDah /j3Av2BGFNXkzuQsJalw2szp8cVT6FEgJgg5Y1iogSoIpNt9XL1btXSTXAKKbOQqEskT rOd+BjvE0wRv/RIg5OPSHqIbiow6MQDe92WgcRHmb0iX08zhVytDEIybKCthc1rhLdef OIhqOZQ46qp89uEar8T5E/GdRb8JWPUejXWRuJe4XZ8OS4g1PFE5hEWTaicfEryhfoSm ySSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=wCmMB3C3fqVQaVE184K9NbzZujmP7KvW4iYMV4Wxm5M=; b=dp3mIEOCQJHrGRspqM4581q8NWLcM+8kbr+YfTVZWofSYb+5rVwv/kg/oznz2YF5VM YEbYb7IBfjIBi1+ZtzsZ9u4QGax4rE3ysKHCeir1Hn6pHdwgj2tyiFxzZ/S9eGVc+5fg /CVnv7DK+CCfJIOFQhExvXUC0Jy1pa9c//IcyZ495r9OgYniF0nncMy2iL4x+lHtEMC6 WQgLqEsgTMW5o00dDn4HpRGh51RCtafluUTaPURyslzPi/EI+1lqS6nQfONlXSvAncOC QfgJ/ufYrx9aE2sopUirWUBSxronuaOZJFQu7EyZo2nSLCi+ZzEz2gMqiO3cplW+XWFS utnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l20si326731edr.191.2021.06.22.08.19.03; Tue, 22 Jun 2021 08:19:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231350AbhFVPSg (ORCPT + 99 others); Tue, 22 Jun 2021 11:18:36 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57269 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230047AbhFVPSe (ORCPT ); Tue, 22 Jun 2021 11:18:34 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lvi8H-00019K-1t; Tue, 22 Jun 2021 15:16:09 +0000 From: Colin King To: Giovanni Cabiddu , Herbert Xu , "David S . Miller" , Qinglang Miao , qat-linux@intel.com, linux-crypto@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: qat: ratelimit invalid ioctl message and print the invalid cmd Date: Tue, 22 Jun 2021 16:16:08 +0100 Message-Id: <20210622151608.23741-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Colin Ian King Currently incorrect QAT ioctls can spam the kernel log with error messages of the form "QAT: Invalid ioctl" if a userspace program uses the wrong ioctl command. Quench the messages by ratelimiting them and also print the invalid command being used as that is useful to know. Signed-off-by: Colin Ian King --- drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c b/drivers/crypto/qat/qat_common/adf_ctl_drv.c index 96b437bfe3de..6f64aa693146 100644 --- a/drivers/crypto/qat/qat_common/adf_ctl_drv.c +++ b/drivers/crypto/qat/qat_common/adf_ctl_drv.c @@ -406,7 +406,7 @@ static long adf_ctl_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) ret = adf_ctl_ioctl_get_status(fp, cmd, arg); break; default: - pr_err("QAT: Invalid ioctl\n"); + pr_err_ratelimited("QAT: Invalid ioctl %d\n", cmd); ret = -EFAULT; break; } -- 2.31.1