<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rt-thread.git/components/drivers/spi/dev_spi_bus.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/rt-thread.git/atom/components/drivers/spi/dev_spi_bus.c?h=master</id>
<link rel='self' href='http://cgit.235523.xyz/rt-thread.git/atom/components/drivers/spi/dev_spi_bus.c?h=master'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/'/>
<updated>2026-01-20T14:05:28Z</updated>
<entry>
<title>[drivers] Fix OFW bus conflict and prevent duplicate device creation</title>
<updated>2026-01-20T14:05:28Z</updated>
<author>
<name>lhxj</name>
<email>2743257167@qq.com</email>
</author>
<published>2025-12-25T09:56:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=7641ef68855601bc73252546bf41a96d6078444e'/>
<id>urn:sha1:7641ef68855601bc73252546bf41a96d6078444e</id>
<content type='text'>
Problem:
When enumerating device tree nodes, platform bus and native buses (I2C/SPI)
may create duplicate devices for the same OFW node, causing cross-bus conflicts.
This triggers assertion failure '(dev-&gt;bus != new_bus)' in
rt_bus_reload_driver_device() during boot on minimal DM-enabled systems.

Root Cause:
1. Platform bus tries to reload devices that already belong to other buses
   by calling rt_bus_reload_driver_device(dev-&gt;bus, dev), which violates
   the API contract (requires dev-&gt;bus != new_bus).
2. Native buses (I2C/SPI) do not mark OFW nodes as occupied, so platform
   bus creates duplicate platform devices for I2C/SPI client nodes.

Solution:
1. components/drivers/core/platform_ofw.c: Return RT_EOK when np-&gt;dev exists,
   letting the native bus handle device lifecycle instead of cross-bus reload.
2. components/drivers/i2c/dev_i2c_bus.c: Mark i2c_client_np-&gt;dev during scan
   to prevent platform bus from duplicating I2C client devices.
3. components/drivers/spi/dev_spi_bus.c: Mark spi_dev_np-&gt;dev during scan
   to prevent platform bus from duplicating SPI devices.

Tested on Spacemit K1 RISC-V platform with minimal DM configuration.

Signed-off-by: lhxj &lt;2743257167@qq.com&gt;
</content>
</entry>
<entry>
<title>[SPI]Update and fixup the SPI</title>
<updated>2025-07-10T05:28:16Z</updated>
<author>
<name>GUI</name>
<email>39894654+GuEe-GUI@users.noreply.github.com</email>
</author>
<published>2025-07-10T05:28:16Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=8a7ef41c3c95da1d1c13627709e0658d0b1e3180'/>
<id>urn:sha1:8a7ef41c3c95da1d1c13627709e0658d0b1e3180</id>
<content type='text'>
* Make a priv data read API for probed SPI device
* Fixup the SPI device pre-alloc</content>
</entry>
<entry>
<title>[DM/SPI] Make CS pin config fixed in system (#9977)</title>
<updated>2025-02-11T06:54:59Z</updated>
<author>
<name>GUI</name>
<email>39894654+GuEe-GUI@users.noreply.github.com</email>
</author>
<published>2025-02-11T06:54:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=1564735b5ccba8ca09cae340333b2bfb032205d3'/>
<id>urn:sha1:1564735b5ccba8ca09cae340333b2bfb032205d3</id>
<content type='text'>
Make a max CS pin value (16) for SPI, that will not
alloc `*cs_pins` by malloc, because drivers call
`rt_device_unregister` may not free item.

Fixup the QSPI init configure member in DM mode.

Make SoC Kconfig import easy.

Signed-off-by: GuEe-GUI &lt;2991707448@qq.com&gt;</content>
</entry>
<entry>
<title>[DM/SPI] Support DM mode in SPI</title>
<updated>2024-11-27T10:04:07Z</updated>
<author>
<name>GuEe-GUI</name>
<email>2991707448@qq.com</email>
</author>
<published>2024-11-27T03:08:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=6f68ca7c7133a2a06b5be8663ec644b9181a2c9d'/>
<id>urn:sha1:6f68ca7c7133a2a06b5be8663ec644b9181a2c9d</id>
<content type='text'>
Signed-off-by: GuEe-GUI &lt;2991707448@qq.com&gt;
</content>
</entry>
</feed>
