diff options
| author | Jasper Wise <jaspwise@amazon.co.uk> | 2026-08-13 08:46:18 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-08-13 17:34:01 +0100 |
| commit | 11058bd3d47d57eb3473935feae53868d6d168b7 (patch) | |
| tree | f395541a8607eb8a97660e32206ca4b7be498539 /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | 133c71b2c0bc976a4751f9e05ef7cdea67f964e5 (diff) | |
spi: virtio: mark device ready before registering the controller
virtio_spi_probe() registers the SPI controller with
devm_spi_register_controller(). spi_register_controller() binds a child
inline unless its driver has asked for asynchronous probing, so a
peripheral that performs a transfer during its own probe reaches
virtio_spi_transfer_one(), which kicks the virtqueue before probe has
returned.
The driver never calls virtio_device_ready(), so DRIVER_OK is set on its
behalf by virtio_dev_probe(), only once probe has returned. The virtio
spec is explicit about that ordering in 3.1 Device Initialization:
| The driver MUST NOT send any buffer available notifications to the
| device before setting DRIVER_OK.
A device that waits for DRIVER_OK before servicing the queue therefore
leaves the transfer unanswered, and virtio_spi_transfer_one() waits for its
completion with no timeout, so probe never returns.
Mark the device ready before registering the controller, as done for the
same reason in commit f5866db64f34 ("virtio_console: enable VQs early") and
commit 1d774589f924 ("i2c: virtio: mark device ready before registering the
adapter").
Fixes: f98cabe3f6cf ("SPI: Add virtio SPI driver")
Signed-off-by: Jasper Wise <jaspwise@amazon.co.uk>
Link: https://patch.msgid.link/20260813084618.613172-1-jaspwise@amazon.co.uk
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions
