All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
@ 2023-04-03  8:21 ` Peng Fan (OSS)
  0 siblings, 0 replies; 8+ messages in thread
From: Peng Fan (OSS) @ 2023-04-03  8:21 UTC (permalink / raw)
  To: abelvesa, mturquette, sboyd, shawnguo, s.hauer, kernel, festevam
  Cc: linux-imx, linux-clk, linux-arm-kernel, linux-kernel,
	Shengjiu Wang, Peng Fan

From: Shengjiu Wang <shengjiu.wang@nxp.com>

spdif clock is one of the asrc clock source, which is used
for ideal ratio mode. when set to 98.304MHz, it cause the
divider of asrc input clock and output clock exceed the
maximum value, and asrc driver saturate the value to maximum
value, which will cause the ASRC's performance very bad.
So we need to set spdif clock to a proper rate. which make asrc
divider not exceed maximum value, at least one of divider not
exceed maximum value.
The target is spdif clock rate / output(or input) sample rate
less than 1024(which is maximum divider).

Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V2:
 Add Fixes tag

 drivers/clk/imx/clk-imx6sx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
index 7cf86707bc39..3face052527d 100644
--- a/drivers/clk/imx/clk-imx6sx.c
+++ b/drivers/clk/imx/clk-imx6sx.c
@@ -520,7 +520,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
 	clk_set_rate(hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk, 393216000);
 
 	clk_set_parent(hws[IMX6SX_CLK_SPDIF_SEL]->clk, hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk);
-	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 98304000);
+	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 24576000);
 
 	clk_set_parent(hws[IMX6SX_CLK_AUDIO_SEL]->clk, hws[IMX6SX_CLK_PLL3_USB_OTG]->clk);
 	clk_set_rate(hws[IMX6SX_CLK_AUDIO_PODF]->clk, 24000000);
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
@ 2023-04-03  8:21 ` Peng Fan (OSS)
  0 siblings, 0 replies; 8+ messages in thread
From: Peng Fan (OSS) @ 2023-04-03  8:21 UTC (permalink / raw)
  To: abelvesa, mturquette, sboyd, shawnguo, s.hauer, kernel, festevam
  Cc: linux-imx, linux-clk, linux-arm-kernel, linux-kernel,
	Shengjiu Wang, Peng Fan

From: Shengjiu Wang <shengjiu.wang@nxp.com>

spdif clock is one of the asrc clock source, which is used
for ideal ratio mode. when set to 98.304MHz, it cause the
divider of asrc input clock and output clock exceed the
maximum value, and asrc driver saturate the value to maximum
value, which will cause the ASRC's performance very bad.
So we need to set spdif clock to a proper rate. which make asrc
divider not exceed maximum value, at least one of divider not
exceed maximum value.
The target is spdif clock rate / output(or input) sample rate
less than 1024(which is maximum divider).

Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V2:
 Add Fixes tag

 drivers/clk/imx/clk-imx6sx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
index 7cf86707bc39..3face052527d 100644
--- a/drivers/clk/imx/clk-imx6sx.c
+++ b/drivers/clk/imx/clk-imx6sx.c
@@ -520,7 +520,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
 	clk_set_rate(hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk, 393216000);
 
 	clk_set_parent(hws[IMX6SX_CLK_SPDIF_SEL]->clk, hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk);
-	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 98304000);
+	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 24576000);
 
 	clk_set_parent(hws[IMX6SX_CLK_AUDIO_SEL]->clk, hws[IMX6SX_CLK_PLL3_USB_OTG]->clk);
 	clk_set_rate(hws[IMX6SX_CLK_AUDIO_PODF]->clk, 24000000);
-- 
2.37.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
  2023-04-03  8:21 ` Peng Fan (OSS)
@ 2023-04-03  8:34   ` Ahmad Fatoum
  -1 siblings, 0 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2023-04-03  8:34 UTC (permalink / raw)
  To: Peng Fan (OSS),
	abelvesa, mturquette, sboyd, shawnguo, s.hauer, kernel, festevam
  Cc: Peng Fan, Shengjiu Wang, linux-kernel, linux-imx, linux-clk,
	linux-arm-kernel

Hello Peng,

