Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alex Robinson" <alex@ironrobin.net>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/3] platform: arm64: Add Lenovo ThinkPad X13s EC driver
Date: Tue, 29 Sep 2026 19:43:42 +0000	[thread overview]
Message-ID: <20260929194342.BAB061F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260929192908.16507-3-alex@ironrobin.net>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] i2c: use of I2C_M_STOP without checking I2C_FUNC_PROTOCOL_MANGLING
--

commit 1d57af75b3833054240b9ba2eae495a1eff1ff60
Author: Alex Robinson <alex@ironrobin.net>

platform: arm64: Add Lenovo ThinkPad X13s EC driver

This commit adds support for the ThinkPad X13s embedded controller to expose
keyboard backlight control and hardware brightness change notifications. It
also preserves brightness across lid and system-sleep transitions.

> diff --git a/drivers/platform/arm64/lenovo-thinkpad-x13s.c b/drivers/platform/arm64/lenovo-thinkpad-x13s.c
> new file mode 100644
> index 0000000000000..4a7d5d0369095
> --- /dev/null
> +++ b/drivers/platform/arm64/lenovo-thinkpad-x13s.c
> @@ -0,0 +1,435 @@

[ ... ]

> +static int x13s_read(struct x13s_ec *ec, u8 cmd, u8 reg, u8 *value)
> +{
> +	struct i2c_client *client = ec->client;
> +	u8 buf[] = { cmd, reg, 0, 1 };
> +	struct i2c_msg request = {
> +		.addr = client->addr,
> +		.flags = I2C_M_STOP,

[Severity: Low]
Does this use of I2C_M_STOP require verifying adapter support first?

[ ... ]

> +static int x13s_probe(struct i2c_client *client)
> +{
> +	struct device *dev = &client->dev;
> +	struct x13s_ec *ec;
> +	int ret;
> +
> +	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
> +		return -EOPNOTSUPP;

[Severity: Low]
Is a check for I2C_FUNC_PROTOCOL_MANGLING missing here? x13s_probe() only
checks I2C_FUNC_I2C, but x13s_read() invokes __i2c_transfer() with the
I2C_M_STOP flag set. An adapter that does not support protocol mangling
might reject the transfer, causing I/O errors.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260929192908.16507-1-alex@ironrobin.net?part=2

  reply	other threads:[~2026-09-29 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 19:29 [PATCH v4 0/3] Lenovo ThinkPad X13s embedded controller support Alex Robinson
2026-09-29 19:29 ` [PATCH v4 1/3] dt-bindings: embedded-controller: Add Lenovo ThinkPad X13s EC Alex Robinson
2026-09-29 19:29 ` [PATCH v4 2/3] platform: arm64: Add Lenovo ThinkPad X13s EC driver Alex Robinson
2026-09-29 19:43   ` sashiko-bot [this message]
2026-09-30  6:38   ` Ilpo Järvinen
2026-09-29 19:29 ` [PATCH v4 3/3] arm64: dts: qcom: sc8280xp-x13s: Add embedded controller Alex Robinson

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=20260929194342.BAB061F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alex@ironrobin.net \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@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