Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6014450ybc; Wed, 27 Nov 2019 13:25:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyY/flkMWgLfkaaKEGE4rXGbYPKTtNf8juNvrlfXm9gFImnX9NKILdC6DFX1OCSQMDBAtMp X-Received: by 2002:a17:906:49c5:: with SMTP id w5mr35805511ejv.21.1574889908899; Wed, 27 Nov 2019 13:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574889908; cv=none; d=google.com; s=arc-20160816; b=EEBCs85vfMpNBhZ+KToDy2Glj6hI5KhcpqdNo/O3GDHvd5PJPHVNGj8nuzL5ka/xd5 WJZEQ6CvQbGMr0Uy7Bpp8sc0SuA4ieHdLkjdCkMqkWNkAKIfvKIJTIXVmZE5ARKw8Myc nnJSIhwuxyqOBMtfE4SR81nRvcatjFx1NN9aQ8gV7J0qlT4GnA1Th8lsBaVNNJ4MtFEv Pbf0RHVn7eRVeAxEXvfjV2ryvh6Xxjs5dtKkcgj17P5eFITF8tpBduUWquKu71RZmcQU m1YX7p5/JFeXYWAI14WvhTlnXpLAiaeotzO7aoCu+6cR/eKUtOnCPGPefbUTROjY1jFz 456g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xx7Igbcl7ml0EXbP89jBklZFiqjESR1sCboPTvHZD9Q=; b=I4vpU6yXNr4qJeaWZ9jTRT7JpuKd+ZXKoWZzCMHvtuvYfJgRH7VANmmNkc72/3H9+t B5/LEvwz+neFGHZcsNjhG0j86ZF7LIHSItpdOgHM7nkwGzxIMPjR3aITUoN7bkJb9ATi ctA2w5wND6Xdqxbv35m3li7wJxlJfUC8MwkQZz2B1jiG14pM83/6IB0v5Yx44FSBaGY+ Yq/Su20CihsMdTM6zE6jUP/CQGjr7UbnIJKtWZO5mjJukDCdpHLKxh+d/yiQPy3/b/WG cUsDjG/En3w94kqk44KW9cThE22NKqKahTJjyLBem5AnBq8UIY1Qr+V2tTWF4WrEjpsL UdVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OSI8G93t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h21si4112109ejc.263.2019.11.27.13.24.45; Wed, 27 Nov 2019 13:25:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OSI8G93t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732311AbfK0VFi (ORCPT + 99 others); Wed, 27 Nov 2019 16:05:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:59374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731393AbfK0VFf (ORCPT ); Wed, 27 Nov 2019 16:05:35 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A34002080F; Wed, 27 Nov 2019 21:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888735; bh=k+aeY3djTXrMWJV296qj1JOi9SAAWVq/Vc2rki06J+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OSI8G93ttj8iO4JvhIC03KiSx4mGx6eDWi1AI3OPIZCiTPuNonYoaHpvoOK8c0i4L hIUNL66WQd9bv7NTRlb5oiMvaCLWd/uNsrctVLa2OsK6RmX44YrV6BaHebfKlwRNEJ IcQvtksxngW/iMzAXAl3rwS+WxK2y/4VRuKUsYfw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Lechner , Vignesh R , Mark Brown , Sasha Levin Subject: [PATCH 4.19 250/306] spi: omap2-mcspi: Fix DMA and FIFO event trigger size mismatch Date: Wed, 27 Nov 2019 21:31:40 +0100 Message-Id: <20191127203133.170686283@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vignesh R [ Upstream commit baf8b9f8d260c55a86405f70a384c29cda888476 ] Commit b682cffa3ac6 ("spi: omap2-mcspi: Set FIFO DMA trigger level to word length") broke SPI transfers where bits_per_word != 8. This is because of mimsatch between McSPI FIFO level event trigger size (SPI word length) and DMA request size(word length * maxburst). This leads to data corruption, lockup and errors like: spi1.0: EOW timed out Fix this by setting DMA maxburst size to 1 so that McSPI FIFO level event trigger size matches DMA request size. Fixes: b682cffa3ac6 ("spi: omap2-mcspi: Set FIFO DMA trigger level to word length") Cc: stable@vger.kernel.org Reported-by: David Lechner Tested-by: David Lechner Signed-off-by: Vignesh R Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-omap2-mcspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index f50cb8a4b4138..eb2d2de172af3 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -607,8 +607,8 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer) cfg.dst_addr = cs->phys + OMAP2_MCSPI_TX0; cfg.src_addr_width = width; cfg.dst_addr_width = width; - cfg.src_maxburst = es; - cfg.dst_maxburst = es; + cfg.src_maxburst = 1; + cfg.dst_maxburst = 1; rx = xfer->rx_buf; tx = xfer->tx_buf; -- 2.20.1