RE: [PATCH 5.10.y-cip 14/23] PM: core: Add new *_PM_OPS macros, deprecate old ones

Biju Das
2023-05-23T14:06:20Z

Hi Pavel,

Thanks for the feedback.

> -----Original Message-----
> From: Pavel Machek <pavel@denx.de>
> Sent: Tuesday, May 23, 2023 2:20 PM
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: Pavel Machek <pavel@denx.de>; cip-dev@lists.cip-project.org;
> Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>; Chris Paterson
> <Chris.Paterson2@renesas.com>; Fabrizio Castro
> <fabrizio.castro.jz@renesas.com>
> Subject: Re: [PATCH 5.10.y-cip 14/23] PM: core: Add new *_PM_OPS macros,
> deprecate old ones
>
> Hi!
>
> > > > The callbacks that are only useful with CONFIG_PM_SLEEP is
> > > > enabled, are now also wrapped with a new pm_sleep_ptr() macro,
> > > > which is inspired from pm_ptr(). This is needed for drivers that
> > > > use different callbacks for sleep and runtime PM, to handle the
> > > > case where CONFIG_PM is set and CONFIG_PM_SLEEP is not.
> > > >
> > > > This commit also deprecates the following macros:
> > > >
> > > > SIMPLE_DEV_PM_OPS()
> > > > UNIVERSAL_DEV_PM_OPS()
> > > >
> > > > And introduces the following macros:
> > > >
> > > > DEFINE_SIMPLE_DEV_PM_OPS()
> > > > DEFINE_UNIVERSAL_DEV_PM_OPS()
> > >
> > > Changing interfaces / deprecating macros is not good thing to do in
> > > -cip kernel. How sure are we this will not cause build failures or
> > > build warnings in unrelated piece of code?
> >
> > Please see the commit [1] carefully,
> >
> > Deprecated is just a comment and it is just single header file change
> > and There is no existing macros changed.
>
> I'll need to look at the commit more carefuly.
>
> However previous patch redefines pm_ptr macro, which may have
> implications elsewhere. And indeed
>
> commit 5ef11c56b2332613cacd5e7ac17cfb1a073b66ab
> r8169: Avoid misuse of pm_ptr() macro
>
> is example of such effect, and we'd need to pick it up.

Oops missed it.

>
> I believe it would be less intrusive to make i2c driver work w/o core
> changes.

What is your suggestion for adding RZ/V2M driver support 5.10.y-cip?

Modify the original mainline driver by using the available PM macros in 5.10.y-cip ?

Or

Port commit 5ef11c56b2332613cacd5e7ac17cfb1a073b66ab as well??

Cheers,
Biju