Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67192635 authored by Vipin Deep Kaur's avatar Vipin Deep Kaur Committed by Gerrit - the friendly Code Review server
Browse files

spi: spi-geni-qcom: Check for zero length transfer



A new reported scenario in whch spi slave is able to
send data into RX fifo though spi master schedules
a rx transfer of 0 byte. This is a workaround to reject
the zeo length rx transfers from software side till issue
is debugged from HW side.

Change-Id: I975d8a6aa6720a9b9a98345f37505e8c4e40e451
Signed-off-by: default avatarVipin Deep Kaur <vkaur@codeaurora.org>
parent f75836aa
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1149,6 +1149,12 @@ static int spi_geni_transfer_one(struct spi_master *spi,
		return -EINVAL;
	}

	/* Check for zero length transfer */
	if (xfer->len < 1) {
		dev_err(mas->dev, "Zero length transfer\n");
		return -EINVAL;
	}

	if (mas->cur_xfer_mode != GSI_DMA) {
		reinit_completion(&mas->xfer_done);
		setup_fifo_xfer(xfer, mas, slv->mode, spi);