linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock
@ 2022-09-30 14:54 Li Jun
  2022-09-30 14:54 ` [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk Li Jun
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Li Jun @ 2022-09-30 14:54 UTC (permalink / raw)
  To: sboyd, abelvesa
  Cc: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer, kernel,
	festevam, linux-imx, mturquette, l.stach, peng.fan,
	alexander.stein, gregkh, devicetree, linux-arm-kernel, linux-clk

usb suspend clock has a gate shared with usb_root_clk.

Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
Cc: stable@vger.kernel.org # v5.19+
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
---
 include/dt-bindings/clock/imx8mp-clock.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/dt-bindings/clock/imx8mp-clock.h b/include/dt-bindings/clock/imx8mp-clock.h
index 9d5cc2ddde89..1417b7b1b7df 100644
--- a/include/dt-bindings/clock/imx8mp-clock.h
+++ b/include/dt-bindings/clock/imx8mp-clock.h
@@ -324,8 +324,9 @@
 #define IMX8MP_CLK_CLKOUT2_SEL			317
 #define IMX8MP_CLK_CLKOUT2_DIV			318
 #define IMX8MP_CLK_CLKOUT2			319
+#define IMX8MP_CLK_USB_SUSP			320
 
-#define IMX8MP_CLK_END				320
+#define IMX8MP_CLK_END				321
 
 #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
 #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
-- 
2.34.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] 12+ messages in thread

* [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk
  2022-09-30 14:54 [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Li Jun
@ 2022-09-30 14:54 ` Li Jun
  2022-10-19  9:26   ` Jun Li
  2023-01-09 11:02   ` Abel Vesa
  2022-09-30 14:54 ` [PATCH v4 3/3] arm64: dts: imx8mp: correct usb clocks Li Jun
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ messages in thread
From: Li Jun @ 2022-09-30 14:54 UTC (permalink / raw)
  To: sboyd, abelvesa
  Cc: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer, kernel,
	festevam, linux-imx, mturquette, l.stach, peng.fan,
	alexander.stein, gregkh, devicetree, linux-arm-kernel, linux-clk

32K usb suspend clock gate is shared with usb_root_clk, this
shared clock gate was initially defined only for usb suspend
clock, usb suspend clk is kept on while system is active or
system sleep with usb wakeup enabled, so usb root clock is
fine with this situation; with the commit cf7f3f4fa9e5
("clk: imx8mp: fix usb_root_clk parent"), this clock gate is
changed to be for usb root clock, but usb root clock will
be off while usb is suspended, so usb suspend clock will be
gated too, this cause some usb functionalities will not work,
so define this clock to be a shared clock gate to conform with
the real HW status.

Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
Cc: stable@vger.kernel.org # v5.19+
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
---
change for v4:
- improve the commit log to explain why this is stable stuff.
 
 drivers/clk/imx/clk-imx8mp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
index e89db568f5a8..5b66514bdd0c 100644
--- a/drivers/clk/imx/clk-imx8mp.c
+++ b/drivers/clk/imx/clk-imx8mp.c
@@ -17,6 +17,7 @@
 
 static u32 share_count_nand;
 static u32 share_count_media;
+static u32 share_count_usb;
 
 static const char * const pll_ref_sels[] = { "osc_24m", "dummy", "dummy", "dummy", };
 static const char * const audio_pll1_bypass_sels[] = {"audio_pll1", "audio_pll1_ref_sel", };
@@ -673,7 +674,8 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
 	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
 	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
 	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
-	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
+	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0, &share_count_usb);
+	hws[IMX8MP_CLK_USB_SUSP] = imx_clk_hw_gate2_shared2("usb_suspend_clk", "osc_32k", ccm_base + 0x44d0, 0, &share_count_usb);
 	hws[IMX8MP_CLK_USB_PHY_ROOT] = imx_clk_hw_gate4("usb_phy_root_clk", "usb_phy_ref", ccm_base + 0x44f0, 0);
 	hws[IMX8MP_CLK_USDHC1_ROOT] = imx_clk_hw_gate4("usdhc1_root_clk", "usdhc1", ccm_base + 0x4510, 0);
 	hws[IMX8MP_CLK_USDHC2_ROOT] = imx_clk_hw_gate4("usdhc2_root_clk", "usdhc2", ccm_base + 0x4520, 0);
-- 
2.34.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] 12+ messages in thread

* [PATCH v4 3/3] arm64: dts: imx8mp: correct usb clocks
  2022-09-30 14:54 [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Li Jun
  2022-09-30 14:54 ` [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk Li Jun
@ 2022-09-30 14:54 ` Li Jun
  2022-12-31  6:01   ` Shawn Guo
  2022-11-21 15:56 ` [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Abel Vesa
  2023-01-09 11:02 ` Abel Vesa
  3 siblings, 1 reply; 12+ messages in thread
From: Li Jun @ 2022-09-30 14:54 UTC (permalink / raw)
  To: sboyd, abelvesa
  Cc: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer, kernel,
	festevam, linux-imx, mturquette, l.stach, peng.fan,
	alexander.stein, gregkh, devicetree, linux-arm-kernel, linux-clk

After commit cf7f3f4fa9e5 ("clk: imx8mp: fix usb_root_clk parent"),
usb_root_clk is no longer for suspend clock so update dts accordingly
to use right bus clock and suspend clock.

Fixes: fb8587a2c165 ("arm64: dtsi: imx8mp: add usb nodes")
Cc: stable@vger.kernel.org # v5.19+
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Li Jun <jun.li@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 522ab47426c3..c3dfeb4f4b15 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1169,7 +1169,7 @@ usb3_0: usb@32f10100 {
 			reg = <0x32f10100 0x8>,
 			      <0x381f0000 0x20>;
 			clocks = <&clk IMX8MP_CLK_HSIO_ROOT>,
-				 <&clk IMX8MP_CLK_USB_ROOT>;
+				 <&clk IMX8MP_CLK_USB_SUSP>;
 			clock-names = "hsio", "suspend";
 			interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
 			power-domains = <&hsio_blk_ctrl IMX8MP_HSIOBLK_PD_USB>;
@@ -1182,9 +1182,9 @@ usb3_0: usb@32f10100 {
 			usb_dwc3_0: usb@38100000 {
 				compatible = "snps,dwc3";
 				reg = <0x38100000 0x10000>;
-				clocks = <&clk IMX8MP_CLK_HSIO_AXI>,
+				clocks = <&clk IMX8MP_CLK_USB_ROOT>,
 					 <&clk IMX8MP_CLK_USB_CORE_REF>,
-					 <&clk IMX8MP_CLK_USB_ROOT>;
+					 <&clk IMX8MP_CLK_USB_SUSP>;
 				clock-names = "bus_early", "ref", "suspend";
 				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
 				phys = <&usb3_phy0>, <&usb3_phy0>;
@@ -1211,7 +1211,7 @@ usb3_1: usb@32f10108 {
 			reg = <0x32f10108 0x8>,
 			      <0x382f0000 0x20>;
 			clocks = <&clk IMX8MP_CLK_HSIO_ROOT>,
-				 <&clk IMX8MP_CLK_USB_ROOT>;
+				 <&clk IMX8MP_CLK_USB_SUSP>;
 			clock-names = "hsio", "suspend";
 			interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
 			power-domains = <&hsio_blk_ctrl IMX8MP_HSIOBLK_PD_USB>;
@@ -1224,9 +1224,9 @@ usb3_1: usb@32f10108 {
 			usb_dwc3_1: usb@38200000 {
 				compatible = "snps,dwc3";
 				reg = <0x38200000 0x10000>;
-				clocks = <&clk IMX8MP_CLK_HSIO_AXI>,
+				clocks = <&clk IMX8MP_CLK_USB_ROOT>,
 					 <&clk IMX8MP_CLK_USB_CORE_REF>,
-					 <&clk IMX8MP_CLK_USB_ROOT>;
+					 <&clk IMX8MP_CLK_USB_SUSP>;
 				clock-names = "bus_early", "ref", "suspend";
 				interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
 				phys = <&usb3_phy1>, <&usb3_phy1>;
-- 
2.34.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] 12+ messages in thread

* RE: [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk
  2022-09-30 14:54 ` [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk Li Jun
@ 2022-10-19  9:26   ` Jun Li
       [not found]     ` <20221027173919.12E23C433C1@smtp.kernel.org>
  2023-01-09 11:02   ` Abel Vesa
  1 sibling, 1 reply; 12+ messages in thread
From: Jun Li @ 2022-10-19  9:26 UTC (permalink / raw)
  To: sboyd, abelvesa
  Cc: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer, kernel,
	festevam, dl-linux-imx, mturquette, l.stach, Peng Fan,
	alexander.stein, gregkh, devicetree, linux-arm-kernel, linux-clk

Hi Stephen,

> -----Original Message-----
> From: Jun Li <jun.li@nxp.com>
> Sent: Friday, September 30, 2022 10:54 PM
> To: sboyd@kernel.org; abelvesa@kernel.org
> Cc: robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; dl-linux-imx <linux-imx@nxp.com>;
> mturquette@baylibre.com; l.stach@pengutronix.de; Peng Fan
> <peng.fan@nxp.com>; alexander.stein@ew.tq-group.com;
> gregkh@linuxfoundation.org; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-clk@vger.kernel.org
> Subject: [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend
> clk
> 
> 32K usb suspend clock gate is shared with usb_root_clk, this shared clock
> gate was initially defined only for usb suspend clock, usb suspend clk is
> kept on while system is active or system sleep with usb wakeup enabled, so
> usb root clock is fine with this situation; with the commit cf7f3f4fa9e5
> ("clk: imx8mp: fix usb_root_clk parent"), this clock gate is changed to be
> for usb root clock, but usb root clock will be off while usb is suspended,
> so usb suspend clock will be gated too, this cause some usb functionalities
> will not work, so define this clock to be a shared clock gate to conform
> with the real HW status.
> 
> Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
> Cc: stable@vger.kernel.org # v5.19+
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Signed-off-by: Li Jun <jun.li@nxp.com>

Is this version okay for you? 

Thanks
Li Jun

> ---
> change for v4:
> - improve the commit log to explain why this is stable stuff.
> 
>  drivers/clk/imx/clk-imx8mp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
> index e89db568f5a8..5b66514bdd0c 100644
> --- a/drivers/clk/imx/clk-imx8mp.c
> +++ b/drivers/clk/imx/clk-imx8mp.c
> @@ -17,6 +17,7 @@
> 
>  static u32 share_count_nand;
>  static u32 share_count_media;
> +static u32 share_count_usb;
> 
>  static const char * const pll_ref_sels[] = { "osc_24m", "dummy", "dummy",
> "dummy", };  static const char * const audio_pll1_bypass_sels[] =
> {"audio_pll1", "audio_pll1_ref_sel", }; @@ -673,7 +674,8 @@ static int
> imx8mp_clocks_probe(struct platform_device *pdev)
>  	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk",
> "uart2", ccm_base + 0x44a0, 0);
>  	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk",
> "uart3", ccm_base + 0x44b0, 0);
>  	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk",
> "uart4", ccm_base + 0x44c0, 0);
> -	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk",
> "hsio_axi", ccm_base + 0x44d0, 0);
> +	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk",
> "hsio_axi", ccm_base + 0x44d0, 0, &share_count_usb);
> +	hws[IMX8MP_CLK_USB_SUSP] =
> imx_clk_hw_gate2_shared2("usb_suspend_clk",
> +"osc_32k", ccm_base + 0x44d0, 0, &share_count_usb);
>  	hws[IMX8MP_CLK_USB_PHY_ROOT] = imx_clk_hw_gate4("usb_phy_root_clk",
> "usb_phy_ref", ccm_base + 0x44f0, 0);
>  	hws[IMX8MP_CLK_USDHC1_ROOT] = imx_clk_hw_gate4("usdhc1_root_clk",
> "usdhc1", ccm_base + 0x4510, 0);
>  	hws[IMX8MP_CLK_USDHC2_ROOT] = imx_clk_hw_gate4("usdhc2_root_clk",
> "usdhc2", ccm_base + 0x4520, 0);
> --
> 2.34.1


_______________________________________________
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] 12+ messages in thread

* Re: [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock
  2022-09-30 14:54 [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Li Jun
  2022-09-30 14:54 ` [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk Li Jun
  2022-09-30 14:54 ` [PATCH v4 3/3] arm64: dts: imx8mp: correct usb clocks Li Jun
@ 2022-11-21 15:56 ` Abel Vesa
  2022-11-25 10:55   ` Jun Li
  2023-01-09 11:02 ` Abel Vesa
  3 siblings, 1 reply; 12+ messages in thread
From: Abel Vesa @ 2022-11-21 15:56 UTC (permalink / raw)
  To: Li Jun
  Cc: sboyd, abelvesa, robh+dt, krzysztof.kozlowski+dt, shawnguo,
	s.hauer, kernel, festevam, linux-imx, mturquette, l.stach,
	peng.fan, alexander.stein, gregkh, devicetree, linux-arm-kernel,
	linux-clk

On 22-09-30 22:54:21, Li Jun wrote:
> usb suspend clock has a gate shared with usb_root_clk.
> 
> Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
> Cc: stable@vger.kernel.org # v5.19+
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Signed-off-by: Li Jun <jun.li@nxp.com>

Applied all. Thanks.

> ---
>  include/dt-bindings/clock/imx8mp-clock.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/dt-bindings/clock/imx8mp-clock.h b/include/dt-bindings/clock/imx8mp-clock.h
> index 9d5cc2ddde89..1417b7b1b7df 100644
> --- a/include/dt-bindings/clock/imx8mp-clock.h
> +++ b/include/dt-bindings/clock/imx8mp-clock.h
> @@ -324,8 +324,9 @@
>  #define IMX8MP_CLK_CLKOUT2_SEL			317
>  #define IMX8MP_CLK_CLKOUT2_DIV			318
>  #define IMX8MP_CLK_CLKOUT2			319
> +#define IMX8MP_CLK_USB_SUSP			320
>  
> -#define IMX8MP_CLK_END				320
> +#define IMX8MP_CLK_END				321
>  
>  #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
>  #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
> -- 
> 2.34.1
> 

_______________________________________________
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] 12+ messages in thread

* RE: [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock
  2022-11-21 15:56 ` [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Abel Vesa
@ 2022-11-25 10:55   ` Jun Li
  2022-11-25 15:23     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 12+ messages in thread
From: Jun Li @ 2022-11-25 10:55 UTC (permalink / raw)
  To: Abel Vesa
  Cc: sboyd, abelvesa, robh+dt, krzysztof.kozlowski+dt, shawnguo,
	s.hauer, kernel, festevam, dl-linux-imx, mturquette, l.stach,
	Peng Fan, alexander.stein, gregkh, devicetree, linux-arm-kernel,
	linux-clk



> -----Original Message-----
> From: Abel Vesa <abel.vesa@linaro.org>
> Sent: Monday, November 21, 2022 11:57 PM
> To: Jun Li <jun.li@nxp.com>
> Cc: sboyd@kernel.org; abelvesa@kernel.org; robh+dt@kernel.org;
> krzysztof.kozlowski+dt@linaro.org; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> dl-linux-imx <linux-imx@nxp.com>; mturquette@baylibre.com;
> l.stach@pengutronix.de; Peng Fan <peng.fan@nxp.com>;
> alexander.stein@ew.tq-group.com; gregkh@linuxfoundation.org;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-clk@vger.kernel.org
> Subject: Re: [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb
> suspend clock
> 
> On 22-09-30 22:54:21, Li Jun wrote:
> > usb suspend clock has a gate shared with usb_root_clk.
> >
> > Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
> > Cc: stable@vger.kernel.org # v5.19+
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > Signed-off-by: Li Jun <jun.li@nxp.com>
> 
> Applied all. Thanks.

Hi Abel,

Could you please also take the dts patch[1] in this series?
As the dts patch has a build dependency on the clk patches,
So Shawn suggested you take the dts patch too [2].

[1] https://www.spinics.net/lists/linux-clk/msg75904.html
[2] https://www.spinics.net/lists/arm-kernel/msg1013220.html

Thanks
Li Jun

> 
> > ---
> >  include/dt-bindings/clock/imx8mp-clock.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/dt-bindings/clock/imx8mp-clock.h
> b/include/dt-bindings/clock/imx8mp-clock.h
> > index 9d5cc2ddde89..1417b7b1b7df 100644
> > --- a/include/dt-bindings/clock/imx8mp-clock.h
> > +++ b/include/dt-bindings/clock/imx8mp-clock.h
> > @@ -324,8 +324,9 @@
> >  #define IMX8MP_CLK_CLKOUT2_SEL			317
> >  #define IMX8MP_CLK_CLKOUT2_DIV			318
> >  #define IMX8MP_CLK_CLKOUT2			319
> > +#define IMX8MP_CLK_USB_SUSP			320
> >
> > -#define IMX8MP_CLK_END				320
> > +#define IMX8MP_CLK_END				321
> >
> >  #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
> >  #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
> > --
> > 2.34.1
> >

_______________________________________________
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] 12+ messages in thread

* Re: [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock
  2022-11-25 10:55   ` Jun Li
@ 2022-11-25 15:23     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-25 15:23 UTC (permalink / raw)
  To: Jun Li, Abel Vesa
  Cc: sboyd, abelvesa, robh+dt, krzysztof.kozlowski+dt, shawnguo,
	s.hauer, kernel, festevam, dl-linux-imx, mturquette, l.stach,
	Peng Fan, alexander.stein, gregkh, devicetree, linux-arm-kernel,
	linux-clk

On 25/11/2022 11:55, Jun Li wrote:
> 
> 
>> -----Original Message-----
>> From: Abel Vesa <abel.vesa@linaro.org>
>> Sent: Monday, November 21, 2022 11:57 PM
>> To: Jun Li <jun.li@nxp.com>
>> Cc: sboyd@kernel.org; abelvesa@kernel.org; robh+dt@kernel.org;
>> krzysztof.kozlowski+dt@linaro.org; shawnguo@kernel.org;
>> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
>> dl-linux-imx <linux-imx@nxp.com>; mturquette@baylibre.com;
>> l.stach@pengutronix.de; Peng Fan <peng.fan@nxp.com>;
>> alexander.stein@ew.tq-group.com; gregkh@linuxfoundation.org;
>> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
>> linux-clk@vger.kernel.org
>> Subject: Re: [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb
>> suspend clock
>>
>> On 22-09-30 22:54:21, Li Jun wrote:
>>> usb suspend clock has a gate shared with usb_root_clk.
>>>
>>> Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
>>> Cc: stable@vger.kernel.org # v5.19+
>>> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
>>> Signed-off-by: Li Jun <jun.li@nxp.com>
>>
>> Applied all. Thanks.
> 
> Hi Abel,
> 
> Could you please also take the dts patch[1] in this series?
> As the dts patch has a build dependency on the clk patches,
> So Shawn suggested you take the dts patch too [2].
> 
> [1] https://www.spinics.net/lists/linux-clk/msg75904.html
> [2] https://www.spinics.net/lists/arm-kernel/msg1013220.html

DTS cannot go via driver tree. Share the header from DTS tree to driver
to solve it... or add defines to your DTS.

Best regards,
Krzysztof


_______________________________________________
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] 12+ messages in thread

* Re: [PATCH v4 3/3] arm64: dts: imx8mp: correct usb clocks
  2022-09-30 14:54 ` [PATCH v4 3/3] arm64: dts: imx8mp: correct usb clocks Li Jun
@ 2022-12-31  6:01   ` Shawn Guo
  0 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2022-12-31  6:01 UTC (permalink / raw)
  To: Li Jun
  Cc: sboyd, abelvesa, robh+dt, krzysztof.kozlowski+dt, s.hauer,
	kernel, festevam, linux-imx, mturquette, l.stach, peng.fan,
	alexander.stein, gregkh, devicetree, linux-arm-kernel, linux-clk

On Fri, Sep 30, 2022 at 10:54:23PM +0800, Li Jun wrote:
> After commit cf7f3f4fa9e5 ("clk: imx8mp: fix usb_root_clk parent"),
> usb_root_clk is no longer for suspend clock so update dts accordingly
> to use right bus clock and suspend clock.
> 
> Fixes: fb8587a2c165 ("arm64: dtsi: imx8mp: add usb nodes")
> Cc: stable@vger.kernel.org # v5.19+
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Acked-by: Shawn Guo <shawnguo@kernel.org>
> Signed-off-by: Li Jun <jun.li@nxp.com>

Applied, thanks!

_______________________________________________
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] 12+ messages in thread

* Re: [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk
       [not found]     ` <20221027173919.12E23C433C1@smtp.kernel.org>
@ 2023-01-09 10:52       ` Abel Vesa
  2023-01-09 11:04         ` Abel Vesa
  0 siblings, 1 reply; 12+ messages in thread
From: Abel Vesa @ 2023-01-09 10:52 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Jun Li, abelvesa, robh+dt, krzysztof.kozlowski+dt, shawnguo,
	s.hauer, kernel, festevam, dl-linux-imx, mturquette, l.stach,
	Peng Fan, alexander.stein, gregkh, devicetree, linux-arm-kernel,
	linux-clk

On 22-10-27 10:39:16, Stephen Boyd wrote:
> Quoting Jun Li (2022-10-19 02:26:00)
> > Hi Stephen,
> > 
> > > -----Original Message-----
> > > From: Jun Li <jun.li@nxp.com>
> > > Sent: Friday, September 30, 2022 10:54 PM
> > > To: sboyd@kernel.org; abelvesa@kernel.org
> > > Cc: robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org;
> > > shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> > > festevam@gmail.com; dl-linux-imx <linux-imx@nxp.com>;
> > > mturquette@baylibre.com; l.stach@pengutronix.de; Peng Fan
> > > <peng.fan@nxp.com>; alexander.stein@ew.tq-group.com;
> > > gregkh@linuxfoundation.org; devicetree@vger.kernel.org;
> > > linux-arm-kernel@lists.infradead.org; linux-clk@vger.kernel.org
> > > Subject: [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend
> > > clk
> > > 
> > > 32K usb suspend clock gate is shared with usb_root_clk, this shared clock
> > > gate was initially defined only for usb suspend clock, usb suspend clk is
> > > kept on while system is active or system sleep with usb wakeup enabled, so
> > > usb root clock is fine with this situation; with the commit cf7f3f4fa9e5
> > > ("clk: imx8mp: fix usb_root_clk parent"), this clock gate is changed to be
> > > for usb root clock, but usb root clock will be off while usb is suspended,
> > > so usb suspend clock will be gated too, this cause some usb functionalities
> > > will not work, so define this clock to be a shared clock gate to conform
> > > with the real HW status.
> > > 
> > > Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
> > > Cc: stable@vger.kernel.org # v5.19+
> > > Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > > Signed-off-by: Li Jun <jun.li@nxp.com>
> > 
> > Is this version okay for you? 
> > 
> 
> I thought that Abel was going to pick these up.

Oh, sorry, I thought the fixes will be picked up by you.

I'll apply it to my tree then.

_______________________________________________
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] 12+ messages in thread

* Re: [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock
  2022-09-30 14:54 [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Li Jun
                   ` (2 preceding siblings ...)
  2022-11-21 15:56 ` [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Abel Vesa
@ 2023-01-09 11:02 ` Abel Vesa
  3 siblings, 0 replies; 12+ messages in thread
From: Abel Vesa @ 2023-01-09 11:02 UTC (permalink / raw)
  To: Li Jun
  Cc: sboyd, abelvesa, robh+dt, krzysztof.kozlowski+dt, shawnguo,
	s.hauer, kernel, festevam, linux-imx, mturquette, l.stach,
	peng.fan, alexander.stein, gregkh, devicetree, linux-arm-kernel,
	linux-clk

On 22-09-30 22:54:21, Li Jun wrote:
> usb suspend clock has a gate shared with usb_root_clk.
> 
> Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
> Cc: stable@vger.kernel.org # v5.19+
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Signed-off-by: Li Jun <jun.li@nxp.com>

Reviewed-by: Abel Vesa <abel.vesa@linaro.org>

> ---
>  include/dt-bindings/clock/imx8mp-clock.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/dt-bindings/clock/imx8mp-clock.h b/include/dt-bindings/clock/imx8mp-clock.h
> index 9d5cc2ddde89..1417b7b1b7df 100644
> --- a/include/dt-bindings/clock/imx8mp-clock.h
> +++ b/include/dt-bindings/clock/imx8mp-clock.h
> @@ -324,8 +324,9 @@
>  #define IMX8MP_CLK_CLKOUT2_SEL			317
>  #define IMX8MP_CLK_CLKOUT2_DIV			318
>  #define IMX8MP_CLK_CLKOUT2			319
> +#define IMX8MP_CLK_USB_SUSP			320
>  
> -#define IMX8MP_CLK_END				320
> +#define IMX8MP_CLK_END				321
>  
>  #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG		0
>  #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1		1
> -- 
> 2.34.1
> 

_______________________________________________
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] 12+ messages in thread

* Re: [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk
  2022-09-30 14:54 ` [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk Li Jun
  2022-10-19  9:26   ` Jun Li
@ 2023-01-09 11:02   ` Abel Vesa
  1 sibling, 0 replies; 12+ messages in thread
From: Abel Vesa @ 2023-01-09 11:02 UTC (permalink / raw)
  To: Li Jun
  Cc: sboyd, abelvesa, robh+dt, krzysztof.kozlowski+dt, shawnguo,
	s.hauer, kernel, festevam, linux-imx, mturquette, l.stach,
	peng.fan, alexander.stein, gregkh, devicetree, linux-arm-kernel,
	linux-clk

On 22-09-30 22:54:22, Li Jun wrote:
> 32K usb suspend clock gate is shared with usb_root_clk, this
> shared clock gate was initially defined only for usb suspend
> clock, usb suspend clk is kept on while system is active or
> system sleep with usb wakeup enabled, so usb root clock is
> fine with this situation; with the commit cf7f3f4fa9e5
> ("clk: imx8mp: fix usb_root_clk parent"), this clock gate is
> changed to be for usb root clock, but usb root clock will
> be off while usb is suspended, so usb suspend clock will be
> gated too, this cause some usb functionalities will not work,
> so define this clock to be a shared clock gate to conform with
> the real HW status.
> 
> Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
> Cc: stable@vger.kernel.org # v5.19+
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Signed-off-by: Li Jun <jun.li@nxp.com>

Reviewed-by: Abel Vesa <abel.vesa@linaro.org>

> ---
> change for v4:
> - improve the commit log to explain why this is stable stuff.
>  
>  drivers/clk/imx/clk-imx8mp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
> index e89db568f5a8..5b66514bdd0c 100644
> --- a/drivers/clk/imx/clk-imx8mp.c
> +++ b/drivers/clk/imx/clk-imx8mp.c
> @@ -17,6 +17,7 @@
>  
>  static u32 share_count_nand;
>  static u32 share_count_media;
> +static u32 share_count_usb;
>  
>  static const char * const pll_ref_sels[] = { "osc_24m", "dummy", "dummy", "dummy", };
>  static const char * const audio_pll1_bypass_sels[] = {"audio_pll1", "audio_pll1_ref_sel", };
> @@ -673,7 +674,8 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
>  	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
>  	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
>  	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
> -	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
> +	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0, &share_count_usb);
> +	hws[IMX8MP_CLK_USB_SUSP] = imx_clk_hw_gate2_shared2("usb_suspend_clk", "osc_32k", ccm_base + 0x44d0, 0, &share_count_usb);
>  	hws[IMX8MP_CLK_USB_PHY_ROOT] = imx_clk_hw_gate4("usb_phy_root_clk", "usb_phy_ref", ccm_base + 0x44f0, 0);
>  	hws[IMX8MP_CLK_USDHC1_ROOT] = imx_clk_hw_gate4("usdhc1_root_clk", "usdhc1", ccm_base + 0x4510, 0);
>  	hws[IMX8MP_CLK_USDHC2_ROOT] = imx_clk_hw_gate4("usdhc2_root_clk", "usdhc2", ccm_base + 0x4520, 0);
> -- 
> 2.34.1
> 

_______________________________________________
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] 12+ messages in thread

* Re: [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk
  2023-01-09 10:52       ` Abel Vesa
@ 2023-01-09 11:04         ` Abel Vesa
  0 siblings, 0 replies; 12+ messages in thread
From: Abel Vesa @ 2023-01-09 11:04 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Jun Li, abelvesa, robh+dt, krzysztof.kozlowski+dt, shawnguo,
	s.hauer, kernel, festevam, dl-linux-imx, mturquette, l.stach,
	Peng Fan, alexander.stein, gregkh, devicetree, linux-arm-kernel,
	linux-clk

On 23-01-09 12:52:17, Abel Vesa wrote:
> On 22-10-27 10:39:16, Stephen Boyd wrote:
> > Quoting Jun Li (2022-10-19 02:26:00)
> > > Hi Stephen,
> > > 
> > > > -----Original Message-----
> > > > From: Jun Li <jun.li@nxp.com>
> > > > Sent: Friday, September 30, 2022 10:54 PM
> > > > To: sboyd@kernel.org; abelvesa@kernel.org
> > > > Cc: robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org;
> > > > shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> > > > festevam@gmail.com; dl-linux-imx <linux-imx@nxp.com>;
> > > > mturquette@baylibre.com; l.stach@pengutronix.de; Peng Fan
> > > > <peng.fan@nxp.com>; alexander.stein@ew.tq-group.com;
> > > > gregkh@linuxfoundation.org; devicetree@vger.kernel.org;
> > > > linux-arm-kernel@lists.infradead.org; linux-clk@vger.kernel.org
> > > > Subject: [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend
> > > > clk
> > > > 
> > > > 32K usb suspend clock gate is shared with usb_root_clk, this shared clock
> > > > gate was initially defined only for usb suspend clock, usb suspend clk is
> > > > kept on while system is active or system sleep with usb wakeup enabled, so
> > > > usb root clock is fine with this situation; with the commit cf7f3f4fa9e5
> > > > ("clk: imx8mp: fix usb_root_clk parent"), this clock gate is changed to be
> > > > for usb root clock, but usb root clock will be off while usb is suspended,
> > > > so usb suspend clock will be gated too, this cause some usb functionalities
> > > > will not work, so define this clock to be a shared clock gate to conform
> > > > with the real HW status.
> > > > 
> > > > Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver")
> > > > Cc: stable@vger.kernel.org # v5.19+
> > > > Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > > > Signed-off-by: Li Jun <jun.li@nxp.com>
> > > 
> > > Is this version okay for you? 
> > > 
> > 
> > I thought that Abel was going to pick these up.
> 
> Oh, sorry, I thought the fixes will be picked up by you.
> 
> I'll apply it to my tree then.

Ugrh, ignore this.

Already applied.

My inbox is messed up a bit right now.

Sorry about that.


_______________________________________________
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] 12+ messages in thread

end of thread, other threads:[~2023-01-09 11:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-30 14:54 [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Li Jun
2022-09-30 14:54 ` [PATCH v4 2/3] clk: imx: imx8mp: add shared clk gate for usb suspend clk Li Jun
2022-10-19  9:26   ` Jun Li
     [not found]     ` <20221027173919.12E23C433C1@smtp.kernel.org>
2023-01-09 10:52       ` Abel Vesa
2023-01-09 11:04         ` Abel Vesa
2023-01-09 11:02   ` Abel Vesa
2022-09-30 14:54 ` [PATCH v4 3/3] arm64: dts: imx8mp: correct usb clocks Li Jun
2022-12-31  6:01   ` Shawn Guo
2022-11-21 15:56 ` [PATCH v4 1/3] dt-bindings: clocks: imx8mp: Add ID for usb suspend clock Abel Vesa
2022-11-25 10:55   ` Jun Li
2022-11-25 15:23     ` Krzysztof Kozlowski
2023-01-09 11:02 ` Abel Vesa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).