Re: [PATCH v3 02/25] i2c: designware: Fix PM calls order in dw_i2c_plat_probe()

From: Andy Shevchenko
Date: Wed Nov 15 2023 - 08:48:31 EST


On Wed, Nov 15, 2023 at 01:14:36PM +0200, Jarkko Nikula wrote:
> On 11/10/23 20:11, Andy Shevchenko wrote:
> > We should not mix managed calls with non-managed. This will break
> > the calls order at the error path and ->remove() stages. Fix this
> > by wrapping PM ops to become managed one.
> >
> > Fixes: 36d48fb5766a ("i2c: designware-platdrv: enable RuntimePM before registering to the core")
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> I fail to see what was broken in above commit and how this patch fixes it?

The order of the unwiding probed flow is broken now as devm_*() mixed with
non-devm_*() calls. This makes all non-devm_*() calls that interleave devm_*()
ones to be also devm_*()-wrapped.

...

> Is it intended change the reset isn't asserted after this patch in case
> i2c_dw_probe() fails?

Did you miss that this is become managed with this patch and hence the above
is false scenario?

--
With Best Regards,
Andy Shevchenko