From: Martin Kaiser <martin@kaiser.cx>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: u.kleine-koenig@baylibre.com, imx@lists.linux.dev,
Alexander Stein <alexander.stein@ew.tq-group.com>,
Fabio Estevam <festevam@gmail.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
linux-spi@vger.kernel.org, Mark Brown <broonie@kernel.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Francesco Dolcini <francesco.dolcini@toradex.com>,
Shawn Guo <shawnguo@kernel.org>,
linux-arm-kernel@lists.infradead.org, T.Scherer@eckelmann.de
Subject: Re: [PATCH] spi: imx: Don't expect DMA for i.MX{25, 35, 50, 51, 53} cspi devices
Date: Thu, 13 Jun 2024 18:11:18 +0200 [thread overview]
Message-ID: <ZmsaJnASSkO3I19t@akranes.kaiser.cx> (raw)
In-Reply-To: <20240612-rebel-thick-chital-2f7bfa-mkl@pengutronix.de>
Hello Marc,
Thus wrote Marc Kleine-Budde (mkl@pengutronix.de):
> Hello Martin,
> On 15.05.2024 21:26:17, Martin Kaiser wrote:
> > Thus wrote Martin Kaiser (martin@kaiser.cx):
> > > > However this breaks SPI transfers, when I try to read out an MRAM I get:
> > > > root@ecu02:~ hexdump -C /dev/mtd4
> > > > [ 71.813807] spi_imx 43fa4000.spi: I/O Error in DMA TX
> > > > [ 71.819173] spi-nor spi0.2: SPI transfer failed: -110
> > > > [ 71.829129] spi_master spi0: failed to transfer one message from queue
> > > > [ 71.843962] spi_master spi0: noqueue transfer failed
> > > > So it would indeed be interesting if you ever managed to use DMA on
> > > > i.MX25.
> > > I believe so. Looking into my notes from 2016 (when I last tried this), I got
> > > the -110 error when the SMC bit in CONREG wasn't set. But this should now be
> > > done in mx31_prepare_transfer if DMA is used...
> > > I'll try to set up a test some time next week.
> > I can now reproduce the dma tx error. My test board uses a dummy spidev device
> > on cspi1 and configures loopback on the cspi1 controller (disabling loopback
> > makes no difference).
> > I'm relatively sure that this setup did work back in 2016/17.
> > Commit 24bb244e02a6 ("ARM: i.MX25: globally disable supervisor protect") was
> > required before any DMA transfers started working on imx25. As far as I can
> > see, this code is still present.
> > I'll look into this a bit more as time permits.
> have you found the time to look into this?
I did have another look but couldn't get DMA to work :-(
I got to the point where tx seemed to work and rx failed. The tx callback
function was called from the dma core and rx timed out. However, looking at
the mosi, miso and clk signals, there was no clock and no data transmission on
the bus.
The dev_dbg prints in imx-sdma didn't show anything that looked wrong...
I'll have another go some time soon. In the meantime, feel free to merge this
patch and disable DMA on imx25.
Best regards,
Martin
next prev parent reply other threads:[~2024-06-13 16:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 9:56 [PATCH] spi: imx: Don't expect DMA for i.MX{25,35,50,51,53} cspi devices Uwe Kleine-König
2024-05-08 13:44 ` Martin Kaiser
2024-05-10 12:32 ` [PATCH] spi: imx: Don't expect DMA for i.MX{25, 35, 50, 51, 53} " Uwe Kleine-König
2024-05-10 13:40 ` Uwe Kleine-König
2024-05-12 16:14 ` Martin Kaiser
2024-05-15 19:26 ` Martin Kaiser
2024-06-12 16:52 ` Marc Kleine-Budde
2024-06-13 16:11 ` Martin Kaiser [this message]
2024-06-23 12:07 ` [PATCH] spi: imx: Don't expect DMA for i.MX{25,35,50,51,53} " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZmsaJnASSkO3I19t@akranes.kaiser.cx \
--to=martin@kaiser.cx \
--cc=T.Scherer@eckelmann.de \
--cc=alexander.stein@ew.tq-group.com \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=francesco.dolcini@toradex.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).