回复: [PATCH v7 2/2] hwrng: starfive: rework clk/reset teardown order for JHB100
From: Lianfeng Ouyang
Date: Fri Sep 04 2026 - 06:13:16 EST
> -----邮件原件-----
> 发件人: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> 发送时间: 2026年9月4日 17:24
> 收件人: Lianfeng Ouyang <lianfeng.ouyang@xxxxxxxxxxxxxxxx>
> 抄送: Olivia Mackall <olivia@xxxxxxxxxxx>; Rob Herring <robh@xxxxxxxxxx>;
> Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>; Conor Dooley
> <conor+dt@xxxxxxxxxx>; Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>;
> linux-crypto@xxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx
> 主题: Re: [PATCH v7 2/2] hwrng: starfive: rework clk/reset teardown order for
> JHB100
>
> On Wed, Aug 12, 2026 at 10:34:01AM +0800, lianfeng.ouyang wrote:
> > From: Lianfeng Ouyang <lianfeng.ouyang@xxxxxxxxxxxxxxxx>
> >
> > Rework the StarFive TRNG driver to address hardware-specific requirements
> > for JHB100 SoC. To avoid reset-domain crossing glitches, the driver now
> > ensures clocks are gated before asserting reset during teardown for
> > JHB100, while JH7110 retains the original reset-first sequence.
> >
> > Add per-compatible match data (struct starfive_trng_data) describing the
> > clock/reset teardown order, a new "starfive,jhb100-trng" compatible, and
> > select the ordering from it.
> >
> > Fix the runtime-PM get/put balancing across the init/read/reseed/cleanup
> > paths, manage PM and the clk/reset teardown via devm so all error paths
> > unwind correctly, run the SEU-triggered reseed from a workqueue instead
> > of hard IRQ, and serialise the command sequences with a mutex.
> >
> > Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@xxxxxxxxxxxxxxxx>
> > ---
> > MAINTAINERS | 2 +-
> > drivers/char/hw_random/jh7110-trng.c | 295
> +++++++++++++++++++++------
> > 2 files changed, 239 insertions(+), 58 deletions(-)
>
> Sashiko wasn't able to apply your patches. Please try rebasing
> and reposting.
>
> https://sashiko.dev/#/patchset/20260812023401.44149-1-lianfeng.ouyang%40s
> tarfivetech.com
>
> Thanks,
Thanks for the feedback. I will rebase my patches against the latest tree and repost them.
Best Regards,
Lianfeng Ouyang
> --
> Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt