<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/spi/spi-loopback-test.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-12-03T11:45:06Z</updated>
<entry>
<title>spi: loopback-test: Don't use %pK through printk</title>
<updated>2025-12-03T11:45:06Z</updated>
<author>
<name>Thomas Weißschuh</name>
</author>
<published>2025-08-11T12:10:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fef692cbce9ac4da5a87594bfb1024c5705f1c91'/>
<id>urn:sha1:fef692cbce9ac4da5a87594bfb1024c5705f1c91</id>
<content type='text'>
[ Upstream commit b832b19318534bb4f1673b24d78037fee339c679 ]

In the past %pK was preferable to %p as it would not leak raw pointer
values into the kernel log.
Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
the regular %p has been improved to avoid this issue.
Furthermore, restricted pointers ("%pK") were never meant to be used
through printk(). They can still unintentionally leak raw pointers or
acquire sleeping locks in atomic contexts.

Switch to the regular pointer formatting which is safer and
easier to reason about.
There are still a few users of %pK left, but these use it through seq_file,
for which its usage is safe.

Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Link: https://patch.msgid.link/20250811-restricted-pointers-spi-v1-1-32c47f954e4d@linutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: loopback-test: Do not split 1024-byte hexdumps</title>
<updated>2025-06-04T12:32:28Z</updated>
<author>
<name>Geert Uytterhoeven</name>
</author>
<published>2025-05-02T11:10:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b383443f20c6e0a60f19b3237eab3f83076290d1'/>
<id>urn:sha1:b383443f20c6e0a60f19b3237eab3f83076290d1</id>
<content type='text'>
[ Upstream commit a73fa3690a1f3014d6677e368dce4e70767a6ba2 ]

spi_test_print_hex_dump() prints buffers holding less than 1024 bytes in
full.  Larger buffers are truncated: only the first 512 and the last 512
bytes are printed, separated by a truncation message.  The latter is
confusing in case the buffer holds exactly 1024 bytes, as all data is
printed anyway.

Fix this by printing buffers holding up to and including 1024 bytes in
full.

Fixes: 84e0c4e5e2c4ef42 ("spi: add loopback test driver to allow for spi_master regression tests")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://patch.msgid.link/37ee1bc90c6554c9347040adabf04188c8f704aa.1746184171.git.geert+renesas@glider.be
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spi-loopback-test: Fix 'tx_buf' might be 'rx_buf'</title>
<updated>2021-07-14T14:53:10Z</updated>
<author>
<name>Jay Fang</name>
</author>
<published>2021-05-10T06:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca5ea78475273dcaa0d6371f4f6c6980f573f2e5'/>
<id>urn:sha1:ca5ea78475273dcaa0d6371f4f6c6980f573f2e5</id>
<content type='text'>
[ Upstream commit 9e37a3ab0627011fb63875e9a93094b6fc8ddf48 ]

In function 'spi_test_run_iter': Value 'tx_buf' might be 'rx_buf'.

Signed-off-by: Jay Fang &lt;f.fangjian@huawei.com&gt;
Link: https://lore.kernel.org/r/1620629903-15493-5-git-send-email-f.fangjian@huawei.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spi-loopback-test: Fix out-of-bounds read</title>
<updated>2020-09-23T10:40:35Z</updated>
<author>
<name>Vincent Whitchurch</name>
</author>
<published>2020-09-02T13:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fa3ef52032ea688d5a51981717a5792d8c45e11'/>
<id>urn:sha1:7fa3ef52032ea688d5a51981717a5792d8c45e11</id>
<content type='text'>
[ Upstream commit 837ba18dfcd4db21ad58107c65bfe89753aa56d7 ]

The "tx/rx-transfer - crossing PAGE_SIZE" test always fails when
len=131071 and rx_offset &gt;= 5:

 spi-loopback-test spi0.0: Running test tx/rx-transfer - crossing PAGE_SIZE
 ...
   with iteration values: len = 131071, tx_off = 0, rx_off = 3
   with iteration values: len = 131071, tx_off = 0, rx_off = 4
   with iteration values: len = 131071, tx_off = 0, rx_off = 5
 loopback strangeness - rx changed outside of allowed range at: ...a4321000
   spi_msg@ffffffd5a4157690
     frame_length:  131071
     actual_length: 131071
     spi_transfer@ffffffd5a41576f8
       len:    131071
       tx_buf: ffffffd5a4340ffc

Note that rx_offset &gt; 3 can only occur if the SPI controller driver sets
-&gt;dma_alignment to a higher value than 4, so most SPI controller drivers
are not affect.

The allocated Rx buffer is of size SPI_TEST_MAX_SIZE_PLUS, which is 132
KiB (assuming 4 KiB pages).  This test uses an initial offset into the
rx_buf of PAGE_SIZE - 4, and a len of 131071, so the range expected to
be written in this transfer ends at (4096 - 4) + 5 + 131071 == 132 KiB,
which is also the end of the allocated buffer.  But the code which
verifies the content of the buffer reads a byte beyond the allocated
buffer and spuriously fails because this out-of-bounds read doesn't
return the expected value.

