Re: [PATCH v6 1/2] spi: add new_device/delete_device sysfs interface
Mark Brown <[email protected]> Mon, 27 Jul 2026 15:53:02 +0100
| Newsgroups | org.kernel.vger.linux-tegra,org.kernel.vger.linux-kernel,org.kernel.vger.linux-spi |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jul 14, 2026 at 10:09:43AM +0000, Vishwaroop A wrote:
> Development boards such as the Jetson AGX Orin expose SPI buses
> on expansion headers (e.g. the 40-pin header) so that users can
> connect and interact with SPI peripherals from userspace. The
> standard way to get /dev/spidevB.C character device nodes for
> this purpose is to register spi_device instances backed by the
> spidev driver.
> +new_device_store(struct device *dev, struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + if (blank - buf > SPI_NAME_SIZE - 1) {
> + dev_err(dev, "%s: Invalid device name\n", "new_device");
> + return -EINVAL;
> + }
What about empty names (" 0")?
> static const struct attribute_group *spi_controller_groups[] = {
> &spi_controller_statistics_group,
> + &spi_controller_userspace_group,
> NULL,
> };
It looks like there's an issue with cleanup here when a controller is
probing, the userspace interface will appear when the device is
registered but that's part way through setting up the controller, before
we've finished sitting up the devices from the firmware and the queue.
We probably need to manually register this as the last step of
controller bringup, we can't defer the device for long enough as we need
it to create the children.
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpncM4ACgkQJNaLcl1U h9D6Pwf/ZkClNxLCcwlgiNQoFGrg064F47SAKpk3yJClF76e43XokmuXdO4zjhxc gJWhiqdb64IQ5mST4VtA8yIMXmiM2U+JpzTOzPrjW6jGcjTVtw0TLxTDTWI1PUbw PK5bBQVEMuGQ1M5/V+pv4ZmTk6ymPNpiHMSrGQdFXhDb17glkINyMGM/TqalUw77 k0iLcf8cn1MOsx6z5uyLfB4+14f4ub/R5hmV313YlTy1lobTzky01bow5X5f2JF8 QHdlOdHHESpj4IX5pLNtm4+Rpb1von5VPCJ58uzdWkbcr/uFNvPhPix+Xn80NKye lk9zd9TquR4PhoDwFNwYWwZmNlYqwA== =3S/D -----END PGP SIGNATURE-----