On 03.04.23 10:21, Peng Fan (OSS) wrote:
> From: Shengjiu Wang <shengjiu.wang@nxp.com>
> 
> spdif clock is one of the asrc clock source, which is used
> for ideal ratio mode. when set to 98.304MHz, it cause the
> divider of asrc input clock and output clock exceed the
> maximum value, and asrc driver saturate the value to maximum
> value, which will cause the ASRC's performance very bad.
> So we need to set spdif clock to a proper rate. which make asrc
> divider not exceed maximum value, at least one of divider not
> exceed maximum value.
> The target is spdif clock rate / output(or input) sample rate
> less than 1024(which is maximum divider).
> 
> Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API")

Before referenced commit, it looked like this:

  clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000);

I think commit d55135689019 ("ARM: imx: add clock driver for imx6sx")
is what you're after.

Cheers,
Ahmad

> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> 
> V2:
>  Add Fixes tag
> 
>  drivers/clk/imx/clk-imx6sx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
> index 7cf86707bc39..3face052527d 100644
> --- a/drivers/clk/imx/clk-imx6sx.c
> +++ b/drivers/clk/imx/clk-imx6sx.c
> @@ -520,7 +520,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
>  	clk_set_rate(hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk, 393216000);
>  
>  	clk_set_parent(hws[IMX6SX_CLK_SPDIF_SEL]->clk, hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk);
> -	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 98304000);
> +	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 24576000);
>  
>  	clk_set_parent(hws[IMX6SX_CLK_AUDIO_SEL]->clk, hws[IMX6SX_CLK_PLL3_USB_OTG]->clk);
>  	clk_set_rate(hws[IMX6SX_CLK_AUDIO_PODF]->clk, 24000000);

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
@ 2023-04-03  8:34   ` Ahmad Fatoum
  0 siblings, 0 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2023-04-03  8:34 UTC (permalink / raw)
  To: Peng Fan (OSS),
	abelvesa, mturquette, sboyd, shawnguo, s.hauer, kernel, festevam
  Cc: Peng Fan, Shengjiu Wang, linux-kernel, linux-imx, linux-clk,
	linux-arm-kernel

Hello Peng,

On 03.04.23 10:21, Peng Fan (OSS) wrote:
> From: Shengjiu Wang <shengjiu.wang@nxp.com>
> 
> spdif clock is one of the asrc clock source, which is used
> for ideal ratio mode. when set to 98.304MHz, it cause the
> divider of asrc input clock and output clock exceed the
> maximum value, and asrc driver saturate the value to maximum
> value, which will cause the ASRC's performance very bad.
> So we need to set spdif clock to a proper rate. which make asrc
> divider not exceed maximum value, at least one of divider not
> exceed maximum value.
> The target is spdif clock rate / output(or input) sample rate
> less than 1024(which is maximum divider).
> 
> Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API")

Before referenced commit, it looked like this:

  clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000);

I think commit d55135689019 ("ARM: imx: add clock driver for imx6sx")
is what you're after.

Cheers,
Ahmad

> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> 
> V2:
>  Add Fixes tag
> 
>  drivers/clk/imx/clk-imx6sx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
> index 7cf86707bc39..3face052527d 100644
> --- a/drivers/clk/imx/clk-imx6sx.c
> +++ b/drivers/clk/imx/clk-imx6sx.c
> @@ -520,7 +520,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
>  	clk_set_rate(hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk, 393216000);
>  
>  	clk_set_parent(hws[IMX6SX_CLK_SPDIF_SEL]->clk, hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk);
> -	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 98304000);
> +	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 24576000);
>  
>  	clk_set_parent(hws[IMX6SX_CLK_AUDIO_SEL]->clk, hws[IMX6SX_CLK_PLL3_USB_OTG]->clk);
>  	clk_set_rate(hws[IMX6SX_CLK_AUDIO_PODF]->clk, 24000000);

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
  2023-04-03  8:34   ` Ahmad Fatoum
