Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Erlend Jacobsen" <erlendjacobsen@pm.me>, linux-input@vger.kernel.org
Cc: dmitry.torokhov@gmail.com
Subject: Re: [PATCH v4] HID: rdmctmzt: add RDMCTMZT keyboard battery driver
Date: Tue, 24 Nov 2026 06:25:44 +0000	[thread overview]
Message-ID: <sashiko-outbox-230592@kernel.org> (raw)
In-Reply-To: <20261124-b4-rdmctmzt-v4-1-9cb23d1ad876@pm.me>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] HID: rdmctmzt: failed 0xd0 poll with RDM_LINK_UNKNOWN treated
  as link down
--

commit 10ff773cbdbe0a54663e148f524ced35f821f2d3
Author: Erlend Jacobsen <erlendjacobsen@pm.me>

HID: rdmctmzt: add RDMCTMZT keyboard battery driver

This commit adds a HID driver for RDMCTMZT keyboards and their 2.4 GHz
dongles to poll battery status over their vendor raw-HID interface and
report the dongle's wireless link status.

> diff --git a/drivers/hid/hid-rdmctmzt.c b/drivers/hid/hid-rdmctmzt.c
> new file mode 100644
> index 0000000000000..391d7c934f5b4
> --- /dev/null
> +++ b/drivers/hid/hid-rdmctmzt.c
> @@ -0,0 +1,664 @@

[ ... ]

> +/* Only 0x02 rules out a link; the keyboard's answers decide the rest */
> +static bool rdm_link_may_be_up(u8 link)
> +{
> +	return link != RDM_LINK_NONE && link != RDM_LINK_UNKNOWN;
> +}

[ ... ]

> +/* The dongle's link byte, asked for now: an 0xd0 may have been missed */
> +static int rdm_dongle_linked(struct rdm_device *rdm, bool *linked)
> +{
> +	u8 reply[RDM_ANSWER_LEN];
> +	int ret;
> +
> +	/* rdm_raw_event() stores the link byte of the reply too */
> +	ret = rdm_command(rdm, RDM_DONGLE_STATUS, reply);
> +	if (ret == -ESHUTDOWN)
> +		return ret;
> +	if (ret)
> +		hid_dbg(rdm->hdev, "no link status: %d\n", ret);
> +
> +	scoped_guard(spinlock_irqsave, &rdm->lock) {
> +		*linked = rdm_link_may_be_up(rdm->link);
> +	}
> +	return 0;
> +}

[Severity: Medium]
If rdm_command() fails or times out while rdm->link is still
RDM_LINK_UNKNOWN (at initial probe or after rdm_reset_resume()), does
rdm_dongle_linked() treat the lost poll as an active RDM_LINK_NONE report
from the dongle?

Because rdm_link_may_be_up() returns false for RDM_LINK_UNKNOWN,
rdm_battery_work() takes the !linked path: after a reset_resume, a single
lost RDM_DONGLE_STATUS query immediately marks a present battery as not
present and sets wireless_status to disconnected, and at both probe and
reset_resume it delays the next poll for RDM_POLL_MS (60 s) instead of
retrying after RDM_RETRY_MS (5 s).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124-b4-rdmctmzt-v4-1-9cb23d1ad876@pm.me?part=1

      reply	other threads:[~2026-11-24  6:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  6:14 [PATCH v4] HID: rdmctmzt: add RDMCTMZT keyboard battery driver Erlend Jacobsen via B4 Relay
2026-11-24  6:25 ` sashiko-bot [this message]

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=sashiko-outbox-230592@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=erlendjacobsen@pm.me \
    --cc=linux-input@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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