From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C33EC10F06 for ; Wed, 3 Apr 2019 15:51:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B67A206DF for ; Wed, 3 Apr 2019 15:51:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="np024X8K"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H1d9I94k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B67A206DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1dd5UTKoFEnI6JuuKDNlOrV/EBUILGH3wDM2JTLNN+c=; b=np024X8KM+iHkb5kgcCvTGRqY SDYfwupWKkHP/UGWq8wKbV37pqwJhVIqjBcYB6pP+nw1fGccOfkSAXA3BLFQQKOU0HQBBM5P5cjtH oCtOADyarotaQzYoP8HVimGykiSG0gUTXkJP9lMJ5/n4OF9LBsNXu/qwVy/dzsaJqxJN4lhG3W9k1 Pd0rMNlkKlvDd/bDQISqI6XJ+oA8A64Tz4eLlSj4ejRPNnW+GTS3flVxOoXX9y6krcIBv4gXs5aHv GxcfIFRvlzF9NrlyT1uaHo5d1HZJg77WenFaoxH2bfr9JYXZqYTM7iGiweyk2tRJTLP5vnRunahif ZQJ3x11sg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBiAv-0004V1-3S; Wed, 03 Apr 2019 15:51:41 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBiAl-0004H6-Tt for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2019 15:51:38 +0000 Received: by mail-ed1-x534.google.com with SMTP id x61so15354144edc.9 for ; Wed, 03 Apr 2019 08:51:31 -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-language; bh=MA32h7aFO/879tVdiX+oQPBANq76aYxNUZ33jElq0y4=; b=H1d9I94kNfQwiFsT0cLGNVg2KZhdytpVCw+IMBYIK0OTikCEc9xQM1Nm3N5Y5a5ULG rcfny0qwFIfZfrCuq6DNDTupkcD6t3WJ2at1KLZqHGpWR6s7IZnPutZJYlZ6Vfi9Mupm qD7Z5VINlsBD3nkQ50NoMwm01ez/r/EhQ+9csmrPo+MGlv27lzJT7VHl7ccsOESxZJy6 VnIa8StZ0EyudnCRf8d5RxrwiaQDWNr87tWt45KXtKUBDmGEjQn7c1lGo2ge16RZj2cQ uSdT/rRQXZVUeiyuCUc3uhTlxulXXtRGSOXbWEF0Zbr4NR6JCp+cWV95Z8ilZI0JUP9i RoDA== 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-language; bh=MA32h7aFO/879tVdiX+oQPBANq76aYxNUZ33jElq0y4=; b=mVy90j4FyXcpvYYXA0AXa/rMBF2C1NyS9pTztLytWMhBAvH/VayVB91i8ut+mtyf4Z CeGwm7rc4ZhUwAszLlCNu/owBAnvJIFn1KDklx5RDxdsMtfbs+fGfNXUQ2Coq6b5HG1w bUBL2+zIqTTxwzCpCUoMUtV2SiZR5f+kvMNrWm92px0KfPEAsdgCf9nlIBJp3kXz63Hp eUdI5DChqs4rz/dvAeCornrGzV6yjjwNwbVXyVErP3vhx4NwUASsd8OTSQOn3goOojNM jlrSibwrQGEgxf7ZMgG9rtziAsHCUnj3WqIn1FA7m4yQqGgtThdEu2t0GEJRvWWZUjlI oWQw== X-Gm-Message-State: APjAAAWv/diZgRnsva1Njv1WYZZdC9GERtJA2HzSPY6ictMXil7oqUx9 BUMh7KRMeq3lTdvcG6MuS4w= X-Google-Smtp-Source: APXvYqzr/4+hd8vIaZfb0yeH5uDyq5ek3tvyQXcbtSecLebakmwrqTqHgMjW4Y+3y1CP8p1W4Fw2MQ== X-Received: by 2002:a50:c404:: with SMTP id v4mr257208edf.146.1554306689764; Wed, 03 Apr 2019 08:51:29 -0700 (PDT) Received: from [192.168.1.10] ([95.174.107.249]) by smtp.gmail.com with ESMTPSA id y27sm3287025edb.67.2019.04.03.08.51.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 08:51:28 -0700 (PDT) Subject: Re: Issues with i.MX SPI DMA transfers To: Robin Gong References: <08fcbd65-510f-84f8-d6d6-ff56aa9ca9ad@gmail.com> <20190328065247.uz73lap7ljf5q3tb@pengutronix.de> <95df9334-3d0c-7d13-e431-5a4aa2b9907e@gmail.com> <197990d4-b1e2-8db9-0cb7-87b860f23bd7@gmail.com> From: Igor Plyatov Message-ID: Date: Wed, 3 Apr 2019 18:51:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------5BABD21665BA13795C52B506" Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_085132_376326_8DB9522E X-CRM114-Status: GOOD ( 20.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andy Duan , Shawn Guo , Sascha Hauer , "linux-kernel@vger.kernel.org" , "linux-spi@vger.kernel.org" , Vinod Koul , Mark Brown , Clark Wang , dl-linux-imx , Pengutronix Kernel Team , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , "dmaengine@vger.kernel.org" , Han Xu , Dan Williams , Fabio Estevam , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a multi-part message in MIME format. --------------5BABD21665BA13795C52B506 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Dear Robin, > Please apply the attached patch which is based on linux-next commit > 05d08e2995cbe6efdb993482ee0d38a77040861a. > Please notice it has already contained two sdma patches revert - "ad0d92d7ba6a" and "25aaa75df1e6" 1) Yours source code is same as mine with exception of SDMA description for eCSPI in Device Tree. I have changed Device Tree for i.MX6Q/DL as in attached patch and finally SPI interfaces operate more or less. My patch revert back patches df07101e1c4a29e820df02f9989a066988b160e6 and dd4b487b32a3571fdcc66062e661e3a3e360e35b. It is strange, because they are merged into mainline while ago. Maybe they are valid for some specific variant of i.MX SOC? "More or less" means I have come to state described in first e-mail of this e-mail thread. Byte duplication (ERR009165) happens very often for eCSPI5 interface operating through DMA. Test Conditions: 1.1. Interface under test is eCSPI1 or eCSPI5; 1.2. Four exemplars of "burn-neon" (CPU burn) executes in background to have 100% load for all 4 CPU cores (source code taken from https://raw.githubusercontent.com/ssvb/cpuburn-arm/dd5c5ba58d2b0b23cfab4a286f9d3f5510000f20/cpuburn-a8.S and https://hardwarebug.org/files/burn.S); 1.3. PC has running "ping -f embedded_device" to have network activity around 1 MiB/s Rx and Tx; 1.4. One exemplar of "spidev_test -D /dev/spidevX.0 -s FREQUENCY -b 8 -S 512 -I 1000000 -l" executes at different frequencies; Test Results for eCSPI1: 21 MHz    - success; 20 MHz    - success; ... 16 MHz    - success; ...  8 MHz    - success; Test Results for eCSPI5: 21 MHz    - failed; 20 MHz    - failed; 19 MHz    - failed; ... 12 MHz    - failed; 11 MHz    - failed; 10 MHz    - failed;  9 MHz    - failed;  8 MHz    - failed;  7 MHz    - failed;  6 MHz    - failed;  5 MHz    - failed;  4 MHz    - success. Maybe it is worth to dump content of registers for eCSPI1 and eCSPI5 to compare them? I can do this if you will describe how to make it. Maybe I'm wrong, but I suppose incorrect clock source for eCSPI5. Looks like it is worth to check correctness of driver "clk-imx6q.c" or something else responsible for eCSPI5 clock. 2) I want to improve description and replace magic numbers by constants in Device Tree for SDMA. I mean strings like "dmas = <&sdma 11 7 1>, <&sdma 12 7 2>;"? So, finally Device Tree will have strings like dmas = <&sdma SOME_DEF_A IMX_DMATYPE_.. DMA_PRIO_..>, <&sdma SOME_DEF_B IMX_DMATYPE_.. DMA_PRIO_..>; I think, this will stop black magic manipulations for SDMA in Device Tree, by various developers. Does first digit means "DMA request/event ID"? Where to find more info about this? Does second digit means "enum sdma_peripheral_type"? Does third digit means "enum imx_dma_prio"? Where can I find description of difference between IMX_DMATYPE_CSPI (MCU domain CSPI) and IMX_DMATYPE_CSPI_SP (Shared CSPI)? Googling does not help too much. Best wishes. -- Igor Plyatov --------------5BABD21665BA13795C52B506 Content-Type: text/x-patch; name="0001-Bugfix-for-incorrect-eCSPI-SDMA-numbers.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Bugfix-for-incorrect-eCSPI-SDMA-numbers.patch" >From 2aa277ff36998b805cec803b23d9c746a2a107b7 Mon Sep 17 00:00:00 2001 From: Igor Plyatov Date: Wed, 3 Apr 2019 14:51:17 +0300 Subject: [PATCH] Bugfix for incorrect eCSPI SDMA numbers. * This revert back commits df07101e1c4a29e820df02f9989a066988b160e6 and dd4b487b32a3571fdcc66062e661e3a3e360e35b, because they lead to kernel errors like "spi_master spi4: I/O Error in DMA RX spidev spi4.1: SPI transfer failed: -110." Tested on i.MX6 Quad/DualLite SOC. Signed-off-by: Igor Plyatov --- arch/arm/boot/dts/imx6q.dtsi | 2 +- arch/arm/boot/dts/imx6qdl.dtsi | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index d038f4117024..7175898f854e 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -172,7 +172,7 @@ clocks = <&clks IMX6Q_CLK_ECSPI5>, <&clks IMX6Q_CLK_ECSPI5>; clock-names = "ipg", "per"; - dmas = <&sdma 11 8 1>, <&sdma 12 8 2>; + dmas = <&sdma 11 7 1>, <&sdma 12 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 2eb4c779298b..36c48a18e39a 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -338,7 +338,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI1>, <&clks IMX6QDL_CLK_ECSPI1>; clock-names = "ipg", "per"; - dmas = <&sdma 3 8 1>, <&sdma 4 8 2>; + dmas = <&sdma 3 7 1>, <&sdma 4 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -352,7 +352,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI2>, <&clks IMX6QDL_CLK_ECSPI2>; clock-names = "ipg", "per"; - dmas = <&sdma 5 8 1>, <&sdma 6 8 2>; + dmas = <&sdma 5 7 1>, <&sdma 6 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -366,7 +366,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI3>, <&clks IMX6QDL_CLK_ECSPI3>; clock-names = "ipg", "per"; - dmas = <&sdma 7 8 1>, <&sdma 8 8 2>; + dmas = <&sdma 7 7 1>, <&sdma 8 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -380,7 +380,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI4>, <&clks IMX6QDL_CLK_ECSPI4>; clock-names = "ipg", "per"; - dmas = <&sdma 9 8 1>, <&sdma 10 8 2>; + dmas = <&sdma 9 7 1>, <&sdma 10 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; -- 2.17.1 --------------5BABD21665BA13795C52B506 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --------------5BABD21665BA13795C52B506--