Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1451760ybb; Fri, 29 Mar 2019 04:58:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaragk1YtisUrmzPkk+EjkkAsE1JDw0potsaRcsjt1dhtjRMEwC6rSvm3qD2RCtI49m+P9 X-Received: by 2002:a63:4241:: with SMTP id p62mr28219956pga.379.1553860737218; Fri, 29 Mar 2019 04:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553860737; cv=none; d=google.com; s=arc-20160816; b=b+P9nfq2EtKjFQOQoXQ4Xbrmyu2NpoFCFkDpRFvimqgMYFNPym7s4sEUC0NAcNJLBH rIn66F3xSnCHXuV0ywkwYxxKpx/5Sm8aPxszv+j2fkJ+t6o7orHr4fpaV2tJRgLXGH91 hW1m76i8ItZ+8d13mhYmqD2gD1/OAVs30mHuRe1mEdifVDSuuQh6Xu+GPnd23Lzyyebo W75QQf9R+rA7QSJFhR+0ekoCzGtHTNolw/3Es7cvAgge3W0mG4AYMYJWvDmr58xagnak JPuBJoCe1873Hx5TNsWdG4GWgGYx5jCgyjnqsH/arU/3HT6CMRaeHqczcnZGmZ3GRtah vm8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=UxqzVk38c+GJJsWsUlprWQg4BUILBlTuCmKayqnS9eo=; b=eSWJpPI390zBq8jGLMEAszK7UCEdvMDym9ryY2/RbnjzqR1kG9YBM9vgBoZN3TAXCt R/Q6iMB4Dz0dPTUkYk67JYTos8Ag+FMkv1nBEHfVGrG5yqUFT73y+jzb0isO4lbo8aSP JdB+vPewoG/zxppUmdzSozMDlbLPbBEjWCxw2GEkaE//1Ojfe1mdYdGof0teb0VJSRht +4sUGVvRzSJVeuWJQ33ylxqfGbwXj8Q36HjAtCeaYR/R4M8eMheA9Hem+A/DkwJygnSS QE5+IvITlrh0bKYWNpRjysKRlwXemYwWiNZ0IE0ahPdxOuia/QqB5wIfXHBSweFbSRQJ EnjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vLo1TDYH; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si1763951pge.592.2019.03.29.04.58.41; Fri, 29 Mar 2019 04:58:57 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=vLo1TDYH; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729504AbfC2L5f (ORCPT + 99 others); Fri, 29 Mar 2019 07:57:35 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:34579 "EHLO mail-lf1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729469AbfC2L5e (ORCPT ); Fri, 29 Mar 2019 07:57:34 -0400 Received: by mail-lf1-f41.google.com with SMTP id y18so1273336lfe.1; Fri, 29 Mar 2019 04:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=UxqzVk38c+GJJsWsUlprWQg4BUILBlTuCmKayqnS9eo=; b=vLo1TDYHmpe4mTFm/9AdDzGvwhdry5SNtYkBwnQuEfPv2ueD0TippdkQYn9KqdCqSa 34HwchYudq9UAWzzheXwMZ/avCq114CDmN6+ezavZR6Dh9Zi1nB2v38A1dTLUPc1I5qI FD61PC9il4DQLODQvLBZL3Sb9dV60EuumEBBQrLhgHM7ZwvceY7zzSdMniHHskX5U2/L B6HY+z5oj69L7f3chSxefDtb0JS67d/DCFjhJdjrHOMG5gkaxNmcySFmr4StRFxG9R8Z V/ymCa7NZT9xoh7TROjjsVt89Xr5T0s9WqMkIL0SDwZrcMd5LEJL/Bqe0mwAjNRWwk3C 2rTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=UxqzVk38c+GJJsWsUlprWQg4BUILBlTuCmKayqnS9eo=; b=iN31A4AdSsDsf17grb/q4okfInJGA/9V8WDXVCFA2aTICtzvMh/f6Ka2eghW6Rme3g aiispXb74aFrL6HVLR8cw1p3RVBf3LXc1zLPqIqG83SvytEb4l7Dw1Par3TFTdpeJtzP dxe+YONzj8JRg78OtzssIt9QwutLjyuAiB9wf5vpp4TQdXpzdWx4Om9bwU8z2qgCS895 SvCb3gnTn88z59Wtv/jWKqMIfG2T+4zTX690CcWLU+PeJBJKBan0JIOvVo+H9Uljn+uC gkfcTw9+SeHgGY8uBQwZbI5hd9EdImm1GM+b3Odxd/J6a8/oU4agzrjuU+Ttuf6diqAK rIeA== X-Gm-Message-State: APjAAAVOllUCyR8H+x4piCOEsbht56Lh1y1RJUW49dsrlsC/mdPpQ6zF 7wopUyuwufRYPDD/v8B0rf8= X-Received: by 2002:ac2:5381:: with SMTP id g1mr24499999lfh.130.1553860652385; Fri, 29 Mar 2019 04:57:32 -0700 (PDT) Received: from [192.168.1.10] ([95.174.107.249]) by smtp.gmail.com with ESMTPSA id b14sm321282ljf.53.2019.03.29.04.57.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 04:57:31 -0700 (PDT) Subject: Re: Issues with i.MX SPI DMA transfers To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= Cc: Andy Duan , Shawn Guo , Sascha Hauer , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Vinod Koul , Mark Brown , Clark Wang , NXP Linux Team , Pengutronix Kernel Team , dmaengine@vger.kernel.org, Han Xu , Dan Williams , Robin Gong , Fabio Estevam , linux-arm-kernel@lists.infradead.org References: <08fcbd65-510f-84f8-d6d6-ff56aa9ca9ad@gmail.com> <20190328065247.uz73lap7ljf5q3tb@pengutronix.de> <20190328082231.zg4emm66mpbbfb6c@pengutronix.de> From: Igor Plyatov Message-ID: <3aa00772-8a62-3da3-c4ed-281dc93cc597@gmail.com> Date: Fri, 29 Mar 2019 14:57:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190328082231.zg4emm66mpbbfb6c@pengutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Uwe, > On Thu, Mar 28, 2019 at 10:04:21AM +0300, Igor Plyatov wrote: >> Dear Uwe, >> >> >>> Hello Igor, >>> >>> On Wed, Mar 27, 2019 at 08:40:00PM +0300, Igor Plyatov wrote: >>>> please, help to resolve two issues with SPI DMA transfers at i.MX6Q >>>> platform. >>>> >>>> First issue is >>>>  [ 4465.008003] spi_master spi0: I/O Error in DMA RX >>>> >>>> Second issue is duplication for one of received bytes. >>>> >>>> Probably, these issues related to each one. >>> This is probably the same problem I hit some time ago. Check ERR009165 >>> in the errata. You either need to disable DMA or need a fixed >>> sdma-Script. >> disabling of DMA is not an option, because high throughput required for SPI >> bus to communicate with DSPs. > Is this a theoretical reasoning, or is that backed by testing? People > here on the list already said things like: > > The eCSPI appears to insert a 4 bit pause after each word in DMA > mode, not done in PIO mode, which can make DMA transfers 50% > slower than PIO. > > You might want to read the thread > https://marc.info/?l=linux-spi&m=155191201208766&w=2 > . SPI throughput depends from transfer mode (PIO or DMA), OS load and OS version. For example, Linux-4.9.87 has quite bad results for SPI throughput when PIO transfer used and OS highly loaded by other processes. Throughput varies from 2700 kbps to 0.8 kbps and this is totally unacceptable for my application, where streaming of DSP data required. Linux-5.1.0-rc2 has much better performance of SPI with PIO transfers. Throughput varies within 10%. >> I'm aware of ERR009165, but as I write some minutes earlier to list, spi0 >> (alias for ecspi1) and spi1 (alias for ecspi2) work flawless, while spi4 >> (alias for ecspi5) fails very fast. > As the issue is a timing race, it might depend on things like length of > the SPI lines, load on the data lines and other electrical properties. > So you might just be happy that spi0 and spi1 don't show the issue for > you. Or you didn't apply the "right" work load yet. This e-mail thread discuss operation of SPI only in loopback mode. So, real lines of SPI does not used. SPI module of SOC has connected MOSI and MISO lines internally, while MISO disconnected from SOC pad. So, electrical characteristics of SPI lines are not important at all. Best wishes. -- Igor Plyatov