diff mbox

spi: sh-msiof: Fix DMA transfer size check

Message ID 20171102093236.26082-1-horms+renesas@verge.net.au (mailing list archive)
State Accepted
Headers show

Commit Message

Simon Horman Nov. 2, 2017, 9:32 a.m. UTC
From: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>

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 <hiromitsu.yamasaki.ym@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2
* Added Geert's Ack

Sorry for letting this slip through the cracks, it appears
to have been on my todo list for 1 year less 5 days.

---
 drivers/spi/spi-sh-msiof.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dirk Behme Nov. 2, 2017, 9:36 a.m. UTC | #1
On 02.11.2017 10:32, Simon Horman wrote:
> From: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
> 
> 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 <hiromitsu.yamasaki.ym@renesas.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Dirk Behme <dirk.behme@de.bosch.com>

> ---
> v2
> * Added Geert's Ack
> 
> Sorry for letting this slip through the cracks, it appears
> to have been on my todo list for 1 year less 5 days.


Thanks for picking it :)

Best regards

Dirk

P.S.: The remaining msiof (DMA) patches are not forgotten, we are sill 
working on them (with low priority, though).


> ---
>   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 2c5ea4c57508..94d15ef0e4e6 100644
> --- a/drivers/spi/spi-sh-msiof.c
> +++ b/drivers/spi/spi-sh-msiof.c
> @@ -900,7 +900,7 @@ static int sh_msiof_transfer_one(struct spi_master *master,
>   				break;
>   			copy32 = copy_bswap32;
>   		} else if (bits <= 16) {
> -			if (l & 1)
> +			if (l & 3)
>   				break;
>   			copy32 = copy_wswap32;
>   		} else {
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 2c5ea4c57508..94d15ef0e4e6 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -900,7 +900,7 @@  static int sh_msiof_transfer_one(struct spi_master *master,
 				break;
 			copy32 = copy_bswap32;
 		} else if (bits <= 16) {
-			if (l & 1)
+			if (l & 3)
 				break;
 			copy32 = copy_wswap32;
 		} else {