mbox series

[v2,0/2] clk: imx93: Move IMX93_CLK_END macro to clk driver

Message ID 20240627082426.394937-1-pengfei.li_1@nxp.com (mailing list archive)
Headers show
Series clk: imx93: Move IMX93_CLK_END macro to clk driver | expand

Message

Pengfei Li June 27, 2024, 8:24 a.m. UTC
'IMX93_CLK_END' macro was previously defined in imx93-clock.h to
indicate the number of clocks, but it is not part of the ABI, so
it should be moved to clk driver.

---
Change for v2:
- Use pre-processor define to simplify code.
- link to v1: https://lore.kernel.org/all/20240625175147.94985-1-pengfei.li_1@nxp.com/

Pengfei Li (2):
  clk: imx93: Move IMX93_CLK_END macro to clk driver
  dt-bindings: clock: imx93: Drop IMX93_CLK_END macro definition

 drivers/clk/imx/clk-imx93.c             | 2 ++
 include/dt-bindings/clock/imx93-clock.h | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Abel Vesa Aug. 29, 2024, 7:07 a.m. UTC | #1
On 24-06-27 16:24:24, Pengfei Li wrote:
> 'IMX93_CLK_END' macro was previously defined in imx93-clock.h to
> indicate the number of clocks, but it is not part of the ABI, so
> it should be moved to clk driver.
> 

Right, why?

All other providers have been using the _CLK_END from the bindings
header. What is so special about this ? AFAICT, nothing.

> ---
> Change for v2:
> - Use pre-processor define to simplify code.
> - link to v1: https://lore.kernel.org/all/20240625175147.94985-1-pengfei.li_1@nxp.com/
> 
> Pengfei Li (2):
>   clk: imx93: Move IMX93_CLK_END macro to clk driver
>   dt-bindings: clock: imx93: Drop IMX93_CLK_END macro definition
> 
>  drivers/clk/imx/clk-imx93.c             | 2 ++
>  include/dt-bindings/clock/imx93-clock.h | 1 -
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> -- 
> 2.34.1
>
Krzysztof Kozlowski Sept. 20, 2024, 1:27 p.m. UTC | #2
On 29/08/2024 09:07, Abel Vesa wrote:
> On 24-06-27 16:24:24, Pengfei Li wrote:
>> 'IMX93_CLK_END' macro was previously defined in imx93-clock.h to
>> indicate the number of clocks, but it is not part of the ABI, so
>> it should be moved to clk driver.
>>
> 
> Right, why?
> 
> All other providers have been using the _CLK_END from the bindings
> header. What is so special about this ? AFAICT, nothing.

Because usually we do no consider number of clocks as an ABI. For
starters it does no really appear in DTS. But what's more important -
new clocks are described later, which contradicts this define. So either
this is an ABI or it is not. If it is, you are not allowed to add any
new clock. If it is not, then this should have never been part of bindings.

We did the same (removal of END/NUM macros) for several other platforms
already.

Best regards,
Krzysztof
Pengfei Li Sept. 21, 2024, 12:04 a.m. UTC | #3
On Thu, Aug 29, 2024 at 10:07:05AM +0300, Abel Vesa wrote:
> On 24-06-27 16:24:24, Pengfei Li wrote:
> > 'IMX93_CLK_END' macro was previously defined in imx93-clock.h to
> > indicate the number of clocks, but it is not part of the ABI, so
> > it should be moved to clk driver.
> > 
> 
> Right, why?
> 
> All other providers have been using the _CLK_END from the bindings
> header. What is so special about this ? AFAICT, nothing.
> 
> > ---
> > Change for v2:
> > - Use pre-processor define to simplify code.
> > - link to v1: https://lore.kernel.org/all/20240625175147.94985-1-pengfei.li_1@nxp.com/
> > 
> > Pengfei Li (2):
> >   clk: imx93: Move IMX93_CLK_END macro to clk driver
> >   dt-bindings: clock: imx93: Drop IMX93_CLK_END macro definition
> > 
> >  drivers/clk/imx/clk-imx93.c             | 2 ++
> >  include/dt-bindings/clock/imx93-clock.h | 1 -
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> > 
> > -- 
> > 2.34.1
> > 
> 

Hi Abel,

This is a modification based on previous comments: https://lore.kernel.org/all/20240604150447.GA604729-robh@kernel.org/
Actually, whether this _CLK_END macro change is added or not, both is ok for me.
I just want to add some new clocks to bindings header.

