Return-Path: From: alexander.levin@verizon.com Cc: Hiromitsu Yamasaki , Simon Horman , Mark Brown , alexander.levin@verizon.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.9 08/24] spi: sh-msiof: Fix DMA transfer size check Date: Wed, 22 Nov 2017 22:26:12 +0000 Message-ID: <20171122222604.20122-8-alexander.levin@verizon.com> References: <20171122222604.20122-1-alexander.levin@verizon.com> In-Reply-To: <20171122222604.20122-1-alexander.levin@verizon.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: From: Hiromitsu Yamasaki [ Upstream commit 36735783fdb599c94b9c86824583df367c65900b ] DMA supports 32-bit words only, even if BITLEN1 of SITMDR2 register is 16bit. Fixes: b0d0ce8b6b91 ("spi: sh-msiof: Add DMA support") Signed-off-by: Hiromitsu Yamasaki Signed-off-by: Simon Horman Acked-by: Geert Uytterhoeven Acked-by: Dirk Behme Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-sh-msiof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index 1de3a772eb7d..cbf02ebb30a2 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c @@ -862,7 +862,7 @@ static int sh_msiof_transfer_one(struct spi_master *mas= ter, break; copy32 =3D copy_bswap32; } else if (bits <=3D 16) { - if (l & 1) + if (l & 3) break; copy32 =3D copy_wswap32; } else { --=20 2.11.0