<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/tools/spi, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>spi: spidev_test: rewrite unescape() to stay in bounds</title>
<updated>2026-09-24T20:58:08+00:00</updated>
<author>
<name>Jonas Rebmann</name>
<email>jre@pengutronix.de</email>
</author>
<published>2026-09-24T13:44:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c79bbeadabc07e9a4c68ca16a3744a2264d6fbae'/>
<id>c79bbeadabc07e9a4c68ca16a3744a2264d6fbae</id>
<content type='text'>
unescape() could read the source buffer out of bounds for inputs like
"\\x" and could write the destination buffer out of bounds due to lack
of checking against the len parameter.

For better readability and consistency, rewrite it as a simplified
version of unescape_string() in string_helpers.h. This includes
rearranging src and dst parameters.

Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-13-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
unescape() could read the source buffer out of bounds for inputs like
"\\x" and could write the destination buffer out of bounds due to lack
of checking against the len parameter.

For better readability and consistency, rewrite it as a simplified
version of unescape_string() in string_helpers.h. This includes
rearranging src and dst parameters.

Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-13-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: print TX on error</title>
<updated>2026-09-24T20:58:06+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2026-09-24T13:44:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a73c71e1f25a4f7d6266a6c1cc5e3c903b52cc6a'/>
<id>a73c71e1f25a4f7d6266a6c1cc5e3c903b52cc6a</id>
<content type='text'>
If sending an spi message fails, dump its first up to 256 bytes to the
console.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-12-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If sending an spi message fails, dump its first up to 256 bytes to the
console.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-12-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: add option to split message into multiple transfers</title>
<updated>2026-09-24T20:58:02+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2026-09-24T13:44:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=31ce698070aa1e177f8e608d7fb92045fb01275c'/>
<id>31ce698070aa1e177f8e608d7fb92045fb01275c</id>
<content type='text'>
SPI_IOC_MESSAGE() submits a single SPI message containing one or more
transfers. Introduce an option to allow splitting the message into
multiple transfers.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-11-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SPI_IOC_MESSAGE() submits a single SPI message containing one or more
transfers. Introduce an option to allow splitting the message into
multiple transfers.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-11-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: send predictable data</title>
<updated>2026-09-24T20:57:56+00:00</updated>
<author>
<name>Jonas Rebmann</name>
<email>jre@pengutronix.de</email>
</author>
<published>2026-09-24T13:44:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c807c71d21eb77862fc497899720d28d5a149830'/>
<id>c807c71d21eb77862fc497899720d28d5a149830</id>
<content type='text'>
Introduce a flag to test on a predictable byte sequence instead of
random bytes. This is useful when comparing multiple runs with the same
option set e.g. with an oscilloscope.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-10-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce a flag to test on a predictable byte sequence instead of
random bytes. This is useful when comparing multiple runs with the same
option set e.g. with an oscilloscope.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-10-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: don't send 0x0 or 0xff</title>
<updated>2026-09-24T20:57:55+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2026-09-24T13:43:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=951a60af6c0baa36d6bed82cf3f7e8b754426ea7'/>
<id>951a60af6c0baa36d6bed82cf3f7e8b754426ea7</id>
<content type='text'>
Particularly when using compare mode, if the controller fails to
transfer any data, asserting on a read of 0x00 or 0xff may lead to a
false negative test, indicating a byte was successfully transferred when
the values simply originate from the pull-up or pull-down of RX.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-9-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Particularly when using compare mode, if the controller fails to
transfer any data, asserting on a read of 0x00 or 0xff may lead to a
false negative test, indicating a byte was successfully transferred when
the values simply originate from the pull-up or pull-down of RX.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-9-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: allow disabling rx or tx buffers</title>
<updated>2026-09-24T20:57:53+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2026-09-24T13:43:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2b908c75a8103efbcefe9c6efa290c58c8fe849'/>
<id>d2b908c75a8103efbcefe9c6efa290c58c8fe849</id>
<content type='text'>
Allow not providing rx or tx buffers. This is useful to check if drivers
that don't use SPI_CONTROLLER_MUST_RX (or -TX respectively) handle their
operations correctly without a buffer.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-8-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow not providing rx or tx buffers. This is useful to check if drivers
that don't use SPI_CONTROLLER_MUST_RX (or -TX respectively) handle their
operations correctly without a buffer.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-8-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: add compare mode</title>
<updated>2026-09-24T20:57:52+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2026-09-24T13:43:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a47226866b8ae4c3a63802b668cdb99f4a76b151'/>
<id>a47226866b8ae4c3a63802b668cdb99f4a76b151</id>
<content type='text'>
Check whether the received data correspond to the transferred data but
without enabling loopback mode in the controller.

