From 7a5ad2fa7da0f5dda0155cbaeb7c15a4ef679053 Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Wed, 22 Jun 2022 08:52:59 +0800 Subject: [PATCH] Revert "spi: rockchip: Disable local irq when pio write out of interrupt service" This reverts commit 8e82d2fc9fd374611de6b035a4c2107dda8fbead. Signed-off-by: Jon Lin Change-Id: I0d92d2c1d9d050e3e1eea632fd9d876876a4af0f --- drivers/spi/spi-rockchip.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index f65038153239..a605dad87401 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -202,7 +202,6 @@ struct rockchip_spi { bool cs_high_supported; /* native CS supports active-high polarity */ struct spi_transfer *xfer; /* Store xfer temporarily */ - spinlock_t lock; /* prevent I/O concurrent access */ }; static inline void spi_enable_chip(struct rockchip_spi *rs, bool enable) @@ -297,13 +296,9 @@ static void rockchip_spi_handle_err(struct spi_controller *ctlr, static void rockchip_spi_pio_writer(struct rockchip_spi *rs) { - u32 tx_free; - u32 words; - unsigned long flags; + u32 tx_free = rs->fifo_len - readl_relaxed(rs->regs + ROCKCHIP_SPI_TXFLR); + u32 words = min(rs->tx_left, tx_free); - spin_lock_irqsave(&rs->lock, flags); - tx_free = rs->fifo_len - readl_relaxed(rs->regs + ROCKCHIP_SPI_TXFLR); - words = min(rs->tx_left, tx_free); rs->tx_left -= words; for (; words; words--) { u32 txw; @@ -316,7 +311,6 @@ static void rockchip_spi_pio_writer(struct rockchip_spi *rs) writel_relaxed(txw, rs->regs + ROCKCHIP_SPI_TXDR); rs->tx += rs->n_bytes; } - spin_unlock_irqrestore(&rs->lock, flags); } static void rockchip_spi_pio_reader(struct rockchip_spi *rs) @@ -800,8 +794,6 @@ static int rockchip_spi_probe(struct platform_device *pdev) goto err_put_ctlr; } - spin_lock_init(&rs->lock); - rs->apb_pclk = devm_clk_get(&pdev->dev, "apb_pclk"); if (IS_ERR(rs->apb_pclk)) { dev_err(&pdev->dev, "Failed to get apb_pclk\n");