Re: [PATCH 5.10 079/126] drm/tegra: sor: Grab runtime PM reference across reset

Pavel Machek
2021-04-06T19:14:59Z

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

Hi!

> > > However, these functions alone don't provide any guarantees at the
> > > system level. Drivers need to ensure that the only a single consumer has
> > > access to the reset at the same time. In order for the SOR to be able to
> > > exclusively access its reset, it must therefore ensure that the SOR
> > > power domain is not powered off by holding on to a runtime PM reference
> > > to that power domain across the reset assert/deassert operation.
> >
> > Yeah, but it should not leak the PM reference in the error handling.
>
> True. However the only reason why the code could realistically fail
> between pm_runtime_resume_and_get() and pm_runtime_put() is if we did
> not take the runtime PM reference (which would cause the call to
> reset_control_acquire() to fail).
>
> So the chances of this actually leaking are practically zero, so I
> didn't want to bloat this bugfix with what's essentially dead code. I
> can queue up your fix below for v5.14, though, since it's obviously
> more correct from a theoretical point of view.

Yes, that sounds like good solution, thanks!

Best regards,
Pavel

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]