Skip to content
/ linux Public

Commit 00f7794

Browse files
fltoSasha Levin
authored andcommitted
spi-geni-qcom: use xfer->bits_per_word for can_dma()
[ Upstream commit fb2bbe3 ] mas->cur_bits_per_word may not reflect the value of xfer->bits_per_word when can_dma() is called. Use the right value instead. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Link: https://patch.msgid.link/20251120211204.24078-3-jonathan@marek.ca Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 97872d0 commit 00f7794

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/spi/spi-geni-qcom.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,10 +548,10 @@ static u32 get_xfer_len_in_words(struct spi_transfer *xfer,
548548
{
549549
u32 len;
550550

551-
if (!(mas->cur_bits_per_word % MIN_WORD_LEN))
552-
len = xfer->len * BITS_PER_BYTE / mas->cur_bits_per_word;
551+
if (!(xfer->bits_per_word % MIN_WORD_LEN))
552+
len = xfer->len * BITS_PER_BYTE / xfer->bits_per_word;
553553
else
554-
len = xfer->len / (mas->cur_bits_per_word / BITS_PER_BYTE + 1);
554+
len = xfer->len / (xfer->bits_per_word / BITS_PER_BYTE + 1);
555555
len &= TRANS_LEN_MSK;
556556

557557
return len;
@@ -571,7 +571,7 @@ static bool geni_can_dma(struct spi_controller *ctlr,
571571
return true;
572572

573573
len = get_xfer_len_in_words(xfer, mas);
574-
fifo_size = mas->tx_fifo_depth * mas->fifo_width_bits / mas->cur_bits_per_word;
574+
fifo_size = mas->tx_fifo_depth * mas->fifo_width_bits / xfer->bits_per_word;
575575

576576
if (len > fifo_size)
577577
return true;

0 commit comments

Comments
 (0)