Fix this by using ITERATE_LEN instead of ITERATE_MAX_LEN to avoid
testing sizes which cause out-of-bounds reads.

Signed-off-by: Vincent Whitchurch &lt;vincent.whitchurch@axis.com&gt;
Link: https://lore.kernel.org/r/20200902132341.7079-1-vincent.whitchurch@axis.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157</title>
<updated>2019-05-30T18:26:37Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-05-27T06:55:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c942fddf8793b2013be8c901b47d0a8dc02bf99f'/>
<id>urn:sha1:c942fddf8793b2013be8c901b47d0a8dc02bf99f</id>
<content type='text'>
Based on 3 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version this program is distributed in the
  hope that it will be useful but without any warranty without even
  the implied warranty of merchantability or fitness for a particular
  purpose see the gnu general public license for more details

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version [author] [kishon] [vijay] [abraham]
  [i] [kishon]@[ti] [com] this program is distributed in the hope that
  it will be useful but without any warranty without even the implied
  warranty of merchantability or fitness for a particular purpose see
  the gnu general public license for more details

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version [author] [graeme] [gregory]
  [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
  [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
  [hk] [hemahk]@[ti] [com] this program is distributed in the hope
  that it will be useful but without any warranty without even the
  implied warranty of merchantability or fitness for a particular
  purpose see the gnu general public license for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1105 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Richard Fontana &lt;rfontana@redhat.com&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spi: loopback-test: implement testing with no CS</title>
<updated>2017-07-26T12:08:56Z</updated>
<author>
<name>Oleksij Rempel</name>
</author>
<published>2017-07-25T07:57:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8bc85a871436525cc38f819bbc122d216730e905'/>
<id>urn:sha1:8bc85a871436525cc38f819bbc122d216730e905</id>
<content type='text'>
To run spi-loopback-tests on HW without modifications, we need to
disable Chip Select. This should avoid surprising side effects for
SPI devices by testing patterns.

Signed-off-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: loopback-test: make several module parameters static</title>
<updated>2017-07-18T13:10:01Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2017-07-18T12:42:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59a8831da31ebdabf82cac82bf01270d215bf149'/>
<id>urn:sha1:59a8831da31ebdabf82cac82bf01270d215bf149</id>
<content type='text'>
Several module parameters are local to the source, so make them
static. Cleans up several sparse warnings such as:

"symbol 'loop_req' was not declared. Should it be static?"

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: loopback-test: provide loop_req option.</title>
<updated>2017-07-17T14:27:26Z</updated>
<author>
<name>Oleksij Rempel</name>
</author>
<published>2017-07-14T09:42:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f12a616e0cdee71440b72f7602825db424d37879'/>
<id>urn:sha1:f12a616e0cdee71440b72f7602825db424d37879</id>
<content type='text'>
Provide a module parameter to request internal loop by the SPI master
controller.
This should make loop testing easier without extra HW modification.

For test automation a logic analyzer is recommended for host
controller-independent verification.
An example test rig configuration and procedure:
  i.MX6S RIoRBoard           Logic Analyzer
  -----------------------------------------
  (J13  4) GND ------------- GND
  (J13  6) CSPI3-CLK ------&gt; PIN 3
  (J13  8) CSPI3-MOSI &lt;----- PIN 2
     ^ - internal loop configured by SPI_LOOP
     |   or can be user external jamper.
  (J13 10) CSPI3-MISO -----&gt; PIN 1

grab some data and decode it:
sigrok-cli -d fx2lafw --time 160000 --config samplerate=10m  \
  --channels 0-2 -o dump.sr
sigrok-cli -i dump.sr -P spi:mosi=1:clk=2 &gt; result_for_regression_tests

Signed-off-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: loopback-test: Fix kfree() NULL pointer error.</title>
<updated>2017-06-28T19:16:41Z</updated>
<author>
<name>Arvind Yadav</name>
</author>
<published>2017-06-20T09:30:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=704c3098e4c55a409eaf5ec89cee1bccc8d44f4c'/>
<id>urn:sha1:704c3098e4c55a409eaf5ec89cee1bccc8d44f4c</id>
<content type='text'>
Here, rx/tx allocation can fail. So avoid kvfree call
with NULL pointer.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: loopback-test: fix spelling mistake: "reruning" -&gt; "rerunning"</title>
<updated>2017-06-28T19:03:09Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2017-06-26T13:42:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=478de2ba0d2dafcd460b17f032139e2b6b4eb1ac'/>
<id>urn:sha1:478de2ba0d2dafcd460b17f032139e2b6b4eb1ac</id>
<content type='text'>
trivial fix to spelling mistake in dev_info error message

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