This is for testing with TX physically bridged to RX which is useful if
a loopback mode is unavailable or insufficient.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-7-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check whether the received data correspond to the transferred data but
without enabling loopback mode in the controller.

This is for testing with TX physically bridged to RX which is useful if
a loopback mode is unavailable or insufficient.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-7-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: always compare loopback data</title>
<updated>2026-09-24T20:57:51+00:00</updated>
<author>
<name>Jonas Rebmann</name>
<email>jre@pengutronix.de</email>
</author>
<published>2026-09-24T13:43:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2d736e05dbcd1294ed621fe5d4b6d06ef0c259be'/>
<id>2d736e05dbcd1294ed621fe5d4b6d06ef0c259be</id>
<content type='text'>
In loopback mode, spidev_test verifies that the received data matches
the sent data. However this test was only performed when random data was
transferred using the -S switch. Always perform the test by moving it
from transfer_buf() to transfer().

Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-6-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In loopback mode, spidev_test verifies that the received data matches
the sent data. However this test was only performed when random data was
transferred using the -S switch. Always perform the test by moving it
from transfer_buf() to transfer().

Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-6-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: abort when -I is selected without -S</title>
<updated>2026-09-24T20:57:50+00:00</updated>
<author>
<name>Jonas Rebmann</name>
<email>jre@pengutronix.de</email>
</author>
<published>2026-09-24T13:43:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=683d7fac9b0ff7aa8f0ff2ccfa0f4bbba99ee273'/>
<id>683d7fac9b0ff7aa8f0ff2ccfa0f4bbba99ee273</id>
<content type='text'>
-I (--iter) for transferring multiple iterations of the selected input
currently only has an effect when transferring random data using -S
(--size). Error out if -I is used without -S to avoid confusion.

Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-5-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
-I (--iter) for transferring multiple iterations of the selected input
currently only has an effect when transferring random data using -S
(--size). Error out if -I is used without -S to avoid confusion.

Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-5-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: spidev_test: allow zero-length transfers</title>
<updated>2026-09-24T20:57:49+00:00</updated>
<author>
<name>Jonas Rebmann</name>
<email>jre@pengutronix.de</email>
</author>
<published>2026-09-24T13:43:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bd511c42d290807a04a325d584d65b98fd6721d7'/>
<id>bd511c42d290807a04a325d584d65b98fd6721d7</id>
<content type='text'>
SPI drivers may in fact handle zero-length transfers. The behavior so
far was that such transfers would be executed but then result in the
"can't send spi message" error message because the spi_sync() call
returning 0 would be treated as an error while really it simply
indicates that zero bytes were successfully transferred in a message.

Don't treat a return value of zero as indication of an error.

Update hex_dump() to work with empty buffers now printing e.g.

  TX | __ ||

Now including a trailing newline.

Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-4-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SPI drivers may in fact handle zero-length transfers. The behavior so
far was that such transfers would be executed but then result in the
"can't send spi message" error message because the spi_sync() call
returning 0 would be treated as an error while really it simply
indicates that zero bytes were successfully transferred in a message.

Don't treat a return value of zero as indication of an error.

Update hex_dump() to work with empty buffers now printing e.g.

  TX | __ ||

Now including a trailing newline.

Signed-off-by: Jonas Rebmann &lt;jre@pengutronix.de&gt;
Link: https://patch.msgid.link/20260924-spi-sun4i-spidev_test-v7-4-126e31a07fdc@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
