Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7464316imm; Thu, 28 Jun 2018 04:21:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ2cRLbx+261kpy8SSWpebweYkv45XUiC3/BO1gFj1O7qAoCFjuQQ53cpNPaSpez3j8dqE/ X-Received: by 2002:a65:6604:: with SMTP id w4-v6mr8506906pgv.346.1530184902743; Thu, 28 Jun 2018 04:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530184902; cv=none; d=google.com; s=arc-20160816; b=RgCWPiJ+DLIkuwWE5yrNy+1sMY34zvnt1RXkqCjRUKEuj6GVNfmjPbJtbJ38j/ZTfn RK5WchiZWBgsbxWJor+H+F/eg95O4RjaQJCzZ3fchYl28NyxdaxzeLC/2uciOtDKOaK4 AKI5/uj19qPhw6Ecq32wgEIU7oNZ6P+WNKixRc1nYJCyQJGYU/Lp6AehQ3it0AoIZaGz l89P2+SF8Qad/ng/gnV2AsXTTGFyRVLES9kGByW9uDHHes3BC4y5Vww5EIqh40VzjZ7i 0aomerGYhhPZU1B/PsQQs1QtvGfLBh62eOmPttFnJECikahF/GARt5XqHeoUya2aDBGj 1rNw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=wXwRWqooFPqzBYShi6PWiTDVJg/lkTbBeRfl87VuN+k=; b=n2SJN2s7Zx3bdhzJdncA97hw8T7emz1tiT9dwl3BrMuIyTVamdidP5BiMRCnRZO+vn djZSurJSeqzCwGjYV62YUXj40NUQIggz/Q3+pjly7eZLZp8Kw508gFExHkdn7eY5ppCc +CIDVaVwmXnyNKltVRuTVcHZstuOK0BdXZ+R5M4zxBHdq0PgWPJWoHUEK7CDVLSU03Jx UMIBXJPliDhH4pX54LbIxrdmlUmgrzloYgNZ+ie7k0PO9YNae4oC23/jmjOAN1Ct5oim iI9OMiH60swdvrf5zy+/UNAG/aiGE1ZyhFBjFVxyK4etV8lpvdpQB+UxAgSeYdE0S9bd 5rPA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y34-v6si6525636plb.17.2018.06.28.04.21.03; Thu, 28 Jun 2018 04:21:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752145AbeF1IhS (ORCPT + 99 others); Thu, 28 Jun 2018 04:37:18 -0400 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:61068 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbeF1IhO (ORCPT ); Thu, 28 Jun 2018 04:37:14 -0400 X-IronPort-AV: E=Sophos;i="5.51,282,1526367600"; d="scan'208";a="13559370" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 28 Jun 2018 01:37:13 -0700 Received: from localhost.localdomain (10.10.76.4) by chn-sv-exch06.mchp-main.com (10.10.76.107) with Microsoft SMTP Server id 14.3.352.0; Thu, 28 Jun 2018 01:37:12 -0700 Subject: Re: [RFC PATCH 1/2] spi: Add QuadSPI driver for Atmel SAMA5D2 To: Piotr Bugalski CC: Boris Brezillon , Mark Brown , , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , , , , , Rob Herring , Mark Rutland , Nicolas Ferre , Alexandre Belloni , Cyrille Pitchen , Piotr Bugalski References: <20180618162124.21749-1-bugalski.piotr@gmail.com> <20180618162124.21749-2-bugalski.piotr@gmail.com> <20180621233321.0f25f572@bbrezillon> <20180622093905.62a3b936@bbrezillon> <455adb76-530a-1fd5-303c-cfa158ad7870@microchip.com> From: Tudor Ambarus Message-ID: <1d736934-b3e7-7b23-0f34-1d22d36b2b18@microchip.com> Date: Thu, 28 Jun 2018 11:37:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Piotr, On 06/27/2018 10:52 AM, Piotr Bugalski wrote: > >> General things to consider for the limitation in performance: >> - is the serial flash memory operating in Quad SPI? > > Yes, I've checked signal using logic analyzer, data is transferred using > all four lines. > >> - QSCLK should be as high as possible > > Sure, but when we are using lower frequency CPU impact should be > negligible while efficiency is crap on every speed. > >> - transfer delays - I checked them, they have default values, we should be good. >> - use DMA, as you suggested >> > > I don't understand one thing. While CPU is not busy and during my tests > 100% of CPU can be used for communication, efficiency is still very low. > Why DMA has such impact? > > It is very interesting to observe signals using logic analyzer. > When CPU is used for communication, there are long delays after > every byte transferred. These delays are much longer than it should be only because of writing next value by CPU. Are those consecutive transfers (same peripheral without removing chip select)? The delays between consecutive transfers can be set just in SPI mode. It would be strange to see this kind of delays in serial memory mode. > I tried to change SPI frequency. If delay were CPU related, > delay time should stay the same. Unfortunately results were different - > lowering SPI freqency extends delay time. If QSCK is less than f-perif-clock/2, then setting DLYBS to 1 will shorten the DLYBS delay, but this is peanuts. Thanks, ta > Using DMA makes these delays to disappear, but how to acheive CPU > communication without delays?