All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-03 20:04 ` Dmitry Rokosov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Rokosov @ 2023-07-03 20:04 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, sboyd, khilman, martin.blumenstingl
  Cc: jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Dmitry Rokosov, Jan Dakinevich

The function meson_clk_pll_enable() can be invoked under the enable_lock
spinlock from the clk core logic (please refer to
drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
during the usleep_range() call:

   BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
   Modules linked in: g_ffs usb_f_fs libcomposite
   CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
   Workqueue: events_unbound async_run_entry_fn
   Call trace:
    dump_backtrace+0x9c/0x128
    show_stack+0x20/0x38
    dump_stack_lvl+0x48/0x60
    dump_stack+0x18/0x28
    __schedule_bug+0x58/0x78
    __schedule+0x828/0xa88
    schedule+0x64/0xd8
    schedule_hrtimeout_range_clock+0xd0/0x208
    schedule_hrtimeout_range+0x1c/0x30
    usleep_range_state+0x6c/0xa8
    meson_clk_pll_enable+0x1f4/0x310
    clk_core_enable+0x78/0x200
    clk_core_enable+0x58/0x200
    clk_core_enable+0x58/0x200
    clk_core_enable+0x58/0x200
    clk_enable+0x34/0x60

Considering that this code is expected to be used in an atomic context,
it is required to use the udelay() function instead of usleep_range()
for the atomic context safety.

Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
---
 drivers/clk/meson/clk-pll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
index 56ec2210f1ad..eef6f37c8d8d 100644
--- a/drivers/clk/meson/clk-pll.c
+++ b/drivers/clk/meson/clk-pll.c
@@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
 	 * 3. enable the lock detect module
 	 */
 	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
-		usleep_range(10, 20);
+		udelay(10);
 		meson_parm_write(clk->map, &pll->current_en, 1);
-		usleep_range(40, 50);
+		udelay(40);
 	};
 
 	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
-- 
2.36.0


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

* [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-03 20:04 ` Dmitry Rokosov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Rokosov @ 2023-07-03 20:04 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, sboyd, khilman, martin.blumenstingl
  Cc: jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Dmitry Rokosov, Jan Dakinevich

The function meson_clk_pll_enable() can be invoked under the enable_lock
spinlock from the clk core logic (please refer to
drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
during the usleep_range() call:

   BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
   Modules linked in: g_ffs usb_f_fs libcomposite
   CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
   Workqueue: events_unbound async_run_entry_fn
   Call trace:
    dump_backtrace+0x9c/0x128
    show_stack+0x20/0x38
    dump_stack_lvl+0x48/0x60
    dump_stack+0x18/0x28
    __schedule_bug+0x58/0x78
    __schedule+0x828/0xa88
    schedule+0x64/0xd8
    schedule_hrtimeout_range_clock+0xd0/0x208
    schedule_hrtimeout_range+0x1c/0x30
    usleep_range_state+0x6c/0xa8
    meson_clk_pll_enable+0x1f4/0x310
    clk_core_enable+0x78/0x200
    clk_core_enable+0x58/0x200
    clk_core_enable+0x58/0x200
    clk_core_enable+0x58/0x200
    clk_enable+0x34/0x60

Considering that this code is expected to be used in an atomic context,
it is required to use the udelay() function instead of usleep_range()
for the atomic context safety.

Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
---
 drivers/clk/meson/clk-pll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
index 56ec2210f1ad..eef6f37c8d8d 100644
--- a/drivers/clk/meson/clk-pll.c
+++ b/drivers/clk/meson/clk-pll.c
@@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
 	 * 3. enable the lock detect module
 	 */
 	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
-		usleep_range(10, 20);
+		udelay(10);
 		meson_parm_write(clk->map, &pll->current_en, 1);
-		usleep_range(40, 50);
+		udelay(40);
 	};
 
 	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
-- 
2.36.0


