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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38A24C2BB3F for ; Mon, 20 Nov 2023 16:46:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231904AbjKTQqh (ORCPT ); Mon, 20 Nov 2023 11:46:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233809AbjKTQqU (ORCPT ); Mon, 20 Nov 2023 11:46:20 -0500 Received: from smtp-8fae.mail.infomaniak.ch (smtp-8fae.mail.infomaniak.ch [IPv6:2001:1600:4:17::8fae]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04B67139 for ; Mon, 20 Nov 2023 08:45:33 -0800 (PST) Received: from smtp-2-0001.mail.infomaniak.ch (unknown [10.5.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4SYtff0MFrzMq6hk; Mon, 20 Nov 2023 16:45:30 +0000 (UTC) Received: from unknown by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4SYtfd44ZgzMpnPh; Mon, 20 Nov 2023 17:45:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bigler.io; s=20200409; t=1700498729; bh=7FT4vey4M0IFQTQ3VKqZdUegCZYs+l920IgntzrCIDw=; h=Date:Subject:From:Reply-To:To:Cc:References:In-Reply-To:From; b=cSi02sYz4HKFvWUzw/BC1YhAQHM2EP0g18WJC9gnMpY3dJ5NojWBR5KISQMJ0s/Pe zVoEznPQiNFsN3x9bCgFN2h4goeFxLw5+rqzqQFLqDetEEtZ7JvdkvkeYgIWqjVhc2 ojvY8UK2m8FV35mLF7zM7gaV/JotU1GoENf0JQhg= Message-ID: <314e596f4f7b7e7f8742c47dfeeb7d93@mail.infomaniak.com> Date: Mon, 20 Nov 2023 17:45:29 +0100 Subject: Re: spi: imx: Increase imx51 ecspi burst length fails on imx6dl and imx8mm From: linux@bigler.io Reply-To: linux@bigler.io To: Stefan Moring Cc: Francesco Dolcini , Linux regressions mailing list , Mark Brown , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-WS-User-Origin: eyJpdiI6ImtDMngxZlYwKzA3QlIvTXM1bGtYQnc9PSIsInZhbHVlIjoiWDhCLzRCZTFHRE4zZmVFbFRZNS9FUT09IiwibWFjIjoiYzZjY2Q1YTY0MGQzNzYxYTM2ODljNmExY2VlNjlhMTg3MWFiYTEyOWRmMzcwMTQ1NjA5YjdmOGVhMzIzZDZkYiIsInRhZyI6IiJ9 X-WS-User-Mbox: eyJpdiI6ImwrN2RvVlBNdDZzZmdlMUx1STNPenc9PSIsInZhbHVlIjoia21ydXZ3RWpUWElPZlF1RmM1YSs4Zz09IiwibWFjIjoiYWEwYzU3MDk3YzA1MDMyZDhiYjBjMmM2M2UxMTM4OGM5NjAxMzI3ZDkwYjVjMGE1MmQ4ZjdkMzlhMjNiNmUyOSIsInRhZyI6IiJ9 X-WS-Location: eJxzKUpMKykGAAfpAmU- X-Mailer: Infomaniak Workspace (1.3.596) References: <8a415902c751cdbb4b20ce76569216ed@mail.infomaniak.com> <2fcdd99eee9ee4f5d34fa1abab2f51bb@mail.infomaniak.com> <86566391db9c5044f1a082bc8ec697a2@mail.infomaniak.com> <6322fd4c1967a518310140c35ab34f65@mail.infomaniak.com> In-Reply-To: X-Infomaniak-Routing: alpha Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Hi Stefan I added my printing=20 @@ -655,12 +658,25 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx= _data *spi_imx, =20 /* Clear BL field and set the right value */ ctrl &=3D ~MX51_ECSPI_CTRL_BL_MASK; + dev_info(spi_imx->dev, "%s: count=3D%d, bits_per_word=3D%d\n", + __FUNCTION__, spi_imx->count, spi_imx->bits_per_word); + if (spi_imx->target_mode && is_imx53_ecspi(spi_imx)) ctrl |=3D (spi_imx->target_burst * 8 - 1) << MX51_ECSPI_CTRL_BL_OFFSET; and run the test with the burst enabled=20 /var/volatile/tmp# spidev_test --device /dev/spidev1.0 --speed 20000000 --b= pw 8 -i 127bytes-spi-test-data.bin -o 127bytes-spi-test-result.bin [ 802.729824] spi_imx 30830000.spi: mx51_ecspi_prepare_transfer: count=3D1= 27, bits_per_word=3D8 -> transmitted 504 Bytes on the line then I run it with burst disabled spidev_test --device /dev/spidev1.0 --speed 20000000 --bpw 8 -i 127bytes-sp= i-test-data.bin -o 127bytes-spi-test-result.bin [ 316.683807] spi_imx 30830000.spi: mx51_ecspi_prepare_transfer: count=3D0= , bits_per_word=3D8 -> transmitted 127 Bytes on the line The count is different=20 - for burst-enabled 127 - for burst-disable 0 concerning the sdma-firmware I checked on=20 https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git= /tree/imx/sdma but the latest I found was 4.5 Regards Stefan Am 2023-11-20T16:30:15.000+01:00 hat Stefan Moring geschrieben: > Hi Stefan, >=20 > I have been trying to reproduce your error on my iMX8M, scoping the SPI > lines, but everything works as expected. I don't have the exact same boar= d, > but I don't think that should be a problem. One difference I noticed is > that my imx-sdma firmware is version 4.6. >=20 > Can you verify the values used for the transfer, spi_imx->count and > spi_imx->bits_per_word inside the mx51_ecpsi_prepare_transfer() method? > Those are the only two things that changed in the commits. Maybe compare > them to the working version? >=20 > Kind regards, >=20 > Stefan Moring >=20 > Op ma 20 nov 2023 om 11:18 schreef Francesco Dolcini : >=20 >=20 > > On Mon, Nov 20, 2023 at 10:33:38AM +0100, linux@bigler.io wrote: > >=20 > > > I run the test and it worked fine. The transmitted data matches w= ith > > > the recived data, no diff. > > ok, thanks for confirming. At least we are on the same page. > >=20 > >=20 > > > BUT!!! on the MDIO it is completly different !!! > > > When I request to send 4kB Data I measure on the line 16384Byte. > > > =20 > > > The data is again 3Dummy Bytes followed by the databyte. > > > So the error symetic on send and recive > > =20 > > ok, that's annoying. I wonder if the loopback test could be improved t= o > > spot such kind of issues, maybe we could verify if the execution time > > is reasonable given the SPI clock frequency and the payload size ... > >=20 > > Francesco > >=20 >=20 >=20 >