]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
spi: mediatek: Don't modify spi_transfer when transfer.
authorPeter Shih <pihsun@chromium.org>
Mon, 10 Sep 2018 03:54:21 +0000 (11:54 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:40 +0000 (13:16 +0100)
commitfbf2aaddeadac1b8b9577cc53acc381192638ce2
treec4ce9465abb3bd6261727835bd7bd6a15f2ac4ed
parent9b086deb6b40d51d6f2e2d40d1b05c894df55060
spi: mediatek: Don't modify spi_transfer when transfer.

BugLink: https://bugs.launchpad.net/bugs/1853915
[ Upstream commit 00bca73bfca4fb0ab089b94cad0fc83d8b49c25f ]

Mediatek SPI driver modifies some fields (tx_buf, rx_buf, len, tx_dma,
rx_dma) of the spi_transfer* passed in when doing transfer_one and in
interrupt handler. This is somewhat unexpected, and there are some
caller (e.g. Cr50 spi driver) that reuse the spi_transfer for multiple
messages. Add a field to record how many bytes have been transferred,
and calculate the right len / buffer based on it instead.

Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Change-Id: I23e218cd964f16c0b2b26127d4a5ca6529867673
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/spi/spi-mt65xx.c