Skip to content

Commit

Permalink
spi: mtk_spim: clear IRQ enable bits
Browse files Browse the repository at this point in the history
In u-boot we don't use IRQ. Instead, we poll busy bit in SPI_STATUS.

However these IRQ enable bits may be set in previous boot stage (BootROM).

If we leave these bits not cleared, although u-boot has disabled IRQ and
nothing will happen, the linux kernel may encounter panic during
initializing the spim driver due to IRQ event happens before IRQ handler
is properly setup.

This patch clear IRQ bits to prevent this from happening.

Signed-off-by: SkyLake.Huang <[email protected]>
Signed-off-by: Weijie Gao <[email protected]>
Reviewed-by: Jagan Teki <[email protected]>
  • Loading branch information
hackpascal authored and trini committed Aug 3, 2023
1 parent 793e623 commit b43512d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/spi/mtk_spim.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ static int mtk_spim_hw_init(struct spi_slave *slave)
reg_val &= ~SPI_CMD_SAMPLE_SEL;
}

/* Disable interrupt enable for pause mode & normal mode */
reg_val &= ~(SPI_CMD_PAUSE_IE | SPI_CMD_FINISH_IE);

/* disable dma mode */
reg_val &= ~(SPI_CMD_TX_DMA | SPI_CMD_RX_DMA);

Expand Down

0 comments on commit b43512d

Please sign in to comment.