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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 7B650C433DF for ; Mon, 18 May 2020 11:01:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 642E1207F5 for ; Mon, 18 May 2020 11:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbgERLBy (ORCPT ); Mon, 18 May 2020 07:01:54 -0400 Received: from mga01.intel.com ([192.55.52.88]:51126 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726279AbgERLBy (ORCPT ); Mon, 18 May 2020 07:01:54 -0400 IronPort-SDR: SO86lp8iWukT/WwInBfNlDfIRwQ/MshdUJHeor6AHGy+IWRxVMyNAmGveR2ruB+aQ0CE2H3jHY 2WzTKf+A6NXA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2020 04:01:53 -0700 IronPort-SDR: 3gUz7Y1e3P1D/HXW+7p6rvQVhAAsWMrOhnfmjtrQ09zy/EXx5p2f+mz47pOeHNs3cCYCWCELKX /YLNrnvSL6vQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,407,1583222400"; d="scan'208";a="299734767" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga008.jf.intel.com with ESMTP; 18 May 2020 04:01:48 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jadWo-007PMV-PU; Mon, 18 May 2020 14:01:50 +0300 Date: Mon, 18 May 2020 14:01:50 +0300 From: Andy Shevchenko To: Serge Semin Cc: Serge Semin , Mark Brown , Georgy Vlasov , Ramil Zaripov , Alexey Malahov , Thomas Bogendoerfer , Paul Burton , Ralf Baechle , Arnd Bergmann , Allison Randal , Gareth Williams , Rob Herring , linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Thomas Gleixner , Wan Ahmad Zainie , Jarkko Nikula , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 09/19] spi: dw: Parameterize the DMA Rx/Tx burst length Message-ID: <20200518110150.GX1634618@smile.fi.intel.com> References: <20200508132943.9826-1-Sergey.Semin@baikalelectronics.ru> <20200515104758.6934-1-Sergey.Semin@baikalelectronics.ru> <20200515104758.6934-10-Sergey.Semin@baikalelectronics.ru> <20200515140129.GD1634618@smile.fi.intel.com> <20200516143353.hw6nny5hbwgiyxfw@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200516143353.hw6nny5hbwgiyxfw@mobilestation> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 16, 2020 at 05:33:53PM +0300, Serge Semin wrote: > On Fri, May 15, 2020 at 05:01:29PM +0300, Andy Shevchenko wrote: > > On Fri, May 15, 2020 at 01:47:48PM +0300, Serge Semin wrote: > > > It isn't good to have numeric literals in the code especially if there > > > are multiple of them and they are related. Moreover in current > > > implementation the Tx DMA transfer activation level isn't optimal, > > > since it's hardwired to be at 16-32 bytes level, while it's better > > > to keep the SPI FIFO buffer as full as possible until all available > > > data is submitted. So lets introduce the DMA burst level > > > parametrization macros with optimal values - issue Rx transfer if at > > > least 16 bytes are available in the buffer and execute Tx transaction > > > if at least 16 bytes room is opened in SPI Tx FIFO. > > > > > - dw_writel(dws, DW_SPI_DMARDLR, 0xf); > > > - dw_writel(dws, DW_SPI_DMATDLR, 0x10); > > > + dw_writel(dws, DW_SPI_DMARDLR, RX_BURST_LEVEL - 1); > > > + dw_writel(dws, DW_SPI_DMATDLR, dws->fifo_len - TX_BURST_LEVEL); > > > > ...and if FIFO length is less than TX_BURST_LEVEL? > > > > For the patch that introduces definitions, i.e. keeping the last line here as > > > > dw_writel(dws, DW_SPI_DMATDLR, TX_BURST_LEVEL); > > > > I'm good. You may put your tag in that case. For fifo_len case we need to > > discuss in separate patch, perhaps. > > It's fixed in a consequent patch anyway. Though if v3 is required I'll remove > this change from here. I consider that here you might have introduced a regression and actually doing two things in one patch. Why not to split? -- With Best Regards, Andy Shevchenko