_______________________________________________
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 v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-03 20:04 ` Dmitry Rokosov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Rokosov @ 2023-07-03 20:04 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, sboyd, khilman, martin.blumenstingl
  Cc: jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Dmitry Rokosov, Jan Dakinevich

The function meson_clk_pll_enable() can be invoked under the enable_lock
spinlock from the clk core logic (please refer to
drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
during the usleep_range() call:

   BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
   Modules linked in: g_ffs usb_f_fs libcomposite
   CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
   Workqueue: events_unbound async_run_entry_fn
   Call trace:
    dump_backtrace+0x9c/0x128
    show_stack+0x20/0x38
    dump_stack_lvl+0x48/0x60
    dump_stack+0x18/0x28
    __schedule_bug+0x58/0x78
    __schedule+0x828/0xa88
    schedule+0x64/0xd8
    schedule_hrtimeout_range_clock+0xd0/0x208
    schedule_hrtimeout_range+0x1c/0x30
    usleep_range_state+0x6c/0xa8
    meson_clk_pll_enable+0x1f4/0x310
    clk_core_enable+0x78/0x200
    clk_core_enable+0x58/0x200
    clk_core_enable+0x58/0x200
    clk_core_enable+0x58/0x200
    clk_enable+0x34/0x60

Considering that this code is expected to be used in an atomic context,
it is required to use the udelay() function instead of usleep_range()
for the atomic context safety.

Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
---
 drivers/clk/meson/clk-pll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
index 56ec2210f1ad..eef6f37c8d8d 100644
--- a/drivers/clk/meson/clk-pll.c
+++ b/drivers/clk/meson/clk-pll.c
@@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
 	 * 3. enable the lock detect module
 	 */
 	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
-		usleep_range(10, 20);
+		udelay(10);
 		meson_parm_write(clk->map, &pll->current_en, 1);
-		usleep_range(40, 50);
+		udelay(40);
 	};
 
 	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
-- 
2.36.0


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

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

* Re: [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context
  2023-07-03 20:04 ` Dmitry Rokosov
  (?)
@ 2023-07-04 19:43   ` Jerome Brunet
  -1 siblings, 0 replies; 12+ messages in thread
From: Jerome Brunet @ 2023-07-04 19:43 UTC (permalink / raw)
  To: Dmitry Rokosov, neil.armstrong, mturquette, sboyd, khilman,
	martin.blumenstingl
  Cc: jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich


On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:

> The function meson_clk_pll_enable() can be invoked under the enable_lock
> spinlock from the clk core logic

---
> (please refer to
> drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
> during the usleep_range() call:
>

This part of the comment is not very useful - please drop it

>    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
>    Modules linked in: g_ffs usb_f_fs libcomposite
>    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
>    Workqueue: events_unbound async_run_entry_fn
>    Call trace:
>     dump_backtrace+0x9c/0x128
>     show_stack+0x20/0x38
>     dump_stack_lvl+0x48/0x60
>     dump_stack+0x18/0x28
>     __schedule_bug+0x58/0x78
>     __schedule+0x828/0xa88
>     schedule+0x64/0xd8
>     schedule_hrtimeout_range_clock+0xd0/0x208
>     schedule_hrtimeout_range+0x1c/0x30
>     usleep_range_state+0x6c/0xa8
>     meson_clk_pll_enable+0x1f4/0x310
>     clk_core_enable+0x78/0x200
>     clk_core_enable+0x58/0x200
>     clk_core_enable+0x58/0x200
>     clk_core_enable+0x58/0x200
>     clk_enable+0x34/0x60
>
> Considering that this code is expected to be used in an atomic context,
> it is required to use the udelay() function instead of usleep_range()
> for the atomic context safety.

Please use an imperative form, instructing the code to change 

>
> Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
> Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>

The tags are confusing here
I suppose a 2 lines change has not be been written with 4 hands ;)

If Jan just reported and you made the change then drop his signed-off
If he did the job, then drop the reported-by and change the author

> ---
>  drivers/clk/meson/clk-pll.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
> index 56ec2210f1ad..eef6f37c8d8d 100644
> --- a/drivers/clk/meson/clk-pll.c
> +++ b/drivers/clk/meson/clk-pll.c
> @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
>  	 * 3. enable the lock detect module
>  	 */
>  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
> -		usleep_range(10, 20);
> +		udelay(10);
>  		meson_parm_write(clk->map, &pll->current_en, 1);
> -		usleep_range(40, 50);
> +		udelay(40);
>  	};
>  
>  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {


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

* Re: [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-04 19:43   ` Jerome Brunet
  0 siblings, 0 replies; 12+ messages in thread
