lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] spi: rockchip: Disable local irq when pio write out of interrupt service
On Mon, Jun 13, 2022 at 05:27:44PM +0800, Jon Lin wrote:
> Avoid interrupt come and interrupt the pio_writer.
>
> + 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;
> @@ -308,6 +313,7 @@ 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);

So this is effectively just disabling interrupts during PIO, there's no
other users of the lock which is rather heavyweight. What's the actual
issue here? We should also have something saying what's going on in the
code since right now the lock just looks redundant.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-06-13 19:24    [W:0.062 / U:2.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site