From: sashiko-bot@kernel.org
To: "Andrea della Porta" <andrea.porta@suse.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v9 2/3] pwm: rp1: Add RP1 PWM controller driver
Date: Fri, 18 Sep 2026 10:08:31 +0000 [thread overview]
Message-ID: <20260918100832.0A3B31F000FF@smtp.kernel.org> (raw)
In-Reply-To: <22f454003902173a7230d0aee5fbd7261fcc163e.1789724999.git.andrea.porta@suse.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] lockdep: recursive locking splat in rp1_pwm_read_tachometer
--
commit 2891771f3f49717037220ec4f19e7c24529f99b5
Author: Naushir Patuck <naush@raspberrypi.com>
pwm: rp1: Add RP1 PWM controller driver
The Raspberry Pi RP1 southbridge features an embedded PWM controller with 4
output channels, alongside an RPM interface to read the fan speed on the
Raspberry Pi 5. This commit adds the supporting driver.
> diff --git a/drivers/pwm/pwm-rp1.c b/drivers/pwm/pwm-rp1.c
> new file mode 100644
> index 0000000000000..cfd38e46cc589
> --- /dev/null
> +++ b/drivers/pwm/pwm-rp1.c
[ ... ]
> +int rp1_pwm_read_tachometer(struct device *dev)
> +{
> + struct pwm_chip *chip;
> + struct rp1_pwm *rp1;
> + u32 tach_val;
> + int ret;
> +
> + if (!dev)
> + return -EINVAL;
> +
> + device_lock(dev);
> +
> + chip = dev_get_drvdata(dev);
[Severity: Medium]
Is it safe to call device_lock() inside this exported API?
When an external consumer (like a fan driver) calls this during its probe
or remove callbacks, the driver core already holds the consumer device's
lock. When this function then calls device_lock(), it acquires the PWM
device's lock.
Because both locks belong to the exact same default device lock class, this
sequence triggers a lockdep recursive locking splat.
Could this access be protected using the driver's own internal
synchronization (such as rp1->lock) instead of relying on the driver core's
device_lock()?
> + if (!chip) {
> + ret = -ENODEV;
> + goto err_dev_unlock;
> + }
> +
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1789724999.git.andrea.porta@suse.com?part=2
next prev parent reply other threads:[~2026-09-18 10:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 9:58 [PATCH v9 0/3] Add RP1 PWM controller support Andrea della Porta
2026-09-18 9:59 ` [PATCH v9 1/3] dt-bindings: pwm: Add Raspberry Pi RP1 PWM controller Andrea della Porta
2026-09-18 9:59 ` [PATCH v9 2/3] pwm: rp1: Add RP1 PWM controller driver Andrea della Porta
2026-09-18 10:08 ` sashiko-bot [this message]
2026-09-22 19:51 ` Gary Guo
2026-09-23 12:51 ` Andrea della Porta
2026-09-23 13:46 ` Gary Guo
2026-09-23 16:28 ` Andrea della Porta
2026-09-24 18:05 ` Gary Guo
2026-09-18 9:59 ` [PATCH v9 3/3] arm64: dts: broadcom: rpi-5: Add RP1 PWM node Andrea della Porta
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=20260918100832.0A3B31F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=andrea.porta@suse.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.