From: Jerome Brunet @ 2023-07-04 19:43 UTC (permalink / raw)
  To: Dmitry Rokosov, neil.armstrong, mturquette, sboyd, khilman,
	martin.blumenstingl
  Cc: jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich


On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:

> The function meson_clk_pll_enable() can be invoked under the enable_lock
> spinlock from the clk core logic

---
> (please refer to
> drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
> during the usleep_range() call:
>

This part of the comment is not very useful - please drop it

>    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
>    Modules linked in: g_ffs usb_f_fs libcomposite
>    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
>    Workqueue: events_unbound async_run_entry_fn
>    Call trace:
>     dump_backtrace+0x9c/0x128
>     show_stack+0x20/0x38
>     dump_stack_lvl+0x48/0x60
>     dump_stack+0x18/0x28
>     __schedule_bug+0x58/0x78
>     __schedule+0x828/0xa88
>     schedule+0x64/0xd8
>     schedule_hrtimeout_range_clock+0xd0/0x208
>     schedule_hrtimeout_range+0x1c/0x30
>     usleep_range_state+0x6c/0xa8
>     meson_clk_pll_enable+0x1f4/0x310
>     clk_core_enable+0x78/0x200
>     clk_core_enable+0x58/0x200
>     clk_core_enable+0x58/0x200
>     clk_core_enable+0x58/0x200
>     clk_enable+0x34/0x60
>
> Considering that this code is expected to be used in an atomic context,
> it is required to use the udelay() function instead of usleep_range()
> for the atomic context safety.

Please use an imperative form, instructing the code to change 

>
> Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
> Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>

The tags are confusing here
I suppose a 2 lines change has not be been written with 4 hands ;)

If Jan just reported and you made the change then drop his signed-off
If he did the job, then drop the reported-by and change the author

