From: sashiko-bot@kernel.org
To: "Aleksandrs Vinarskis" <alex@vinarskis.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 2/3] platform: arm64: dell-xps-ec: new driver
Date: Sat, 01 Aug 2026 18:34:40 +0000 [thread overview]
Message-ID: <20260801183441.427F91F00ACA@smtp.kernel.org> (raw)
In-Reply-To: <20260801-dell-xps-9345-ec-v3-2-9f4bdb5a5dad@vinarskis.com>
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] System suspend and resume error paths permanently disable the thermal management polling loop.
- [High] Unacknowledged interrupt in dummy IRQ handler causes an interrupt storm.
- [Medium] Mismatch between thermistor profile initialization array and runtime temperature reporting commands.
- [Low] The `i2c_device_id` array uses a positional initializer instead of a named initializer.
--
--- Patch [2]: [PATCH v3 2/3] platform: arm64: dell-xps-ec: new driver ---
commit 552ca6978cc04ce4176db63b786af0637fffc44e
Author: Aleksandrs Vinarskis <alex@vinarskis.com>
platform: arm64: dell-xps-ec: new driver
Introduce EC driver for Dell XPS 13 9345 (codename 'tributo'). The driver
provides thermal management information to control fans and peripheral power.
> diff --git a/drivers/platform/arm64/dell-xps-ec.c b/drivers/platform/arm64/dell-xps-ec.c
> new file mode 100644
> index 0000000000000..7758f5dd93421
> --- /dev/null
> +++ b/drivers/platform/arm64/dell-xps-ec.c
[ ... ]
> +static const u8 dell_xps_ec_thermistor_profile[] = {
> + 0xff, 0x54,
> + 0x01, 0x00, 0x2b, /* sys_therm0 */
> + 0x02, 0x44, 0x2a, /* sys_therm1 */
> + 0x03, 0x44, 0x2b, /* sys_therm2 */
> + 0x04, 0x44, 0x28, /* sys_therm3 */
> + 0x05, 0x55, 0x2a, /* sys_therm4 */
> + 0x06, 0x44, 0x26, /* sys_therm5 */
> + 0x07, 0x44, 0x2b, /* sys_therm6 */
> +};
> +
> +/*
> + * Mapping from IIO channel name to EC command byte
> + */
> +static const struct {
> + const char *name;
> + u8 cmd;
> +} dell_xps_ec_therms[] = {
> + /* TODO: 0x01 is sent only occasionally, likely TZ98 or TZ4 */
> + { "sys_therm0", 0x02 },
> + { "sys_therm1", 0x03 },
> + { "sys_therm2", 0x04 },
> + { "sys_therm3", 0x05 },
> + { "sys_therm4", 0x06 },
> + { "sys_therm5", 0x07 },
> + { "sys_therm6", 0x08 },
> +};
[Severity: Medium]
Is there a mismatch between the thermistor profile initialization array and
the runtime commands?
The profile array configures thermistor IDs 0x01 through 0x07, but the
runtime temperature polling uses commands 0x02 through 0x08 for sys_therm0
through sys_therm6.
This leaves thermistor ID 0x08 uninitialized and seems to misalign the rest
of the IDs. Will this break the EC's cooling logic?
[ ... ]
> +static irqreturn_t dell_xps_ec_irq_handler(int irq, void *data)
> +{
> + struct dell_xps_ec *ec = data;
> +
> + /*
> + * TODO: IRQ is fired on lid-close. Follow Windows example to read out
> + * the thermistor thresholds and potentially fan speeds.
> + */
> + dev_info_ratelimited(ec->dev, "IRQ triggered! (irq=%d)\n", irq);
> +
> + return IRQ_HANDLED;
> +}
[Severity: High]
Could this cause an interrupt storm on level-triggered lines?
The handler returns IRQ_HANDLED without touching the hardware to clear the
interrupt source.
For level-triggered interrupts, returning IRQ_HANDLED unmasks the interrupt
line at the controller, which can cause it to immediately fire again and hang
the CPU in softirq/IRQ handling context.
[ ... ]
> +static int dell_xps_ec_suspend(struct device *dev)
> +{
> + struct dell_xps_ec *ec = dev_get_drvdata(dev);
> +
> + cancel_delayed_work_sync(&ec->temp_work);
> +
> + return dell_xps_ec_suspend_cmd(ec, true);
> +}
[Severity: High]
If dell_xps_ec_suspend_cmd() fails and aborts the system suspend, does this
permanently disable the thermal management polling loop?
The temp_work is cancelled but is not rescheduled on the error path. This
could lead to missing temperature updates to the EC, potentially causing
severe thermal throttling or overheating.
> +
> +/*
> + * Notify EC of resume
> + *
> + * This will undo the suspend actions
> + * Without the resume signal, device would wake up but be forced back into
> + * suspend by EC within seconds
> + */
> +static int dell_xps_ec_resume(struct device *dev)
> +{
> + struct dell_xps_ec *ec = dev_get_drvdata(dev);
> + int ret;
> +
> + ret = dell_xps_ec_suspend_cmd(ec, false);
> + if (ret)
> + return ret;
> +
> + schedule_delayed_work(&ec->temp_work, DELL_XPS_EC_TEMP_POLL_JIFFIES);
> + return 0;
> +}
[Severity: High]
Similarly, on resume, if dell_xps_ec_suspend_cmd() returns an error, the
function returns early and skips rescheduling the critical polling work.
Can this leave the device without thermal management after a transient
I2C error during power state transitions?
[ ... ]
> +static const struct i2c_device_id dell_xps_ec_i2c_id[] = {
> + { "dell-xps-ec" },
> + {}
> +};
[Severity: Low]
Should this use a named initializer?
The I2C subsystem guidelines require that initialized arrays of type
struct i2c_device_id must use named initializers rather than positional ones.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260801-dell-xps-9345-ec-v3-0-9f4bdb5a5dad@vinarskis.com?part=2
next prev parent reply other threads:[~2026-08-01 18:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 18:22 [PATCH v3 0/3] Introduce EC driver for Snapdragon X1E based Dell XPS 13 9345 Aleksandrs Vinarskis
2026-08-01 18:22 ` [PATCH v3 1/3] dt-bindings: platform: introduce EC for " Aleksandrs Vinarskis
2026-08-01 18:32 ` sashiko-bot
2026-08-01 18:48 ` Aleksandrs Vinarskis
2026-08-01 18:22 ` [PATCH v3 2/3] platform: arm64: dell-xps-ec: new driver Aleksandrs Vinarskis
2026-08-01 18:34 ` sashiko-bot [this message]
2026-08-01 21:15 ` Bryan O'Donoghue
2026-08-09 13:22 ` Aleksandrs Vinarskis
2026-08-01 18:22 ` [PATCH v3 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: introduce EC Aleksandrs Vinarskis
2026-08-01 18:43 ` sashiko-bot
2026-08-01 18:49 ` Aleksandrs Vinarskis
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=20260801183441.427F91F00ACA@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alex@vinarskis.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.