Re: [PATCH 4/5] spi: dw: use DW_SPI_INT_MASK instead of hardcoded 0xff

From: Mark Brown

Date: Tue Jun 16 2026 - 10:11:16 EST


On Mon, Jun 15, 2026 at 12:40:38PM +0800, Jisheng Zhang wrote:

> The Interrupt Mask Register valid bits is bit[5:0] which is well
> defined with DW_SPI_INT_MASK, use it instead of the incorrect(but no
> harm) and hardcoded 0xff.

> if (!dws->rx_len) {
> - dw_spi_mask_intr(dws, 0xff);
> + dw_spi_mask_intr(dws, DW_SPI_INT_MASK);
> spi_finalize_current_transfer(dws->ctlr);
> } else if (dws->rx_len <= dw_readl(dws, DW_SPI_RXFTLR)) {
> dw_writel(dws, DW_SPI_RXFTLR, dws->rx_len - 1);

This looks like defensive programming in case a future version of the IP
adds additional interrupts that the driver doesn't currently know about,
it'll mask anything that appears in the register even if it's not
currently known which seems safer.

Attachment: signature.asc
Description: PGP signature