> ---
>  drivers/clk/meson/clk-pll.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
> index 56ec2210f1ad..eef6f37c8d8d 100644
> --- a/drivers/clk/meson/clk-pll.c
> +++ b/drivers/clk/meson/clk-pll.c
> @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
>  	 * 3. enable the lock detect module
>  	 */
>  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
> -		usleep_range(10, 20);
> +		udelay(10);
>  		meson_parm_write(clk->map, &pll->current_en, 1);
> -		usleep_range(40, 50);
> +		udelay(40);
>  	};
>  
>  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {


_______________________________________________
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 v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-04 19:43   ` Jerome Brunet
  0 siblings, 0 replies; 12+ messages in thread
From: Jerome Brunet @ 2023-07-04 19:43 UTC (permalink / raw)
  To: Dmitry Rokosov, neil.armstrong, mturquette, sboyd, khilman,
	martin.blumenstingl
  Cc: jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich


On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:

> The function meson_clk_pll_enable() can be invoked under the enable_lock
> spinlock from the clk core logic

---
> (please refer to
> drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
> during the usleep_range() call:
>

This part of the comment is not very useful - please drop it

>    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
>    Modules linked in: g_ffs usb_f_fs libcomposite
>    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
>    Workqueue: events_unbound async_run_entry_fn
>    Call trace:
>     dump_backtrace+0x9c/0x128
>     show_stack+0x20/0x38
>     dump_stack_lvl+0x48/0x60
>     dump_stack+0x18/0x28
>     __schedule_bug+0x58/0x78
>     __schedule+0x828/0xa88
>     schedule+0x64/0xd8
>     schedule_hrtimeout_range_clock+0xd0/0x208
>     schedule_hrtimeout_range+0x1c/0x30
>     usleep_range_state+0x6c/0xa8
>     meson_clk_pll_enable+0x1f4/0x310
>     clk_core_enable+0x78/0x200
>     clk_core_enable+0x58/0x200
>     clk_core_enable+0x58/0x200
>     clk_core_enable+0x58/0x200
>     clk_enable+0x34/0x60
>
> Considering that this code is expected to be used in an atomic context,
> it is required to use the udelay() function instead of usleep_range()
> for the atomic context safety.

Please use an imperative form, instructing the code to change 

>
> Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
> Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>

The tags are confusing here
I suppose a 2 lines change has not be been written with 4 hands ;)

If Jan just reported and you made the change then drop his signed-off
If he did the job, then drop the reported-by and change the author

> ---
>  drivers/clk/meson/clk-pll.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
> index 56ec2210f1ad..eef6f37c8d8d 100644
> --- a/drivers/clk/meson/clk-pll.c
> +++ b/drivers/clk/meson/clk-pll.c
> @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
>  	 * 3. enable the lock detect module
>  	 */
>  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
> -		usleep_range(10, 20);
> +		udelay(10);
>  		meson_parm_write(clk->map, &pll->current_en, 1);
> -		usleep_range(40, 50);
> +		udelay(40);
>  	};
>  
>  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {


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

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

* Re: [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context
  2023-07-04 19:43   ` Jerome Brunet
  (?)
@ 2023-07-04 19:54     ` Dmitry Rokosov
  -1 siblings, 0 replies; 12+ messages in thread
From: Dmitry Rokosov @ 2023-07-04 19:54 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: neil.armstrong, mturquette, sboyd, khilman, martin.blumenstingl,
	jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich

Hello Jerome,

Thank you for the review!

On Tue, Jul 04, 2023 at 09:43:41PM +0200, Jerome Brunet wrote:
> 
> On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
> 
> > The function meson_clk_pll_enable() can be invoked under the enable_lock
> > spinlock from the clk core logic
> 
> ---
> > (please refer to
> > drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
> > during the usleep_range() call:
> >
> 
> This part of the comment is not very useful - please drop it
> 

Do you mean a stack trace or reference to clk_core_enable_lock()?

> >    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
> >    Modules linked in: g_ffs usb_f_fs libcomposite
> >    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
> >    Workqueue: events_unbound async_run_entry_fn
> >    Call trace:
> >     dump_backtrace+0x9c/0x128
> >     show_stack+0x20/0x38
> >     dump_stack_lvl+0x48/0x60
> >     dump_stack+0x18/0x28
> >     __schedule_bug+0x58/0x78
> >     __schedule+0x828/0xa88
> >     schedule+0x64/0xd8
> >     schedule_hrtimeout_range_clock+0xd0/0x208
> >     schedule_hrtimeout_range+0x1c/0x30
> >     usleep_range_state+0x6c/0xa8
> >     meson_clk_pll_enable+0x1f4/0x310
> >     clk_core_enable+0x78/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_enable+0x34/0x60
> >
> > Considering that this code is expected to be used in an atomic context,
> > it is required to use the udelay() function instead of usleep_range()
> > for the atomic context safety.
> 
> Please use an imperative form, instructing the code to change 
> 

Ack

> >
> > Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
> > Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> > Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> 
> The tags are confusing here
> I suppose a 2 lines change has not be been written with 4 hands ;)
> 
> If Jan just reported and you made the change then drop his signed-off
> If he did the job, then drop the reported-by and change the author
> 

No problem :) Sometimes 2 lines change is produced during 4 hands
debugging :)

> > ---
> >  drivers/clk/meson/clk-pll.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
> > index 56ec2210f1ad..eef6f37c8d8d 100644
> > --- a/drivers/clk/meson/clk-pll.c
> > +++ b/drivers/clk/meson/clk-pll.c
> > @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
> >  	 * 3. enable the lock detect module
> >  	 */
> >  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
> > -		usleep_range(10, 20);
> > +		udelay(10);
> >  		meson_parm_write(clk->map, &pll->current_en, 1);
> > -		usleep_range(40, 50);
> > +		udelay(40);
> >  	};
> >  
> >  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
> 

-- 
Thank you,
Dmitry

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

* Re: [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-04 19:54     ` Dmitry Rokosov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Rokosov @ 2023-07-04 19:54 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: neil.armstrong, mturquette, sboyd, khilman, martin.blumenstingl,
	jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich

Hello Jerome,

Thank you for the review!

On Tue, Jul 04, 2023 at 09:43:41PM +0200, Jerome Brunet wrote:
> 
> On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
> 
> > The function meson_clk_pll_enable() can be invoked under the enable_lock
> > spinlock from the clk core logic
> 
> ---
> > (please refer to
> > drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
> > during the usleep_range() call:
> >
> 
> This part of the comment is not very useful - please drop it
> 

Do you mean a stack trace or reference to clk_core_enable_lock()?

> >    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
> >    Modules linked in: g_ffs usb_f_fs libcomposite
> >    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
> >    Workqueue: events_unbound async_run_entry_fn
> >    Call trace:
> >     dump_backtrace+0x9c/0x128
> >     show_stack+0x20/0x38
> >     dump_stack_lvl+0x48/0x60
> >     dump_stack+0x18/0x28
> >     __schedule_bug+0x58/0x78
> >     __schedule+0x828/0xa88
> >     schedule+0x64/0xd8
> >     schedule_hrtimeout_range_clock+0xd0/0x208
> >     schedule_hrtimeout_range+0x1c/0x30
> >     usleep_range_state+0x6c/0xa8
> >     meson_clk_pll_enable+0x1f4/0x310
> >     clk_core_enable+0x78/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_enable+0x34/0x60
> >
> > Considering that this code is expected to be used in an atomic context,
> > it is required to use the udelay() function instead of usleep_range()
> > for the atomic context safety.
> 
> Please use an imperative form, instructing the code to change 
> 

Ack

> >
> > Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
> > Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> > Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> 
> The tags are confusing here
> I suppose a 2 lines change has not be been written with 4 hands ;)
> 
> If Jan just reported and you made the change then drop his signed-off
> If he did the job, then drop the reported-by and change the author
> 

No problem :) Sometimes 2 lines change is produced during 4 hands
debugging :)

