Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp799539ybc; Sat, 16 Nov 2019 08:55:28 -0800 (PST) X-Google-Smtp-Source: APXvYqyQPVsyojh/X5bzYquN0vXaU2vuTYLYnsTATpfOQwrg7E3ym8Qf8QKqOBxX98bpDcU6GTcU X-Received: by 2002:a17:907:20d2:: with SMTP id qq18mr11064417ejb.305.1573923328260; Sat, 16 Nov 2019 08:55:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573923328; cv=none; d=google.com; s=arc-20160816; b=IBGM5CLubIGVvYlc/zEfpK3sTByGn2N+lUJsnkKh4cxpvLlj1ZODB8HNoPpU94Z3Yo +M2lqmyMPodBxIGWueJcRDGY0OTczvMGdECaqZm/SrhKu00Jp4fwWbawPhnqx2wcKyT5 3Gvj0s3HzPAWn6TYhYhKANTHJys3RrZXAFBr8dWX3YtQSR+FaPpqeZTivqNoq/Hi6NPk 3yALBtKgM3OUwX4GnZ0YI9PsKJ8AU4VfMNLAAy+1qKuHp+2LzPxEuYMnPYIFRRaR5i2e C7y9Zm+7po7CqZ3eQMFA918L4W3R35017lDCGD9y6ikhNqt5kMTRqjPwBOmLkvxahRQm 2cvg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xx7Igbcl7ml0EXbP89jBklZFiqjESR1sCboPTvHZD9Q=; b=MkW9Exnv6/K8bwzmjaUsqC1eq9gt3qbdG7tT9dpIdDcWGKBjQLEBgzMwsEy3bBqE4j 1EvLejNPA55hng6hT57xr6m0mNu58dn5yUg/xnJM2p+sNBqFgADh8i6fCBGngiQiSTEJ PWv+iAQzTvmdxeBUfObJ94xCWDSgSp046MiIycP+iJ+pHsGGokj/J+zfMqDT/OEs9JdW xW8wlN0EGLzen4fpKx6TRGb6A60gx3+BOpEfqK+LlvALAXCe2ld3yCqTGnGC7F/rPsI+ T56mLayQXiJ3n4ONeMu1otRZzC1lf+fnd8yjBDIaJpQYfdClIf7OXRRryuqTtfK8Cr86 VTxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AoTcALhZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si8223735edy.53.2019.11.16.08.55.03; Sat, 16 Nov 2019 08:55:28 -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=AoTcALhZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730016AbfKPQPy (ORCPT + 99 others); Sat, 16 Nov 2019 11:15:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:53746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729638AbfKPPrJ (ORCPT ); Sat, 16 Nov 2019 10:47:09 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8574320815; Sat, 16 Nov 2019 15:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919228; bh=k+aeY3djTXrMWJV296qj1JOi9SAAWVq/Vc2rki06J+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AoTcALhZnUU6DHdBVsWu+BOuEHBIWz/OrXI4Xq81riGUc/PSu4YcZYA6G+ebiKvOX ucdVY3OZpZIZclRAWIeo3d7zQrsJQ5qs72xdYRKxj1AU65/CasT1mCTrqSnEOSvn8Z TEIVxpNElNVc5G2fLlTTLCoxQJhpnqGYRuvN/HJI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vignesh R , David Lechner , Mark Brown , Sasha Levin , linux-spi@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 233/237] spi: omap2-mcspi: Fix DMA and FIFO event trigger size mismatch Date: Sat, 16 Nov 2019 10:41:08 -0500 Message-Id: <20191116154113.7417-233-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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