Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4894458imm; Tue, 9 Oct 2018 06:52:45 -0700 (PDT) X-Google-Smtp-Source: ACcGV636qWMnIwB70WxOleoUw8sLZFHMmfTB9NcjXBXqn4L+fH3E13y32CuC3i5wd6qTJnyQ2/lR X-Received: by 2002:a17:902:6689:: with SMTP id e9-v6mr28735568plk.115.1539093165785; Tue, 09 Oct 2018 06:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539093165; cv=none; d=google.com; s=arc-20160816; b=AnGOKcplVvgDJn4T7a1DiwOQMSnwcnWpSoiF+s5FmG3wsL1NuCav6yn0Qw5YE0Ak7L 4cB+dKwn6SIpfTK4vHMMByV1DycKq2vykOpaLAZKWv2IePGlxTmhJUnyb/oGEFrlMreS GtjYfIcR7DNlXvhbcXlL7BeuKIMVV4dCANMh1VEhCo8hfOzFaiduoJePUZYu1UnaMif9 XdcAI7ARqJiqezc/4QxVnlAhol51XiB8RQNziymkCCGKDp8Ph9Pf6nO4fzwvrH0pd5t7 DVW3raA3pgQM+Pqg/jjW/Svljyz5HDzp4hn9DOaLANF+sqIjedo8LYHeRy0SzOFt8taL Xatg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:dkim-signature; bh=lg98PekJjJNpsVcYtJkwW/OVYg6wZ+XMQna/VA2K26E=; b=LygRjKZJqic1RcS0KicIfFP+NRr3o+AVMMX40r/eJo6pV4kpJJ1VoxzvOSliDBHG9V M5pQGjqRXCcYMekIRAShVpS8PSz+mhxNbVtVYR1aV5R5m0V6rc07eMHgUPuB073lKHIK UBMnubS1VbdJNFW7BENso+SAU7kWd50Wx8Ik+ZCRYdcUzFxZxGn4YhSNsMhuArsAgr3+ /1vlOHAxCPzYo/P0oRwUrxHBvvb88+krMtX0JAYf1l4cu/AhMIu6x5gH8NCX6WmfI00X 0L6QeKkdEQeyZKCNEPku1t9zbZNpADm/ZMFAVvbXQutwQS168eyWkllnm2uW/pG9TnFi It7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Y5aUEDJG; 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=fail (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 x17-v6si20351234pgl.414.2018.10.09.06.52.31; Tue, 09 Oct 2018 06:52:45 -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=fail header.i=@gmail.com header.s=20161025 header.b=Y5aUEDJG; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726670AbeJIVHw (ORCPT + 99 others); Tue, 9 Oct 2018 17:07:52 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:39337 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726415AbeJIVHw (ORCPT ); Tue, 9 Oct 2018 17:07:52 -0400 Received: by mail-ed1-f68.google.com with SMTP id d15-v6so1757359edq.6; Tue, 09 Oct 2018 06:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=lg98PekJjJNpsVcYtJkwW/OVYg6wZ+XMQna/VA2K26E=; b=Y5aUEDJGzLYxJRHlX75egSdDE36kmT13x8skOCDlsUvKAvC3gGkazVL52bE/N6uRS2 64ENhkVpbSA4ZIN/M36kTiLz93VphhEQpay3qhv8BGkj8BZWhfV6WGAdhmOCBQaUTOYf k+jIcp6VVaxnFqsVe3khJsRbXt4yAAE0z56MrILCfnRtfpQNtP8oH1SdjOENsCNMDD4X IJpSA1C460RtU1HLFOy44AcfYVkEKQMDyJiA4vCrxOxcpEjxTXs5UDyKkVwNXOoY8Kw0 jLpFKVLsoRNAX2BNXQDWoAks5O/V9xyrFviWBo/G6o6Btq07q2OU8tMtDf1l/onWXPQR td9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=lg98PekJjJNpsVcYtJkwW/OVYg6wZ+XMQna/VA2K26E=; b=LsEymclzEJgktvd9wMcK311ftklML5AeqN3Biwpa8LvaRw4R4C8N5TZicHRiliZTyo JguAGMoe7F0tWW67MwO/39Mj3O0fW/0YewHw6PWj+Be0hOwCGWwiGXkbVN/M8Qu+QVV2 a4YVcF5U0gkCmQxd/MZWEO7NNOoeIU2REoSTNH54zzJAc09TW0u+tNyfVPRnBx/Q3XVp 2GFwTRxGQNPfplA8GP9sSRQMg5ksJgoHAMzBLIG1MUh3ShlIm7QvmY7ZJl1XCEMD/Lfq wTgtiXwilwN5htXhAh3XeP8P2JEOM5mnu/jEyk1tOA3rX66q6M39VnpZUe12sLKL9j2g xzvw== X-Gm-Message-State: ABuFfohSll6gRH+4/kdTa+iyCCnlUnCa+Qj+P98jHpvWLlZPu/g7XqHh BBuN2ayNHq8P1UC6JehR6vc= X-Received: by 2002:a17:906:7a4a:: with SMTP id i10-v6mr28247440ejo.234.1539093048437; Tue, 09 Oct 2018 06:50:48 -0700 (PDT) Received: from localhost ([87.54.42.112]) by smtp.gmail.com with ESMTPSA id d4-v6sm3584063ejd.1.2018.10.09.06.50.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 06:50:47 -0700 (PDT) From: Esben Haabendal To: Mark Brown Cc: Boris Brezillon , Chuanhua Han , "linux-spi\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" Subject: Re: [PATCH 1/2] spi: spi-mem: Add the spi_set_xfer_bpw function In-Reply-To: <20181009103328.GA20774@sirena.org.uk> (Mark Brown's message of "Tue, 9 Oct 2018 11:33:28 +0100") References: <20180921070628.35153-1-chuanhua.han@nxp.com> <20180928084431.300b7bf9@bbrezillon> <20180928091833.15e95f7f@bbrezillon> <20181009120522.6b2bd15a@bbrezillon> <20181009103328.GA20774@sirena.org.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Date: Tue, 09 Oct 2018 15:50:45 +0200 Message-ID: <87o9c32pqi.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark Brown writes: > On Tue, Oct 09, 2018 at 12:05:22PM +0200, Boris Brezillon wrote: >> On Tue, 9 Oct 2018 09:52:23 +0000 >> Chuanhua Han wrote: > >> > 1. In the dspi driver (spi controller), bits_per_word >> > (dspi->bits_per_word = transfer->bits_per_word) passed from the upper >> > layer (spi-mem.c) is used. In this way, I can only assign the >> > appropriate value of transfer->bits_per_word before passing to the >> > controller, that is, the controller driver does not know the value of >> > bits_per_word, and it will use this value when the upper level sets >> > what value is passed. > >> I think you're missing my point: ->bits_per_word is not what you're >> looking for if what you're trying to do is use 32-bits accesses when >> things are properly aligned. > > To be clear: bits_per_word affects what goes out on the SPI bus (4 byte > words swapped to be in MSB first order), it needn't have any effect on > on what goes on inside the SoC - many controllers fill their FIFO in 32 > bit blocks even when sending 8 bit SPI words. Exactly. I believe behind all the confusion here, is the fact that the current spi-fsl-dspi.c driver does not utilize all the possible features of the DSPI controller. 1. DMA support requires a nasty workaround before it can be enabled for LS1021A. 2. EOQ mode is not enabled (and not tested) for some platforms which might actually support it. 3. Cyclic command transfer is not implemented. So in order to improve performance on LS1021A, I propose to do work on above issues. I believe the performance improvement that can be gained is likely to be biggest for 1 (DMA support), and smallest for 3 (cyclic command transfer). I don't have access to any coldfire boards, so I haven't tested EOQ mode (it is only enabled for coldfire currently), so I cannot really know if there are some bugs hiding there. /Esben