> > ---
> >  drivers/clk/meson/clk-pll.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
> > index 56ec2210f1ad..eef6f37c8d8d 100644
> > --- a/drivers/clk/meson/clk-pll.c
> > +++ b/drivers/clk/meson/clk-pll.c
> > @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
> >  	 * 3. enable the lock detect module
> >  	 */
> >  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
> > -		usleep_range(10, 20);
> > +		udelay(10);
> >  		meson_parm_write(clk->map, &pll->current_en, 1);
> > -		usleep_range(40, 50);
> > +		udelay(40);
> >  	};
> >  
> >  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
> 

-- 
Thank you,
Dmitry

_______________________________________________
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 v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-04 19:54     ` Dmitry Rokosov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Rokosov @ 2023-07-04 19:54 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: neil.armstrong, mturquette, sboyd, khilman, martin.blumenstingl,
	jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich

Hello Jerome,

Thank you for the review!

On Tue, Jul 04, 2023 at 09:43:41PM +0200, Jerome Brunet wrote:
> 
> On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
> 
> > The function meson_clk_pll_enable() can be invoked under the enable_lock
> > spinlock from the clk core logic
> 
> ---
> > (please refer to
> > drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
> > during the usleep_range() call:
> >
> 
> This part of the comment is not very useful - please drop it
> 

Do you mean a stack trace or reference to clk_core_enable_lock()?

> >    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
> >    Modules linked in: g_ffs usb_f_fs libcomposite
> >    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
> >    Workqueue: events_unbound async_run_entry_fn
> >    Call trace:
> >     dump_backtrace+0x9c/0x128
> >     show_stack+0x20/0x38
> >     dump_stack_lvl+0x48/0x60
> >     dump_stack+0x18/0x28
> >     __schedule_bug+0x58/0x78
> >     __schedule+0x828/0xa88
> >     schedule+0x64/0xd8
> >     schedule_hrtimeout_range_clock+0xd0/0x208
> >     schedule_hrtimeout_range+0x1c/0x30
> >     usleep_range_state+0x6c/0xa8
> >     meson_clk_pll_enable+0x1f4/0x310
> >     clk_core_enable+0x78/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_core_enable+0x58/0x200
> >     clk_enable+0x34/0x60
> >
> > Considering that this code is expected to be used in an atomic context,
> > it is required to use the udelay() function instead of usleep_range()
> > for the atomic context safety.
> 
> Please use an imperative form, instructing the code to change 
> 

Ack

> >
> > Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
> > Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> > Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
> 
> The tags are confusing here
> I suppose a 2 lines change has not be been written with 4 hands ;)
> 
> If Jan just reported and you made the change then drop his signed-off
> If he did the job, then drop the reported-by and change the author
> 

No problem :) Sometimes 2 lines change is produced during 4 hands
debugging :)

> > ---
> >  drivers/clk/meson/clk-pll.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
> > index 56ec2210f1ad..eef6f37c8d8d 100644
> > --- a/drivers/clk/meson/clk-pll.c
> > +++ b/drivers/clk/meson/clk-pll.c
> > @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
> >  	 * 3. enable the lock detect module
> >  	 */
> >  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
> > -		usleep_range(10, 20);
> > +		udelay(10);
> >  		meson_parm_write(clk->map, &pll->current_en, 1);
> > -		usleep_range(40, 50);
> > +		udelay(40);
> >  	};
> >  
> >  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
> 

-- 
Thank you,
Dmitry

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

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

* Re: [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context
  2023-07-04 19:54     ` Dmitry Rokosov
  (?)
