From patchwork Fri Feb 26 05:56:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 8431411 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D9099F314 for ; Fri, 26 Feb 2016 05:58:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52C2020397 for ; Fri, 26 Feb 2016 05:58:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7801E20389 for ; Fri, 26 Feb 2016 05:58:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753319AbcBZF5q (ORCPT ); Fri, 26 Feb 2016 00:57:46 -0500 Received: from plaes.org ([188.166.43.21]:43117 "EHLO plaes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752155AbcBZF5e (ORCPT ); Fri, 26 Feb 2016 00:57:34 -0500 Received: from localhost (112-218-191-90.dyn.estpak.ee [90.191.218.112]) by plaes.org (Postfix) with ESMTPSA id DE67A417CE; Fri, 26 Feb 2016 05:57:32 +0000 (UTC) From: Priit Laes To: Mark Brown , Maxime Ripard , Chen-Yu Tsai Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Emilio=20L=C3=B3pez?= , Michal Suchanek Subject: [PATCH 2/2] ARM: sunxi: spi: add notice about SPI FIFO limit. Date: Fri, 26 Feb 2016 07:56:57 +0200 Message-Id: <1456466217-6793-3-git-send-email-plaes@plaes.org> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1456466217-6793-1-git-send-email-plaes@plaes.org> References: <1456466217-6793-1-git-send-email-plaes@plaes.org> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Michal Suchanek When testing SPI without DMA I noticed that filling the FIFO on the spi controller causes timeout. This should never happen with DMA support so just adding a comment. Signed-off-by: Michal Suchanek --- drivers/spi/spi-sun4i.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c index 78141a6..b750664 100644 --- a/drivers/spi/spi-sun4i.c +++ b/drivers/spi/spi-sun4i.c @@ -333,7 +333,9 @@ static int sun4i_spi_transfer_one(struct spi_master *master, sun4i_spi_write(sspi, SUN4I_DMA_CTL_REG, 0); /* Fill the TX FIFO */ - sun4i_spi_fill_fifo(sspi, SUN4I_FIFO_DEPTH); + /* Filling the fifo fully causes timeout for some reason - at least on spi2 on a10s */ + /* The can_dma check is txlen >= SUN4I_FIFO_DEPTH so with DMA this should never happen anyway. */ + sun4i_spi_fill_fifo(sspi, SUN4I_FIFO_DEPTH - 1); } /* Start the transfer */