<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/spi/spi-topcliff-pch.c, branch docs-fixes</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-fixes</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-fixes'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2026-04-20T11:39:31+00:00</updated>
<entry>
<title>spi: topcliff-pch: fix use-after-free on unbind</title>
<updated>2026-04-20T11:39:31+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2026-04-14T13:43:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9d72732fe70c11424bc90ed466c7ccfa58b42a9a'/>
<id>urn:sha1:9d72732fe70c11424bc90ed466c7ccfa58b42a9a</id>
<content type='text'>
Give the driver a chance to flush its queue before releasing the DMA
buffers on driver unbind

Fixes: c37f3c2749b5 ("spi/topcliff_pch: DMA support")
Cc: stable@vger.kernel.org	# 3.1
Cc: Tomoya MORINAGA &lt;tomoya-linux@dsn.okisemi.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://patch.msgid.link/20260414134319.978196-9-johan@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: topcliff-pch: fix controller deregistration</title>
<updated>2026-04-20T11:39:30+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2026-04-14T13:43:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5d6f477d6fc0767c57c5e1e6f55a1662820eef87'/>
<id>urn:sha1:5d6f477d6fc0767c57c5e1e6f55a1662820eef87</id>
<content type='text'>
Make sure to deregister the controller before disabling and releasing
underlying resources like interrupts and DMA during driver unbind.

Fixes: e8b17b5b3f30 ("spi/topcliff: Add topcliff platform controller hub (PCH) spi bus driver")
Cc: stable@vger.kernel.org	# 2.6.37
Cc: Masayuki Ohtake &lt;masa-korg@dsn.okisemi.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://patch.msgid.link/20260414134319.978196-8-johan@kernel.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Convert 'alloc_obj' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-02-22T00:37:42+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43'/>
<id>urn:sha1:bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43</id>
<content type='text'>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace kmalloc with kmalloc_obj for non-scalar types</title>
<updated>2026-02-21T09:02:28+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2026-02-21T07:49:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=69050f8d6d075dc01af7a5f2f550a8067510366f'/>
<id>urn:sha1:69050f8d6d075dc01af7a5f2f550a8067510366f</id>
<content type='text'>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: Switch back to struct platform_driver::remove()</title>
<updated>2024-09-29T23:12:23+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@baylibre.com</email>
</author>
<published>2024-09-25T11:35:00+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=494c3dc467768782f93f1433650c56b08feb54ea'/>
<id>urn:sha1:494c3dc467768782f93f1433650c56b08feb54ea</id>
<content type='text'>
After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.

Convert all platform drivers below drivers/spi to use .remove(), with
the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.

The change for the spi-npcm-fiu stands out in the diffstat because the
inconsistent formatting style of the platform_driver initializer is
fixed to match the other struct initializer in the file.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@baylibre.com&gt;
Link: https://patch.msgid.link/20240925113501.25208-2-u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: topcliff-pch: switch to use modern name</title>
<updated>2023-12-11T12:55:07+00:00</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2023-11-28T09:30:22+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=40daed14705ee76b35717ffedc80a7f281023bca'/>
<id>urn:sha1:40daed14705ee76b35717ffedc80a7f281023bca</id>
<content type='text'>
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Link: https://msgid.link/r/20231128093031.3707034-18-yangyingliang@huawei.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: Replace all spi-&gt;chip_select and spi-&gt;cs_gpiod references with function call</title>
<updated>2023-03-11T12:34:01+00:00</updated>
<author>
<name>Amit Kumar Mahapatra via Alsa-devel</name>
<email>alsa-devel@alsa-project.org</email>
</author>
<published>2023-03-10T17:32:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9e264f3f85a56cc109cc2d6010a48aa89d5c1ff1'/>
<id>urn:sha1:9e264f3f85a56cc109cc2d6010a48aa89d5c1ff1</id>
<content type='text'>
Supporting multi-cs in spi drivers would require the chip_select &amp; cs_gpiod
members of struct spi_device to be an array. But changing the type of these
members to array would break the spi driver functionality. To make the
transition smoother introduced four new APIs to get/set the
spi-&gt;chip_select &amp; spi-&gt;cs_gpiod and replaced all spi-&gt;chip_select and
spi-&gt;cs_gpiod references with get or set API calls.
While adding multi-cs support in further patches the chip_select &amp; cs_gpiod
members of the spi_device structure would be converted to arrays &amp; the
"idx" parameter of the APIs would be used as array index i.e.,
spi-&gt;chip_select[idx] &amp; spi-&gt;cs_gpiod[idx] respectively.

Signed-off-by: Amit Kumar Mahapatra &lt;amit.kumar-mahapatra@amd.com&gt;
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt; # Rockchip drivers
Reviewed-by: Michal Simek &lt;michal.simek@amd.com&gt;
Reviewed-by: Cédric Le Goater &lt;clg@kaod.org&gt; # Aspeed driver
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt; # SPI Cadence QSPI
Reviewed-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt; # spi-stm32-qspi
Acked-by: William Zhang &lt;william.zhang@broadcom.com&gt; # bcm63xx-hsspi driver
Reviewed-by: Serge Semin &lt;fancer.lancer@gmail.com&gt; # DW SSI part
Link: https://lore.kernel.org/r/167847070432.26.15076794204368669839@mailman-core.alsa-project.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: topcliff-pch: Convert to platform remove callback returning void</title>
<updated>2023-03-06T21:18:23+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-03-03T17:20:36+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b082694f18bdff807b42a3bccc62c3a524168f23'/>
<id>urn:sha1:b082694f18bdff807b42a3bccc62c3a524168f23</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20230303172041.2103336-83-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: topcliff-pch: Use core message validation</title>
<updated>2022-06-20T11:43:36+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2022-06-15T17:41:38+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=26f30e3ee1bf120af1bde22d890e46a0c8dbeca0'/>
<id>urn:sha1:26f30e3ee1bf120af1bde22d890e46a0c8dbeca0</id>
<content type='text'>
The topcliff-pch driver requires TX and RX buffers on all transfers, open
coding checks for this. Remove those open coded checks and instead rely on
the core functionality, which has the added bonus that it will fix up any
transfers submitted by drivers as needed rather than erroring out.

Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/r/20220615174138.4060912-1-broonie@kernel.org
</content>
</entry>
<entry>
<title>spi: topcliff-pch: Prevent usage of potentially stale DMA device</title>
<updated>2022-03-08T12:28:07+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2022-03-07T17:37:40+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=80ab9012bbf1011f57c06b3c6e4ac3816c4a86f5'/>
<id>urn:sha1:80ab9012bbf1011f57c06b3c6e4ac3816c4a86f5</id>
<content type='text'>
DMA device is expected to be available while SPI transfer is ongoing.

Prevent usage of potentially stale DMA device by keeping reference
count till the end of the transfer.

Fixes: 4d986ffa036a ("spi: add missing pci_dev_put() before return")
Reported-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220307173740.80996-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