@ 2023-07-04 19:58       ` Jerome Brunet
  -1 siblings, 0 replies; 12+ messages in thread
From: Jerome Brunet @ 2023-07-04 19:58 UTC (permalink / raw)
  To: Dmitry Rokosov
  Cc: neil.armstrong, mturquette, sboyd, khilman, martin.blumenstingl,
	jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich


On Tue 04 Jul 2023 at 22:54, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:

> Hello Jerome,
>
> Thank you for the review!
>
> On Tue, Jul 04, 2023 at 09:43:41PM +0200, Jerome Brunet wrote:
>> 
>> On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
>> 
>> > The function meson_clk_pll_enable() can be invoked under the enable_lock
>> > spinlock from the clk core logic
>> 
>> ---
>> > (please refer to
>> > drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
>> > during the usleep_range() call:
>> >
>> 
>> This part of the comment is not very useful - please drop it
>> 
>
> Do you mean a stack trace or reference to clk_core_enable_lock()?

The comment about clk_core_enable_lock.
The stack trace is useful, it may help people googling the warning

>
>> >    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
>> >    Modules linked in: g_ffs usb_f_fs libcomposite
>> >    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
>> >    Workqueue: events_unbound async_run_entry_fn
>> >    Call trace:
>> >     dump_backtrace+0x9c/0x128
>> >     show_stack+0x20/0x38
>> >     dump_stack_lvl+0x48/0x60
>> >     dump_stack+0x18/0x28
>> >     __schedule_bug+0x58/0x78
>> >     __schedule+0x828/0xa88
>> >     schedule+0x64/0xd8
>> >     schedule_hrtimeout_range_clock+0xd0/0x208
>> >     schedule_hrtimeout_range+0x1c/0x30
>> >     usleep_range_state+0x6c/0xa8
>> >     meson_clk_pll_enable+0x1f4/0x310
>> >     clk_core_enable+0x78/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_enable+0x34/0x60
>> >
>> > Considering that this code is expected to be used in an atomic context,
>> > it is required to use the udelay() function instead of usleep_range()
>> > for the atomic context safety.
>> 
>> Please use an imperative form, instructing the code to change 
>> 
>
> Ack
>
>> >
>> > Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
>> > Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
>> > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
>> > Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
>> 
>> The tags are confusing here
>> I suppose a 2 lines change has not be been written with 4 hands ;)
>> 
>> If Jan just reported and you made the change then drop his signed-off
>> If he did the job, then drop the reported-by and change the author
>> 
>
> No problem :) Sometimes 2 lines change is produced during 4 hands
> debugging :)
>
>> > ---
>> >  drivers/clk/meson/clk-pll.c | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
>> > index 56ec2210f1ad..eef6f37c8d8d 100644
>> > --- a/drivers/clk/meson/clk-pll.c
>> > +++ b/drivers/clk/meson/clk-pll.c
>> > @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
>> >  	 * 3. enable the lock detect module
>> >  	 */
>> >  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
>> > -		usleep_range(10, 20);
>> > +		udelay(10);
>> >  		meson_parm_write(clk->map, &pll->current_en, 1);
>> > -		usleep_range(40, 50);
>> > +		udelay(40);
>> >  	};
>> >  
>> >  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
>> 


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

* Re: [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-04 19:58       ` Jerome Brunet
  0 siblings, 0 replies; 12+ messages in thread
