* [PATCH] i2c: virtio: mark device ready before registering the adapter
@ 2026-05-29 14:28 Alexis Bouzigues via B4 Relay
2026-05-30 13:56 ` Wolfram Sang
0 siblings, 1 reply; 2+ messages in thread
From: Alexis Bouzigues via B4 Relay @ 2026-05-29 14:28 UTC (permalink / raw)
To: Viresh Kumar, Andi Shyti
Cc: linux-i2c, virtualization, linux-kernel, Alexis Bouzigues
From: Alexis Bouzigues <BouziguesAlexis@JohnDeere.com>
virtio_i2c_probe() synchronously probes child i2c drivers on the bus,
but peripherals may use the bus at probe for tasks like reading a chip
id. The vhost-user-i2c backend stalls at such probes unless DRIVER_OK
is already set before the virtqueue is first kicked.
Set DRIVER_OK explicitly before i2c_add_adapter(), as done for the
same reason in commit f5866db64f34 ("virtio_console: enable VQs
early") and commit 71e4b8bf0482 ("virtio_rpmsg: set DRIVER_OK before
using device").
Signed-off-by: Alexis Bouzigues <BouziguesAlexis@JohnDeere.com>
---
drivers/i2c/busses/i2c-virtio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c
index 7b0b0bff8000..5da6fef92bec 100644
--- a/drivers/i2c/busses/i2c-virtio.c
+++ b/drivers/i2c/busses/i2c-virtio.c
@@ -222,6 +222,8 @@ static int virtio_i2c_probe(struct virtio_device *vdev)
*/
ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(vdev->dev.parent));
+ virtio_device_ready(vdev);
+
ret = i2c_add_adapter(&vi->adap);
if (ret)
virtio_i2c_del_vqs(vdev);
---
base-commit: 7fd2df204f342fc17d1a0bfcd474b24232fb0f32
change-id: 20260529-virtio-i2c-driver-ok-96444c2e5398
Best regards,
--
Alexis Bouzigues <BouziguesAlexis@JohnDeere.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c: virtio: mark device ready before registering the adapter
2026-05-29 14:28 [PATCH] i2c: virtio: mark device ready before registering the adapter Alexis Bouzigues via B4 Relay
@ 2026-05-30 13:56 ` Wolfram Sang
0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2026-05-30 13:56 UTC (permalink / raw)
To: BouziguesAlexis
Cc: Viresh Kumar, Andi Shyti, linux-i2c, virtualization, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 758 bytes --]
On Fri, May 29, 2026 at 09:28:14AM -0500, Alexis Bouzigues via B4 Relay wrote:
> From: Alexis Bouzigues <BouziguesAlexis@JohnDeere.com>
>
> virtio_i2c_probe() synchronously probes child i2c drivers on the bus,
> but peripherals may use the bus at probe for tasks like reading a chip
> id. The vhost-user-i2c backend stalls at such probes unless DRIVER_OK
> is already set before the virtqueue is first kicked.
>
> Set DRIVER_OK explicitly before i2c_add_adapter(), as done for the
> same reason in commit f5866db64f34 ("virtio_console: enable VQs
> early") and commit 71e4b8bf0482 ("virtio_rpmsg: set DRIVER_OK before
> using device").
>
> Signed-off-by: Alexis Bouzigues <BouziguesAlexis@JohnDeere.com>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-30 13:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 14:28 [PATCH] i2c: virtio: mark device ready before registering the adapter Alexis Bouzigues via B4 Relay
2026-05-30 13:56 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox