From: Mark Brown <broonie@kernel.org>
To: Vishwaroop A <va@nvidia.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
jonathanh@nvidia.com, thierry.reding@gmail.com,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH v6 1/2] spi: add new_device/delete_device sysfs interface
Date: Mon, 27 Jul 2026 15:53:02 +0100 [thread overview]
Message-ID: <3d714de1-c895-4700-906e-ff324cbfb048@sirena.org.uk> (raw)
In-Reply-To: <20260714100947.1871359-1-va@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-07-27 14:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260517201602.498135-1-va@nvidia.com>
2026-07-14 10:09 ` [PATCH v6 0/2] " Vishwaroop A
2026-07-14 10:09 ` [PATCH v6 1/2] " Vishwaroop A
2026-07-27 14:53 ` Mark Brown [this message]
2026-07-14 10:09 ` [PATCH v6 2/2] docs: spi: add documentation for userspace device instantiation Vishwaroop A
2026-07-14 11:53 ` [PATCH v6 0/2] spi: add new_device/delete_device sysfs interface Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d714de1-c895-4700-906e-ff324cbfb048@sirena.org.uk \
--to=broonie@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=va@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®