@ 2023-04-03  8:36     ` Peng Fan
  -1 siblings, 0 replies; 8+ messages in thread
From: Peng Fan @ 2023-04-03  8:36 UTC (permalink / raw)
  To: Ahmad Fatoum, Peng Fan (OSS),
	abelvesa, mturquette, sboyd, shawnguo, s.hauer, kernel, festevam
  Cc: S.J. Wang, linux-kernel, dl-linux-imx, linux-clk, linux-arm-kernel

> Subject: Re: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
> 
> Hello Peng,
> 
> On 03.04.23 10:21, Peng Fan (OSS) wrote:
> > From: Shengjiu Wang <shengjiu.wang@nxp.com>
> >
> > spdif clock is one of the asrc clock source, which is used for ideal
> > ratio mode. when set to 98.304MHz, it cause the divider of asrc input
> > clock and output clock exceed the maximum value, and asrc driver
> > saturate the value to maximum value, which will cause the ASRC's
> > performance very bad.
> > So we need to set spdif clock to a proper rate. which make asrc
> > divider not exceed maximum value, at least one of divider not exceed
> > maximum value.
> > The target is spdif clock rate / output(or input) sample rate less
> > than 1024(which is maximum divider).
> >
> > Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API")
> 
> Before referenced commit, it looked like this:
> 
>   clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000);
> 
> I think commit d55135689019 ("ARM: imx: add clock driver for imx6sx") is
> what you're after.

Should I add both the commits as Fixes? Or only the one your listed?

Thanks,
Peng.

> 
> Cheers,
> Ahmad
> 
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >
> > V2:
> >  Add Fixes tag
> >
> >  drivers/clk/imx/clk-imx6sx.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/imx/clk-imx6sx.c
> > b/drivers/clk/imx/clk-imx6sx.c index 7cf86707bc39..3face052527d 100644
> > --- a/drivers/clk/imx/clk-imx6sx.c
> > +++ b/drivers/clk/imx/clk-imx6sx.c
> > @@ -520,7 +520,7 @@ static void __init imx6sx_clocks_init(struct
> device_node *ccm_node)
> >  	clk_set_rate(hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk, 393216000);
> >
> >  	clk_set_parent(hws[IMX6SX_CLK_SPDIF_SEL]->clk,
> hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk);
> > -	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 98304000);
> > +	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 24576000);
> >
> >  	clk_set_parent(hws[IMX6SX_CLK_AUDIO_SEL]->clk,
> hws[IMX6SX_CLK_PLL3_USB_OTG]->clk);
> >  	clk_set_rate(hws[IMX6SX_CLK_AUDIO_PODF]->clk, 24000000);
> 
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       |
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> pengutronix.de%2F&data=05%7C01%7Cpeng.fan%40nxp.com%7Cc7131cb2
> 058346303de208db341e3824%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C
> 0%7C0%7C638161076614883851%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C30
> 00%7C%7C%7C&sdata=bmXiNAsD5SCoNrZF7pTgPFpjbColwBdBsO2qxR0KVO
> U%3D&reserved=0  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
@ 2023-04-03  8:36     ` Peng Fan
  0 siblings, 0 replies; 8+ messages in thread
From: Peng Fan @ 2023-04-03  8:36 UTC (permalink / raw)
  To: Ahmad Fatoum, Peng Fan (OSS),
	abelvesa, mturquette, sboyd, shawnguo, s.hauer, kernel, festevam
  Cc: S.J. Wang, linux-kernel, dl-linux-imx, linux-clk, linux-arm-kernel

> Subject: Re: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
> 
> Hello Peng,
> 
> On 03.04.23 10:21, Peng Fan (OSS) wrote:
> > From: Shengjiu Wang <shengjiu.wang@nxp.com>
> >
> > spdif clock is one of the asrc clock source, which is used for ideal
> > ratio mode. when set to 98.304MHz, it cause the divider of asrc input
> > clock and output clock exceed the maximum value, and asrc driver
> > saturate the value to maximum value, which will cause the ASRC's
> > performance very bad.
> > So we need to set spdif clock to a proper rate. which make asrc
> > divider not exceed maximum value, at least one of divider not exceed
> > maximum value.
> > The target is spdif clock rate / output(or input) sample rate less
> > than 1024(which is maximum divider).
> >
> > Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API")
> 
> Before referenced commit, it looked like this:
> 
>   clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000);
> 
> I think commit d55135689019 ("ARM: imx: add clock driver for imx6sx") is
> what you're after.

Should I add both the commits as Fixes? Or only the one your listed?

Thanks,
Peng.

> 
> Cheers,
> Ahmad
> 
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >
> > V2:
> >  Add Fixes tag
> >
> >  drivers/clk/imx/clk-imx6sx.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/imx/clk-imx6sx.c
> > b/drivers/clk/imx/clk-imx6sx.c index 7cf86707bc39..3face052527d 100644
> > --- a/drivers/clk/imx/clk-imx6sx.c
> > +++ b/drivers/clk/imx/clk-imx6sx.c
> > @@ -520,7 +520,7 @@ static void __init imx6sx_clocks_init(struct
> device_node *ccm_node)
> >  	clk_set_rate(hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk, 393216000);
> >
> >  	clk_set_parent(hws[IMX6SX_CLK_SPDIF_SEL]->clk,
> hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk);
> > -	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 98304000);
> > +	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 24576000);
> >
> >  	clk_set_parent(hws[IMX6SX_CLK_AUDIO_SEL]->clk,
> hws[IMX6SX_CLK_PLL3_USB_OTG]->clk);
> >  	clk_set_rate(hws[IMX6SX_CLK_AUDIO_PODF]->clk, 24000000);
> 
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       |
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> pengutronix.de%2F&data=05%7C01%7Cpeng.fan%40nxp.com%7Cc7131cb2
> 058346303de208db341e3824%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C
> 0%7C0%7C638161076614883851%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C30
> 00%7C%7C%7C&sdata=bmXiNAsD5SCoNrZF7pTgPFpjbColwBdBsO2qxR0KVO
> U%3D&reserved=0  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
  2023-04-03  8:36     ` Peng Fan
@ 2023-04-03  8:38       ` Ahmad Fatoum
  -1 siblings, 0 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2023-04-03  8:38 UTC (permalink / raw)
  To: Peng Fan, Peng Fan (OSS),
	abelvesa, mturquette, sboyd, shawnguo, s.hauer, kernel, festevam
  Cc: S.J. Wang, linux-clk, linux-kernel, linux-arm-kernel, dl-linux-imx

On 03.04.23 10:36, Peng Fan wrote:
>> Subject: Re: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
>>
>> Hello Peng,
>>
>> On 03.04.23 10:21, Peng Fan (OSS) wrote:
>>> From: Shengjiu Wang <shengjiu.wang@nxp.com>
>>>
>>> spdif clock is one of the asrc clock source, which is used for ideal
>>> ratio mode. when set to 98.304MHz, it cause the divider of asrc input
>>> clock and output clock exceed the maximum value, and asrc driver
>>> saturate the value to maximum value, which will cause the ASRC's
>>> performance very bad.
>>> So we need to set spdif clock to a proper rate. which make asrc
>>> divider not exceed maximum value, at least one of divider not exceed
>>> maximum value.
>>> The target is spdif clock rate / output(or input) sample rate less
>>> than 1024(which is maximum divider).
>>>
>>> Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API")
>>
>> Before referenced commit, it looked like this:
>>
>>   clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000);
>>
>> I think commit d55135689019 ("ARM: imx: add clock driver for imx6sx") is
>> what you're after.
> 
> Should I add both the commits as Fixes? Or only the one your listed?

AFAICS, f1541e15e38e introduced no functional change with regards to the
SPDIF clock, so you should only reference the original commit introducing
the issue you aim to resolve.

Cheers,
Ahmad

> 
> Thanks,
> Peng.
> 
>>
>> Cheers,
>> Ahmad
>>
>>> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>> ---
>>>
>>> V2:
>>>  Add Fixes tag
>>>
>>>  drivers/clk/imx/clk-imx6sx.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/clk/imx/clk-imx6sx.c
>>> b/drivers/clk/imx/clk-imx6sx.c index 7cf86707bc39..3face052527d 100644
>>> --- a/drivers/clk/imx/clk-imx6sx.c
>>> +++ b/drivers/clk/imx/clk-imx6sx.c
>>> @@ -520,7 +520,7 @@ static void __init imx6sx_clocks_init(struct
>> device_node *ccm_node)
>>>  	clk_set_rate(hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk, 393216000);
>>>
>>>  	clk_set_parent(hws[IMX6SX_CLK_SPDIF_SEL]->clk,
>> hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk);
>>> -	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 98304000);
>>> +	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 24576000);
>>>
>>>  	clk_set_parent(hws[IMX6SX_CLK_AUDIO_SEL]->clk,
>> hws[IMX6SX_CLK_PLL3_USB_OTG]->clk);
>>>  	clk_set_rate(hws[IMX6SX_CLK_AUDIO_PODF]->clk, 24000000);
>>
>> --
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       |
>> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
>> pengutronix.de%2F&data=05%7C01%7Cpeng.fan%40nxp.com%7Cc7131cb2
>> 058346303de208db341e3824%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C
>> 0%7C0%7C638161076614883851%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C30
>> 00%7C%7C%7C&sdata=bmXiNAsD5SCoNrZF7pTgPFpjbColwBdBsO2qxR0KVO
>> U%3D&reserved=0  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
@ 2023-04-03  8:38       ` Ahmad Fatoum
  0 siblings, 0 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2023-04-03  8:38 UTC (permalink / raw)
  To: Peng Fan, Peng Fan (OSS),
	abelvesa, mturquette, sboyd, shawnguo, s.hauer, kernel, festevam
  Cc: S.J. Wang, linux-clk, linux-kernel, linux-arm-kernel, dl-linux-imx

On 03.04.23 10:36, Peng Fan wrote:
>> Subject: Re: [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc
>>
>> Hello Peng,
>>
>> On 03.04.23 10:21, Peng Fan (OSS) wrote:
>>> From: Shengjiu Wang <shengjiu.wang@nxp.com>
>>>
>>> spdif clock is one of the asrc clock source, which is used for ideal
>>> ratio mode. when set to 98.304MHz, it cause the divider of asrc input
>>> clock and output clock exceed the maximum value, and asrc driver
>>> saturate the value to maximum value, which will cause the ASRC's
>>> performance very bad.
>>> So we need to set spdif clock to a proper rate. which make asrc
>>> divider not exceed maximum value, at least one of divider not exceed
>>> maximum value.
>>> The target is spdif clock rate / output(or input) sample rate less
>>> than 1024(which is maximum divider).
>>>
>>> Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API")
>>
>> Before referenced commit, it looked like this:
>>
>>   clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000);
>>
>> I think commit d55135689019 ("ARM: imx: add clock driver for imx6sx") is
>> what you're after.
> 
> Should I add both the commits as Fixes? Or only the one your listed?

AFAICS, f1541e15e38e introduced no functional change with regards to the
SPDIF clock, so you should only reference the original commit introducing
the issue you aim to resolve.

Cheers,
Ahmad

> 
> Thanks,
> Peng.
> 
>>
>> Cheers,
>> Ahmad
>>
>>> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>> ---
>>>
>>> V2:
>>>  Add Fixes tag
>>>
>>>  drivers/clk/imx/clk-imx6sx.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/clk/imx/clk-imx6sx.c
>>> b/drivers/clk/imx/clk-imx6sx.c index 7cf86707bc39..3face052527d 100644
>>> --- a/drivers/clk/imx/clk-imx6sx.c
>>> +++ b/drivers/clk/imx/clk-imx6sx.c
>>> @@ -520,7 +520,7 @@ static void __init imx6sx_clocks_init(struct
>> device_node *ccm_node)
>>>  	clk_set_rate(hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk, 393216000);
>>>
>>>  	clk_set_parent(hws[IMX6SX_CLK_SPDIF_SEL]->clk,
>> hws[IMX6SX_CLK_PLL4_AUDIO_DIV]->clk);
>>> -	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 98304000);
>>> +	clk_set_rate(hws[IMX6SX_CLK_SPDIF_PODF]->clk, 24576000);
>>>
>>>  	clk_set_parent(hws[IMX6SX_CLK_AUDIO_SEL]->clk,
>> hws[IMX6SX_CLK_PLL3_USB_OTG]->clk);
>>>  	clk_set_rate(hws[IMX6SX_CLK_AUDIO_PODF]->clk, 24000000);
>>
>> --
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       |
>> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
>> pengutronix.de%2F&data=05%7C01%7Cpeng.fan%40nxp.com%7Cc7131cb2
>> 058346303de208db341e3824%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C
>> 0%7C0%7C638161076614883851%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C30
>> 00%7C%7C%7C&sdata=bmXiNAsD5SCoNrZF7pTgPFpjbColwBdBsO2qxR0KVO
>> U%3D&reserved=0  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-03  8:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03  8:21 [PATCH V2] clk: imx: imx6sx: spdif clock rate is too high for asrc Peng Fan (OSS)
2023-04-03  8:21 ` Peng Fan (OSS)
2023-04-03  8:34 ` Ahmad Fatoum
2023-04-03  8:34   ` Ahmad Fatoum
2023-04-03  8:36   ` Peng Fan
2023-04-03  8:36     ` Peng Fan
2023-04-03  8:38     ` Ahmad Fatoum
2023-04-03  8:38       ` Ahmad Fatoum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.