linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocking-wizard: fix a schedule during spin lock acquisition
@ 2022-09-23 14:53 Hao Peng
  2022-09-23 15:29 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Hao Peng @ 2022-09-23 14:53 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging

From: Peng Hao <flyingpeng@tencent.com>

when the interrupt is disabled and the spin lock is acquired,
calling read_poll_timeout will trigger the schedule, which should
be replaced by read_poll_timeout_atomic.

Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
 drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index 39367712ef54..986af03b31c9 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -157,7 +157,7 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw
*hw, unsigned long rate,
        writel(0x00, div_addr + WZRD_DR_DIV_TO_PHASE_OFFSET);

        /* Check status register */
-       err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET,
+       err = readl_poll_timeout_atomic(divider->base +
WZRD_DR_STATUS_REG_OFFSET,
                                       value, value & WZRD_DR_LOCK_BIT_MASK,
                                       WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
        if (err)
@@ -168,7 +168,7 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw
*hw, unsigned long rate,
               divider->base + WZRD_DR_INIT_REG_OFFSET);

        /* Check status register */
-       err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET,
+       err = readl_poll_timeout_atomic(divider->base +
WZRD_DR_STATUS_REG_OFFSET,
                                       value, value & WZRD_DR_LOCK_BIT_MASK,
                                       WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
 err_reconfig:
--
2.27.0

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

* Re: [PATCH] clocking-wizard: fix a schedule during spin lock acquisition
  2022-09-23 14:53 [PATCH] clocking-wizard: fix a schedule during spin lock acquisition Hao Peng
@ 2022-09-23 15:29 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-09-23 15:29 UTC (permalink / raw)
  To: Hao Peng; +Cc: gregkh, linux-staging

On Fri, Sep 23, 2022 at 10:53:27PM +0800, Hao Peng wrote:
> From: Peng Hao <flyingpeng@tencent.com>
> 
> when the interrupt is disabled and the spin lock is acquired,
> calling read_poll_timeout will trigger the schedule, which should
> be replaced by read_poll_timeout_atomic.
> 
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> ---
>  drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
> b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
> index 39367712ef54..986af03b31c9 100644
> --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
> +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
> @@ -157,7 +157,7 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw
> *hw, unsigned long rate,
>         writel(0x00, div_addr + WZRD_DR_DIV_TO_PHASE_OFFSET);
> 

Your patch is corrupted and cannot be applied.  Read the couple
paragraphs of Documentation/process/email-clients.rst for hints.

regards,
dan carpenter


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

* Re: [PATCH]  clocking-wizard: fix a schedule during spin lock acquisition
  2022-09-18  2:43 flyingpeng(彭浩)
@ 2022-09-24 11:06 ` gregkh
  0 siblings, 0 replies; 4+ messages in thread
From: gregkh @ 2022-09-24 11:06 UTC (permalink / raw)
  To: flyingpeng(彭浩); +Cc: linux-staging

On Sun, Sep 18, 2022 at 02:43:20AM +0000, flyingpeng(彭浩) wrote:
> when the interrupt is disabled and the spin lock is acquired,
> calling read_poll_timeout will trigger the schedule, which should
> be replaced by read_poll_timeout_atomic.
> 
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> ---
>  drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
> index 39367712ef54..986af03b31c9 100644
> --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
> +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
> @@ -157,7 +157,7 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate,
>         writel(0x00, div_addr + WZRD_DR_DIV_TO_PHASE_OFFSET);
> 
>         /* Check status register */
> -       err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET,
> +       err = readl_poll_timeout_atomic(divider->base + WZRD_DR_STATUS_REG_OFFSET,
>                                  value, value & WZRD_DR_LOCK_BIT_MASK,
>                                  WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
>         if (err)
> @@ -168,7 +168,7 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate,
>                divider->base + WZRD_DR_INIT_REG_OFFSET);
> 
>         /* Check status register */
> -       err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET,
> +       err = readl_poll_timeout_atomic(divider->base + WZRD_DR_STATUS_REG_OFFSET,
>                                  value, value & WZRD_DR_LOCK_BIT_MASK,
>                                  WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
>  err_reconfig:
> --
> 2.27.0
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch is malformed (tabs converted to spaces, linewrapped, etc.)
  and can not be applied.  Please read the file,
  Documentation/email-clients.txt in order to fix this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

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

* [PATCH]  clocking-wizard: fix a schedule during spin lock acquisition
@ 2022-09-18  2:43 flyingpeng(彭浩)
  2022-09-24 11:06 ` gregkh
  0 siblings, 1 reply; 4+ messages in thread
From: flyingpeng(彭浩) @ 2022-09-18  2:43 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging

when the interrupt is disabled and the spin lock is acquired,
calling read_poll_timeout will trigger the schedule, which should
be replaced by read_poll_timeout_atomic.

Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
 drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index 39367712ef54..986af03b31c9 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -157,7 +157,7 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate,
        writel(0x00, div_addr + WZRD_DR_DIV_TO_PHASE_OFFSET);

        /* Check status register */
-       err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET,
+       err = readl_poll_timeout_atomic(divider->base + WZRD_DR_STATUS_REG_OFFSET,
                                 value, value & WZRD_DR_LOCK_BIT_MASK,
                                 WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
        if (err)
@@ -168,7 +168,7 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate,
               divider->base + WZRD_DR_INIT_REG_OFFSET);

        /* Check status register */
-       err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET,
+       err = readl_poll_timeout_atomic(divider->base + WZRD_DR_STATUS_REG_OFFSET,
                                 value, value & WZRD_DR_LOCK_BIT_MASK,
                                 WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
 err_reconfig:
--
2.27.0


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 14:53 [PATCH] clocking-wizard: fix a schedule during spin lock acquisition Hao Peng
2022-09-23 15:29 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2022-09-18  2:43 flyingpeng(彭浩)
2022-09-24 11:06 ` gregkh

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).