From patchwork Wed Sep 6 07:05:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 9940005 X-Patchwork-Delegate: geert@linux-m68k.org 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 607086038C for ; Wed, 6 Sep 2017 07:05:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5146A28AFA for ; Wed, 6 Sep 2017 07:05:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4614A28AFC; Wed, 6 Sep 2017 07:05:19 +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 A27CE28AFB for ; Wed, 6 Sep 2017 07:05:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751924AbdIFHFO (ORCPT ); Wed, 6 Sep 2017 03:05:14 -0400 Received: from smtp6-v.fe.bosch.de ([139.15.237.11]:55533 "EHLO smtp6-v.fe.bosch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345AbdIFHFN (ORCPT ); Wed, 6 Sep 2017 03:05:13 -0400 Received: from vsmta14.fe.internet.bosch.com (unknown [10.4.98.54]) by imta23.fe.bosch.de (Postfix) with ESMTP id A85DA158020A; Wed, 6 Sep 2017 09:04:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1504681483; bh=JbLYvlyOc+H/3b2ur7aNFVMicCuJNJVOtVEm8wJtcNA=; l=10; h=From:From:Reply-To:Sender; b=wZ4iHHv5eF0Xx7g2BBX+d7HfctaXzM858HP4+iWVyKGSBYlYBc73lxl9YsZfOiPqP LEZ8kERgKq7JaGNvMApTOvxvbUH51M3FBXIZR20mO0X33OH6+WOBi//ICPdVwBxxz9 +vbyWNa1mqCjgfO+oB2yYMHCCDoaf4I/xd2i2/Ys= Received: from SI-HUB1000.de.bosch.com (vsgw23.fe.internet.bosch.com [10.4.98.23]) by vsmta14.fe.internet.bosch.com (Postfix) with ESMTP id 0B8ECA4091C; Wed, 6 Sep 2017 09:05:12 +0200 (CEST) Received: from HI-Z0EVG.hi.de.bosch.com (10.34.218.219) by SI-HUB1000.de.bosch.com (10.4.103.106) with Microsoft SMTP Server id 14.3.319.2; Wed, 6 Sep 2017 09:05:11 +0200 Received: from HI-Z0EVG.hi.de.bosch.com (localhost [IPv6:::1]) by HI-Z0EVG.hi.de.bosch.com (Postfix) with ESMTP id AA4861B46B0F; Wed, 6 Sep 2017 09:05:10 +0200 (CEST) From: Dirk Behme To: , , Geert Uytterhoeven CC: Hiromitsu Yamasaki , Dirk Behme Subject: [PATCH 2/8] spi: sh-msiof: Fix DMA transfer size check Date: Wed, 6 Sep 2017 09:05:01 +0200 Message-ID: <20170906070507.26223-3-dirk.behme@de.bosch.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170906070507.26223-1-dirk.behme@de.bosch.com> References: <20170906070507.26223-1-dirk.behme@de.bosch.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-23304.006 X-TMASE-MatchedRID: T2lJLSf/Q/o/pUoYqyfnNCmjEOrcO6AyTJDl9FKHbrkKogmGusPLb/FN EZKVsALN4vM1YF6AJbZhyT3WNjppUtAtbEEX0MxBxEHRux+uk8hxKpvEGAbTDtI1kXLs9YNJkKv GdcuuR3J6KlTil5qmnW08y2qvqp7CYrb/RHzN5kQHDtyWDmuuC5K0T51pFiQrVnLJ7DHYs3KKLC 4r0tmpUxXit6adbGJ96I9i8/RYrOUaPzUimjy38l5lIDEGwLye Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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. Signed-off-by: Hiromitsu Yamasaki Signed-off-by: Dirk Behme Reviewed-by: Geert Uytterhoeven --- 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 2b4d3a520176..f9300fdf41e5 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c @@ -904,7 +904,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 {