From: Jerome Brunet @ 2023-07-04 19:58 UTC (permalink / raw)
  To: Dmitry Rokosov
  Cc: neil.armstrong, mturquette, sboyd, khilman, martin.blumenstingl,
	jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich


On Tue 04 Jul 2023 at 22:54, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:

> Hello Jerome,
>
> Thank you for the review!
>
> On Tue, Jul 04, 2023 at 09:43:41PM +0200, Jerome Brunet wrote:
>> 
>> On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
>> 
>> > The function meson_clk_pll_enable() can be invoked under the enable_lock
>> > spinlock from the clk core logic
>> 
>> ---
>> > (please refer to
>> > drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
>> > during the usleep_range() call:
>> >
>> 
>> This part of the comment is not very useful - please drop it
>> 
>
> Do you mean a stack trace or reference to clk_core_enable_lock()?

The comment about clk_core_enable_lock.
The stack trace is useful, it may help people googling the warning

>
>> >    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
>> >    Modules linked in: g_ffs usb_f_fs libcomposite
>> >    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
>> >    Workqueue: events_unbound async_run_entry_fn
>> >    Call trace:
>> >     dump_backtrace+0x9c/0x128
>> >     show_stack+0x20/0x38
>> >     dump_stack_lvl+0x48/0x60
>> >     dump_stack+0x18/0x28
>> >     __schedule_bug+0x58/0x78
>> >     __schedule+0x828/0xa88
>> >     schedule+0x64/0xd8
>> >     schedule_hrtimeout_range_clock+0xd0/0x208
>> >     schedule_hrtimeout_range+0x1c/0x30
>> >     usleep_range_state+0x6c/0xa8
>> >     meson_clk_pll_enable+0x1f4/0x310
>> >     clk_core_enable+0x78/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_enable+0x34/0x60
>> >
>> > Considering that this code is expected to be used in an atomic context,
>> > it is required to use the udelay() function instead of usleep_range()
>> > for the atomic context safety.
>> 
>> Please use an imperative form, instructing the code to change 
>> 
>
> Ack
>
>> >
>> > Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
>> > Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
>> > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
>> > Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
>> 
>> The tags are confusing here
>> I suppose a 2 lines change has not be been written with 4 hands ;)
>> 
>> If Jan just reported and you made the change then drop his signed-off
>> If he did the job, then drop the reported-by and change the author
>> 
>
> No problem :) Sometimes 2 lines change is produced during 4 hands
> debugging :)
>
>> > ---
>> >  drivers/clk/meson/clk-pll.c | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
>> > index 56ec2210f1ad..eef6f37c8d8d 100644
>> > --- a/drivers/clk/meson/clk-pll.c
>> > +++ b/drivers/clk/meson/clk-pll.c
>> > @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
>> >  	 * 3. enable the lock detect module
>> >  	 */
>> >  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
>> > -		usleep_range(10, 20);
>> > +		udelay(10);
>> >  		meson_parm_write(clk->map, &pll->current_en, 1);
>> > -		usleep_range(40, 50);
>> > +		udelay(40);
>> >  	};
>> >  
>> >  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
>> 


