Skip to contentSkip to conversation

FAILED: patch "[PATCH] virtio-rng: make device ready before making request" failed to apply to 4.19-stable tree

PATCH [email protected] 1 participant 1 message Jun 13, 2022

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 228432551bd8783211e494ab35f42a4344580502 Mon Sep 17 00:00:00 2001
From: Jason Wang <[email protected]>
Date: Wed, 8 Jun 2022 14:14:22 +0800
Subject: [PATCH] virtio-rng: make device ready before making request

Current virtio-rng does a entropy request before DRIVER_OK, this violates the spec:

virtio spec requires that all drivers set DRIVER_OK before using devices.

Further, kernel will ignore the interrupt after commit 8b4ec69d7e09 ("virtio: harden vring IRQ").

Fixing this by making device ready before the request.

Fixes 8b4ec69d7e09 ("virtio: harden vring IRQ")
Fixes f7f510ec1957 ("virtio: An entropy device, as suggested by hpa.")
Reported-and-tested-by [email protected]

Message-Id: <[email protected]>

drivers/char/hw_random/virtio-rng.c +2 -0
index e856df7e285c..a6f3a8a2aca6 100644
@@ -159,6 +159,8 @@ static int probe_common(struct virtio_device *vdev)
 		goto err_find;
 	}
 
+	virtio_device_ready(vdev);
+
 	/* we always have a pending entropy request */
 	request_entropy(vi);