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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2B949C47258 for ; Wed, 31 Jan 2024 19:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bwHUbUrqIU/QAW1qu5U/u+3usU+XMfgwDIyd0VwaoV8=; b=x5MQwY6v/CxoAl 8pneG/3lb9ofTezitVQzo4TUYf83qZfwaw8it2CA2obSWCrqEHDX1j5obIIV9gDC1g+BubH6Utij4 O76RiJnEFD07y0dznsQNw0p4j5vMRKSbf2Hsq8IYVVnYkP1uNAU01f40+Cyv92Th0K4eArbhyR7Gu NhU4AVHU2eyN+iK3w1w2h9MSnjMQIiFOJVzo5US8EDB+id096FoZp4kkYoWLUApQlgD/yXT4Ji7TE WRaw0Mywy+4bOKahT1ftDIeIvEg54KtKlUMXxLzYu4ZKnN911LT7/VxmeQo0G7QooWrPLvUYJjJ52 vFxWvA5QMLZCLBmsVzBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVGPm-00000005Eoa-1YDX; Wed, 31 Jan 2024 19:38:30 +0000 Received: from mail11.truemail.it ([217.194.8.81]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVGPi-00000005Enk-38n6 for linux-arm-kernel@lists.infradead.org; Wed, 31 Jan 2024 19:38:29 +0000 Received: from francesco-nb (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id ED4D422B70; Wed, 31 Jan 2024 20:38:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dolcini.it; s=default; t=1706729900; bh=4KgBcDDcoMs8fG0dEY3Dm7hjBSTlNxIeG1TsDHMcHNo=; h=From:To:Subject; b=mahihcdMQv09p0PzYMC4C86uQLxzdZaQyhoo/SUoT4QouurVHH56qFbdhPE00nU0X Qn7admYFCn6kqj2gIcqedBYHuHApbB2St/4ac9UOcuH0FQbdd4RhbXi+MSqRvTXdg2 K8hEiqc7ErOucLAJxRo1DpoGmCdY4gCzoZWl6n08/hm8VwzsAK116XOgfJ85HG3Yrr SVDahalzk35FT1v205isoXrhdvXB1DNtsc9Jxrp1HqFo9Jp+x8JaaUxu5BLnEuQqr1 2t+IlIgp3oZ4cJ6p1jWld/7BCCtPAaDi4JcC/ymGsZls4TZSxVDE9tYl7z2db3m8yM iVScNMclflLHQ== Date: Wed, 31 Jan 2024 20:38:14 +0100 From: Francesco Dolcini To: carlos.song@nxp.com Cc: broonie@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, linux-imx@nxp.com, benjamin@bigler.one, stefanmoring@gmail.com, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] spi: imx: fix the burst length at DMA mode and CPU mode Message-ID: <20240131193814.GA12870@francesco-nb> References: <20240131024623.329240-1-carlos.song@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240131024623.329240-1-carlos.song@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240131_113827_697364_689CE653 X-CRM114-Status: GOOD ( 16.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 31, 2024 at 10:46:23AM +0800, carlos.song@nxp.com wrote: > From: Carlos Song > > For DMA mode, the bus width of the DMA is equal to the size of data > word, so burst length should be configured as bits per word. > > For CPU mode, because of the spi transfer len is in byte, so burst > length should be configured as bits per byte * spi_imx->count. > > Signed-off-by: Carlos Song > Reviewed-by: Clark Wang > Fixes: e9b220aeacf1 ("spi: spi-imx: correctly configure burst length when using dma") > Fixes: 5f66db08cbd3 ("spi: imx: Take in account bits per word instead of assuming 8-bits") Cc:stable... > --- > drivers/spi/spi-imx.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c > index 546cdce525fc..b4ade2d53fef 100644 > --- a/drivers/spi/spi-imx.c > +++ b/drivers/spi/spi-imx.c > @@ -54,7 +54,7 @@ MODULE_PARM_DESC(polling_limit_us, > #define MX51_ECSPI_CTRL_MAX_BURST 512 > /* The maximum bytes that IMX53_ECSPI can transfer in target mode.*/ > #define MX53_MAX_TRANSFER_BYTES 512 > - > +#define BITS_PER_BYTE 8 this is already defined in linux/bits.h, just use it from there. Francesco _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel