From: Zhang Heng <zhangheng@kylinos.cn>
To: dmitry.torokhov@gmail.com, cryolitia.pukngae@linux.dev,
kees+treewide@kernel.org, DongLin_Lyu@outlook.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Zhang Heng <zhangheng@kylinos.cn>
Subject: [PATCH] Input: atkbd - rate-limit unknown key warnings
Date: Mon, 21 Sep 2026 21:19:34 +0800 [thread overview]
Message-ID: <20260921131934.677541-1-zhangheng@kylinos.cn> (raw)
Replace dev_warn() with dev_warn_ratelimited() for unmapped scancode
warnings, matching the existing rate-limited handling of spurious
ACK/NAK events in the same function.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221214
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
---
drivers/input/keyboard/atkbd.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 93650c98206d..26523329040b 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -497,13 +497,11 @@ static void atkbd_receive_byte(struct ps2dev *ps2dev, u8 data)
case ATKBD_KEY_NULL:
break;
case ATKBD_KEY_UNKNOWN:
- dev_warn(&serio->dev,
- "Unknown key %s (%s set %d, code %#x on %s).\n",
- atkbd->release ? "released" : "pressed",
- atkbd->translated ? "translated" : "raw",
- atkbd->set, code, serio->phys);
- dev_warn(&serio->dev,
- "Use 'setkeycodes %s%02x <keycode>' to make it known.\n",
- code & 0x80 ? "e0" : "", code & 0x7f);
+ dev_warn_ratelimited(&serio->dev,
+ "Unknown key %s (%s set %d, code %#x on %s); use 'setkeycodes %s%02x <keycode>' to make it known.\n",
+ atkbd->release ? "released" : "pressed",
+ atkbd->translated ? "translated" : "raw",
+ atkbd->set, code, serio->phys,
+ code & 0x80 ? "e0" : "", code & 0x7f);
input_sync(dev);
break;
--
2.25.1
next reply other threads:[~2026-09-21 13:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 13:19 Zhang Heng [this message]
2026-09-21 16:40 ` [PATCH] Input: atkbd - rate-limit unknown key warnings Dmitry Torokhov
2026-09-22 2:12 ` Zhang Heng
2026-09-22 3:38 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260921131934.677541-1-zhangheng@kylinos.cn \
--to=zhangheng@kylinos.cn \
--cc=DongLin_Lyu@outlook.com \
--cc=cryolitia.pukngae@linux.dev \
--cc=dmitry.torokhov@gmail.com \
--cc=kees+treewide@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox