mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 21:03:31 -04:00
i2c: virtio: mark device ready before registering the adapter
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 commitf5866db64f("virtio_console: enable VQs early") and commit71e4b8bf04("virtio_rpmsg: set DRIVER_OK before using device"). Signed-off-by: Alexis Bouzigues <BouziguesAlexis@JohnDeere.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
This commit is contained in:
committed by
Wolfram Sang
parent
e2aecff95b
commit
1d774589f9
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user