_______________________________________________
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 v1] clk: meson: change usleep_range() to udelay() for atomic context
@ 2023-07-04 19:58       ` Jerome Brunet
  0 siblings, 0 replies; 12+ messages in thread
From: Jerome Brunet @ 2023-07-04 19:58 UTC (permalink / raw)
  To: Dmitry Rokosov
  Cc: neil.armstrong, mturquette, sboyd, khilman, martin.blumenstingl,
	jian.hu, kernel, rockosov, linux-amlogic, linux-clk, devicetree,
	linux-kernel, linux-arm-kernel, Jan Dakinevich


On Tue 04 Jul 2023 at 22:54, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:

> Hello Jerome,
>
> Thank you for the review!
>
> On Tue, Jul 04, 2023 at 09:43:41PM +0200, Jerome Brunet wrote:
>> 
>> On Mon 03 Jul 2023 at 23:04, Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
>> 
>> > The function meson_clk_pll_enable() can be invoked under the enable_lock
>> > spinlock from the clk core logic
>> 
>> ---
>> > (please refer to
>> > drivers/clk/clk.c:clk_core_enable_lock()), which risks a kernel panic
>> > during the usleep_range() call:
>> >
>> 
>> This part of the comment is not very useful - please drop it
>> 
>
> Do you mean a stack trace or reference to clk_core_enable_lock()?

The comment about clk_core_enable_lock.
The stack trace is useful, it may help people googling the warning

>
>> >    BUG: scheduling while atomic: kworker/u4:2/36/0x00000002
>> >    Modules linked in: g_ffs usb_f_fs libcomposite
>> >    CPU: 1 PID: 36 Comm: kworker/u4:2 Not tainted 6.4.0-rc5 #273
>> >    Workqueue: events_unbound async_run_entry_fn
>> >    Call trace:
>> >     dump_backtrace+0x9c/0x128
>> >     show_stack+0x20/0x38
>> >     dump_stack_lvl+0x48/0x60
>> >     dump_stack+0x18/0x28
>> >     __schedule_bug+0x58/0x78
>> >     __schedule+0x828/0xa88
>> >     schedule+0x64/0xd8
>> >     schedule_hrtimeout_range_clock+0xd0/0x208
>> >     schedule_hrtimeout_range+0x1c/0x30
>> >     usleep_range_state+0x6c/0xa8
>> >     meson_clk_pll_enable+0x1f4/0x310
>> >     clk_core_enable+0x78/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_core_enable+0x58/0x200
>> >     clk_enable+0x34/0x60
>> >
>> > Considering that this code is expected to be used in an atomic context,
>> > it is required to use the udelay() function instead of usleep_range()
>> > for the atomic context safety.
>> 
>> Please use an imperative form, instructing the code to change 
>> 
>
> Ack
>
>> >
>> > Fixes: b6ec400aa153 ("clk: meson: introduce new pll power-on sequence for A1 SoC family")
>> > Reported-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
>> > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
>> > Signed-off-by: Jan Dakinevich <yvdakinevich@sberdevices.ru>
>> 
>> The tags are confusing here
>> I suppose a 2 lines change has not be been written with 4 hands ;)
>> 
>> If Jan just reported and you made the change then drop his signed-off
>> If he did the job, then drop the reported-by and change the author
>> 
>
> No problem :) Sometimes 2 lines change is produced during 4 hands
> debugging :)
>
>> > ---
>> >  drivers/clk/meson/clk-pll.c | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
>> > index 56ec2210f1ad..eef6f37c8d8d 100644
>> > --- a/drivers/clk/meson/clk-pll.c
>> > +++ b/drivers/clk/meson/clk-pll.c
>> > @@ -367,9 +367,9 @@ static int meson_clk_pll_enable(struct clk_hw *hw)
>> >  	 * 3. enable the lock detect module
>> >  	 */
>> >  	if (MESON_PARM_APPLICABLE(&pll->current_en)) {
>> > -		usleep_range(10, 20);
>> > +		udelay(10);
>> >  		meson_parm_write(clk->map, &pll->current_en, 1);
>> > -		usleep_range(40, 50);
>> > +		udelay(40);
>> >  	};
>> >  
>> >  	if (MESON_PARM_APPLICABLE(&pll->l_detect)) {
>> 


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

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

end of thread, other threads:[~2023-07-04 20:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 20:04 [PATCH v1] clk: meson: change usleep_range() to udelay() for atomic context Dmitry Rokosov
2023-07-03 20:04 ` Dmitry Rokosov
2023-07-03 20:04 ` Dmitry Rokosov
2023-07-04 19:43 ` Jerome Brunet
2023-07-04 19:43   ` Jerome Brunet
2023-07-04 19:43   ` Jerome Brunet
2023-07-04 19:54   ` Dmitry Rokosov
2023-07-04 19:54     ` Dmitry Rokosov
2023-07-04 19:54     ` Dmitry Rokosov
2023-07-04 19:58     ` Jerome Brunet
2023-07-04 19:58       ` Jerome Brunet
2023-07-04 19:58       ` Jerome Brunet

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.