BR,
Pengfei Li
Pengfei Li Oct. 8, 2024, 7:47 p.m. UTC | #4
On Fri, Sep 20, 2024 at 05:04:19PM -0700, Pengfei Li wrote:
> On Thu, Aug 29, 2024 at 10:07:05AM +0300, Abel Vesa wrote:
> > On 24-06-27 16:24:24, Pengfei Li wrote:
> > > 'IMX93_CLK_END' macro was previously defined in imx93-clock.h to
> > > indicate the number of clocks, but it is not part of the ABI, so
> > > it should be moved to clk driver.
> > > 
> > 
> > Right, why?
> > 
> > All other providers have been using the _CLK_END from the bindings
> > header. What is so special about this ? AFAICT, nothing.
> > 
> > > ---
> > > Change for v2:
> > > - Use pre-processor define to simplify code.
> > > - link to v1: https://lore.kernel.org/all/20240625175147.94985-1-pengfei.li_1@nxp.com/
> > > 
> > > Pengfei Li (2):
> > >   clk: imx93: Move IMX93_CLK_END macro to clk driver
> > >   dt-bindings: clock: imx93: Drop IMX93_CLK_END macro definition
> > > 
> > >  drivers/clk/imx/clk-imx93.c             | 2 ++
> > >  include/dt-bindings/clock/imx93-clock.h | 1 -
> > >  2 files changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > -- 
> > > 2.34.1
> > > 
> > 
> 
> Hi Abel,
> 
> This is a modification based on previous comments: https://lore.kernel.org/all/20240604150447.GA604729-robh@kernel.org/
> Actually, whether this _CLK_END macro change is added or not, both is ok for me.
> I just want to add some new clocks to bindings header.
> 
> BR,
> Pengfei Li
> 

Hi Abel, you are the maintainer of clk-imx93.c, so if this patchset is ok,
could you help apply it. and then I will send subsequent patchset to add some new clocks.

BR,
Pengfei Li
Peng Fan Oct. 10, 2024, 10:58 a.m. UTC | #5
> Subject: Re: [PATCH v2 0/2] clk: imx93: Move IMX93_CLK_END macro
> to clk driver
> 
> On Fri, Sep 20, 2024 at 05:04:19PM -0700, Pengfei Li wrote:
> > On Thu, Aug 29, 2024 at 10:07:05AM +0300, Abel Vesa wrote:
> > > On 24-06-27 16:24:24, Pengfei Li wrote:
> > > > 'IMX93_CLK_END' macro was previously defined in imx93-clock.h
> to
> > > > indicate the number of clocks, but it is not part of the ABI, so
> > > > it should be moved to clk driver.
> > > >
> > >
> > > Right, why?
> > >
> > > All other providers have been using the _CLK_END from the
> bindings
> > > header. What is so special about this ? AFAICT, nothing.
> > >
> > > > ---
> > > > Change for v2:
> > > > - Use pre-processor define to simplify code.
> > > > - link to v1:
> > > > https://lore.kernel.org/all/20240625175147.94985-1-
> pengfei.li_1@nx
> > > > p.com/
> > > >
> > > > Pengfei Li (2):
> > > >   clk: imx93: Move IMX93_CLK_END macro to clk driver
> > > >   dt-bindings: clock: imx93: Drop IMX93_CLK_END macro
> definition
> > > >
> > > >  drivers/clk/imx/clk-imx93.c             | 2 ++
> > > >  include/dt-bindings/clock/imx93-clock.h | 1 -
> > > >  2 files changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > --
> > > > 2.34.1
> > > >
> > >
> >
> > Hi Abel,
> >
> > This is a modification based on previous comments:
> > https://lore.kernel.org/all/20240604150447.GA604729-
> robh@kernel.org/
> > Actually, whether this _CLK_END macro change is added or not, both
> is ok for me.
> > I just want to add some new clocks to bindings header.
> >
> > BR,
> > Pengfei Li
> >
> 
> Hi Abel, you are the maintainer of clk-imx93.c, so if this patchset is ok,
> could you help apply it. and then I will send subsequent patchset to
> add some new clocks.

There is no good way here. I think you v1 patch is fine:
https://lore.kernel.org/all/20240625175147.94985-2-pengfei.li_1@nxp.com/

Moving END to driver indeed is a bit weird.

Abel,

When you have time, please give a look at upper v1.
I not find a better way to drop _END from bindings.

Thanks,
Peng.

> 
> BR,
> Pengfei Li