From: sashiko-bot@kernel.org
To: "Miles Krause" <mileskrause5200@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH] Input: qt1050 - name calibration status bit
Date: Sat, 11 Jul 2026 01:19:02 +0000 [thread overview]
Message-ID: <20260711011903.0605C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260710-qt1050-calibration-status-bit-v1-1-e4f7d1d797b6@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The polling loop for calibration completion exits immediately because the break condition is inverted, potentially causing probe failure or aborted calibration.
--
--- Patch [1]: [PATCH] Input: qt1050 - name calibration status bit ---
commit 8a227bbb51956d6b0303c06859d65e498d26eb5f
Author: Miles Krause <mileskrause5200@gmail.com>
Input: qt1050 - name calibration status bit
This commit introduces a named constant for the calibration status bit 7
in the QT1050_DET_STATUS register. It replaces an open-coded shift and
comparison with this new constant in the calibration polling loop to
improve readability.
> diff --git a/drivers/input/keyboard/qt1050.c b/drivers/input/keyboard/qt1050.c
> index f9f480c910325..2371ac027aabd 100644
> --- a/drivers/input/keyboard/qt1050.c
> +++ b/drivers/input/keyboard/qt1050.c
[ ... ]
> @@ -498,7 +499,8 @@ static int qt1050_probe(struct i2c_client *client)
> return err;
> }
> err = regmap_read_poll_timeout(ts->regmap, QT1050_DET_STATUS, status,
> - status >> 7 == 1, 10000, 200000);
> + status & QT1050_DET_STATUS_CALIBRATE,
> + 10000, 200000);
[Severity: High]
This is a pre-existing issue, but does this polling condition in qt1050_probe()
wait for the calibration to complete or for it to start?
The regmap_read_poll_timeout() macro exits when the condition evaluates
to true. Since QT1050_DET_STATUS_CALIBRATE (bit 7) indicates calibration is
in progress, this condition is true while running and false when complete.
If calibration completes before the first read, won't this poll for the full
200ms timeout and return -ETIMEDOUT, causing the probe to fail? Alternatively,
if calibration is still running, won't this exit immediately and allow the
subsequent soft-reset to abort the calibration process?
Should this condition be inverted to check that the calibrate bit is cleared?
> if (err) {
> dev_err(dev, "Calibration failed: %d\n", err);
> return err;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260710-qt1050-calibration-status-bit-v1-1-e4f7d1d797b6@gmail.com?part=1
prev parent reply other threads:[~2026-07-11 1:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-11 1:09 [PATCH] Input: qt1050 - name calibration status bit Miles Krause via B4 Relay
2026-07-11 1:19 ` 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=20260711011903.0605C1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=mileskrause5200@gmail.com \
--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