Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177240807
D61228.1793987464.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61228.1793987464.diff
View Options
diff --git a/sys/dev/virtio/random/virtio_random.c b/sys/dev/virtio/random/virtio_random.c
--- a/sys/dev/virtio/random/virtio_random.c
+++ b/sys/dev/virtio/random/virtio_random.c
@@ -47,6 +47,8 @@
#include <dev/virtio/virtio.h>
#include <dev/virtio/virtqueue.h>
+#include "virtio_if.h"
+
struct vtrnd_softc {
device_t vtrnd_dev;
uint64_t vtrnd_features;
@@ -69,6 +71,7 @@
static int vtrnd_alloc_virtqueue(struct vtrnd_softc *);
static int vtrnd_harvest(struct vtrnd_softc *, void *, size_t *);
static void vtrnd_enqueue(struct vtrnd_softc *sc);
+static int vtrnd_attach_completed(device_t);
static unsigned vtrnd_read(void *, unsigned);
#define VTRND_FEATURES 0
@@ -93,6 +96,9 @@
DEVMETHOD(device_detach, vtrnd_detach),
DEVMETHOD(device_shutdown, vtrnd_shutdown),
+ /* Virtio methods. */
+ DEVMETHOD(virtio_attach_completed, vtrnd_attach_completed),
+
DEVMETHOD_END
};
@@ -181,8 +187,6 @@
sc->inactive = false;
random_source_register(&random_vtrnd);
- vtrnd_enqueue(sc);
-
fail:
if (error != 0) {
/* Parent will free the virtqueue. */
@@ -340,3 +344,13 @@
return (sz);
}
+
+static int
+vtrnd_attach_completed(device_t dev)
+{
+ struct vtrnd_softc *sc;
+
+ sc = device_get_softc(dev);
+ vtrnd_enqueue(sc);
+ return (0);
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 6, 5:51 PM (10 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41526976
Default Alt Text
D61228.1793987464.diff (1 KB)
Attached To
Mode
D61228: virtio_random: defer first enqueue until after DRIVER_OK
Attached
Detach File
Event Timeline