From: William Breathitt Gray <wbg@kernel.org>
To: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Cc: "William Breathitt Gray" <wbg@kernel.org>,
"Biju Das" <biju.das.jz@bp.renesas.com>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
"Lee Jones" <lee@kernel.org>,
"Thierry Reding" <thierry.reding@gmail.com>,
linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 5/5] counter: rz-mtu3-cnt: do not use struct rz_mtu3_channel's dev member
Date: Sun, 22 Mar 2026 15:58:11 +0900 [thread overview]
Message-ID: <20260322065813.264398-1-wbg@kernel.org> (raw)
In-Reply-To: <20260130122353.2263273-6-cosmin-gabriel.tanislav.xa@renesas.com>
On Fri, Jan 30, 2026 at 02:23:53PM +0200, Cosmin Tanislav wrote:
> The counter driver can use HW channels 1 and 2, while the PWM driver can
> use HW channels 0, 1, 2, 3, 4, 6, 7.
>
> The dev member is assigned both by the counter driver and the PWM driver
> for channels 1 and 2, to their own struct device instance, overwriting
> the previous value.
>
> The sub-drivers race to assign their own struct device pointer to the
> same struct rz_mtu3_channel's dev member.
>
> The dev member of struct rz_mtu3_channel is used by the counter
> sub-driver for runtime PM.
>
> Depending on the probe order of the counter and PWM sub-drivers, the
> dev member may point to the wrong struct device instance, causing the
> counter sub-driver to do runtime PM actions on the wrong device.
>
> To fix this, use the parent pointer of the counter, which is assigned
> during probe to the correct struct device, not the struct device pointer
> inside the shared struct rz_mtu3_channel.
It looks like you replace every instance of ch->dev in the file,
except in rz_mtu3_cnt_probe where it is initially set as ch->dev = dev.
Is that line in rz_mtu3_cnt_probe still needed, or can it now be removed
too?
William Breathitt Gray
next prev parent reply other threads:[~2026-03-22 6:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260130122353.2263273-1-cosmin-gabriel.tanislav.xa@renesas.com>
2026-01-30 12:23 ` [PATCH 1/5] pwm: rz-mtu3: fix prescale check when enabling 2nd channel Cosmin Tanislav
2026-03-05 8:57 ` Uwe Kleine-König
2026-03-05 21:59 ` Cosmin-Gabriel Tanislav
2026-03-06 9:29 ` Uwe Kleine-König
2026-03-06 13:26 ` Cosmin-Gabriel Tanislav
2026-03-16 15:49 ` Cosmin-Gabriel Tanislav
2026-03-16 18:26 ` Geert Uytterhoeven
2026-03-16 19:12 ` Cosmin-Gabriel Tanislav
2026-03-17 8:23 ` Geert Uytterhoeven
2026-03-17 9:11 ` Uwe Kleine-König
2026-03-17 23:02 ` Cosmin-Gabriel Tanislav
2026-01-30 12:23 ` [PATCH 2/5] pwm: rz-mtu3: impose period restrictions Cosmin Tanislav
2026-01-30 12:23 ` [PATCH 3/5] pwm: rz-mtu3: correctly enable HW channel 4 and 7 Cosmin Tanislav
2026-01-30 12:23 ` [PATCH 4/5] counter: rz-mtu3-cnt: prevent counter from being toggled multiple times Cosmin Tanislav
2026-01-30 12:23 ` [PATCH 5/5] counter: rz-mtu3-cnt: do not use struct rz_mtu3_channel's dev member Cosmin Tanislav
2026-03-22 6:58 ` William Breathitt Gray [this message]
2026-03-22 18:57 ` Cosmin-Gabriel Tanislav
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=20260322065813.264398-1-wbg@kernel.org \
--to=wbg@kernel.org \
--cc=biju.das.jz@bp.renesas.com \
--cc=cosmin-gabriel.tanislav.xa@renesas.com \
--cc=lee@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=ukleinek@kernel.org \
/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