Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4463370imu; Mon, 14 Jan 2019 23:57:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN4ErwWhR3vNfcULgBgcSrPV9IUCc8grJ14DQ2JMtnSwkcczZv5ym4jr3gspYopHsP4FV65c X-Received: by 2002:a17:902:7581:: with SMTP id j1mr2779605pll.308.1547539068544; Mon, 14 Jan 2019 23:57:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547539068; cv=none; d=google.com; s=arc-20160816; b=HIBvTRNjICL1Rm6+LN1dx787euSlT1Lnk4WdSjJpKt2zXOCdOMIhh0/re5O+D8/9an EDxaOPaCaqICSFZKJXpH+Cu0iwDLOBHhblJbZHUs7GHZZQKIMUe51tCnDSmntNxSUX5c VqbU3l9U6/7u1a/ZpO+PGgOGnQ66wsZm7e73Mo5NxKB7/SjUdKdkbZ/nrnokMGgO4SJ1 NY8gdA7Cgi/xFk/S8h+2uWNn9nyrTaF5O7v7k3556IQ1CbRKTnvNCp2NLlVy+yFGRfye xT3HE1JrU7CN3KziNU/tSm0GC70NyZ8oWp4WoRY1pA7J/xhzl+OdV7m478A4+T5N8bz/ dULA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=iNYNbDDI+/kurMIElx2IHFIugEuGQcRQkRSrnXRnsEk=; b=I/t3uTcra+Nfnc+oOiKitPDjAgEQNpzeE8zVIZZwKPA5bSgVqAnvOLxno/6lQUkk/1 BHVwSF3QGk6QOmkn9k+mI8pmFZ+lFUJ0mniusVB4wrFTd2FQn8sfB1E0k92WNwXEc60h TbA7C6SBt5ns6Tx7VX8IJGn4uCZOc0coMYWXeTnaF4hw1nOrKewQPFEN+QcKOpRrgecU KhJXsHyEusnLroOShfzUMzq/Do4a+7IJpmJUvH4D+l5hlxAIi9Z+tm0xcEZxwbig9YzZ OqNLevssba7IIm5jXKw0qMaL8UtusryTYuF9VDZ3Qr8hoOwLPVlJjY/Qs7NTr1iCPM2z ANRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="gQ/zumw0"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e127si2670158pfg.167.2019.01.14.23.57.32; Mon, 14 Jan 2019 23:57:48 -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=@ti.com header.s=ti-com-17Q1 header.b="gQ/zumw0"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727404AbfAOG6h (ORCPT + 99 others); Tue, 15 Jan 2019 01:58:37 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:41662 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725840AbfAOG6g (ORCPT ); Tue, 15 Jan 2019 01:58:36 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0F6vjaP080541; Tue, 15 Jan 2019 00:57:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547535465; bh=iNYNbDDI+/kurMIElx2IHFIugEuGQcRQkRSrnXRnsEk=; h=From:To:CC:Subject:Date; b=gQ/zumw0kp5Iw3Uqey7gvlj07JYvC8TtOrZTnwpoKPnV0Cscu1xnppRwTV2udBbCV vwnmOCfrTXI7fm5csq1wJodCTmUmBJ9ievHCrhivINQBdRkhLrDcWOpwTT4Vaf+hcU m/uUY1H0jiGn93P20RKZiC5VkOxQJGAqEd9uD5io= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0F6vjNY122244 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 15 Jan 2019 00:57:45 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 15 Jan 2019 00:57:45 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Tue, 15 Jan 2019 00:57:44 -0600 Received: from a0132425.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0F6vgHM014646; Tue, 15 Jan 2019 00:57:42 -0600 From: Vignesh R To: Mark Brown , David Lechner CC: , , Vignesh R , Subject: [PATCH] spi: omap2-mcspi: Fix DMA and FIFO event trigger size mismatch Date: Tue, 15 Jan 2019 12:28:32 +0530 Message-ID: <20190115065832.23705-1-vigneshr@ti.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 2fd8881fcd65..8be304379628 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -623,8 +623,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