From patchwork Mon Nov 7 14:07:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 9415321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D24A960720 for ; Mon, 7 Nov 2016 14:26:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C51492838C for ; Mon, 7 Nov 2016 14:26:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA05A28B88; Mon, 7 Nov 2016 14:26:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CC8828B4C for ; Mon, 7 Nov 2016 14:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753015AbcKGO06 (ORCPT ); Mon, 7 Nov 2016 09:26:58 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:52246 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752364AbcKGO05 (ORCPT ); Mon, 7 Nov 2016 09:26:57 -0500 Received: from penelope.kanocho.kobe.vergenet.net (unknown [217.111.208.18]) by kirsty.vergenet.net (Postfix) with ESMTPSA id 2D81F25B7AD; Tue, 8 Nov 2016 01:26:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1478528812; bh=xvPAJGZvRo3llFgHQ8FRfzhYXczyl+FR7SMEp2FyULo=; h=From:To:Cc:Subject:Date:From; b=TYoHSe98Gvwe7SgXxWeVozxrrH/5BUibHAxmUiFZTCuU1qGCIwMmW2Ph0+4MXFIBU wMSNJLr5KmXdW0gsfXVeBUkAZv7knSPs0JI9TKjT2+VijeBSXoTfP80LwlCtAaPaY3 k02zwVAkr0gYVEysLxq2QTxTZpApKmuFDVeXVAZ8= Received: by penelope.kanocho.kobe.vergenet.net (Postfix, from userid 7100) id 5C9DF6064B; Mon, 7 Nov 2016 15:07:10 +0100 (CET) From: Simon Horman To: Geert Uytterhoeven Cc: Magnus Damm , linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH/RFC] spi: sh-msiof: Fix DMA transfer size check Date: Mon, 7 Nov 2016 15:07:03 +0100 Message-Id: <1478527623-17960-1-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hiromitsu Yamasaki 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 --- Geert, this is a patch from the Gen3 BSP 3.3.2 kernel. Please consider if it is appropriate for mainline. --- 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 *master, break; copy32 = copy_bswap32; } else if (bits <= 16) { - if (l & 1) + if (l & 3) break; copy32 = copy_wswap32; } else {