[PATCH v2] clocking-wizard: fix a schedule during spin lock acquisition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Peng Hao <flyingpeng@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
 .../staging/clocking-wizard/clk-xlnx-clock-wizard.c  | 12 ++++++------
 1 file changed, 6 insertions(+), 6 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..e36a97a57f2a 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -157,9 +157,9 @@ 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,
-                                value, value & WZRD_DR_LOCK_BIT_MASK,
-                                WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
+       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)
                goto err_reconfig;

@@ -168,9 +168,9 @@ 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,
-                                value, value & WZRD_DR_LOCK_BIT_MASK,
-                                WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
+       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:
        if (divider->lock)
                spin_unlock_irqrestore(divider->lock, flags);
--
2.27.0




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux