event_notifier: Set ->initialized earlier in event_notifier_init()
PATCH 1/1 event_notifier: Set ->initialized earlier in event_notifier_init()
Otherwise the call to event_notifier_set() is a nop, which causes the SLOF firmware on POWER to hang when booting from a virtio-scsi device:
virtio_scsi_dataplane_start()
virtio_scsi_vring_init()
virtio_bus_set_host_notifier() <- assign == true
event_notifier_init() <- active == 1
event_notifier_set() <- fails right away if !e->initialized
--- util/event_notifier-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
util/event_notifier-posix.c +1 -1
@@ -66,10 +66,10 @@ int event_notifier_init(EventNotifier *e, int active) e->rfd = fds[0 ]; e->wfd = fds[1 ]; } + e->initialized = true;if (active) {event_notifier_set (e); } - e->initialized = true;return 0 ; fail:
Signature · 1 line
2.26.2
Paolo Bonzini
AppliedQuoted 24 lines · Greg Kurz
Otherwise the call to
event_notifier_set()is a nop, which causes the SLOF firmware on POWER to hang when booting from a virtio-scsi device:
virtio_scsi_dataplane_start()
virtio_scsi_vring_init()
virtio_bus_set_host_notifier()<- assign == trueevent_notifier_init() <- active == 1 event_notifier_set() <- fails right away if !e->initializedFixes e34e47eb28c0 ("event_notifier: handle initialization failure better")Signed-off-by Greg Kurz <[email protected]>--- util/event_notifier-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)util/event_notifier-posix.c +0
-0@@ -66,10 +66,10 @@ int event_notifier_init(EventNotifier *e, int active) e->rfd = fds[0 ];
util/event_notifier-posix.c int event_notifier_init(EventNotifier *e, int active) · line 75
Quoted 10 lines
util/event_notifier-posix.c +1
-1e->wfd = fds[1 ]; } + e->initialized = true;if (active) {event_notifier_set (e); } - e->initialized = true;return 0 ; fail:
Queued, thanks.
Paolo
Quoted 23 lines · Greg Kurz
Otherwise the call to
event_notifier_set()is a nop, which causes the SLOF firmware on POWER to hang when booting from a virtio-scsi device:
virtio_scsi_dataplane_start()
virtio_scsi_vring_init()
virtio_bus_set_host_notifier()<- assign == true
event_notifier_init()<- active == 1event_notifier_set() <- fails right away if !e->initializedFixes e34e47eb28c0 ("event_notifier: handle initialization failure better")Signed-off-by Greg Kurz <[email protected]>--- util/event_notifier-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)util/event_notifier-posix.c +0
-0@@ -66,10 +66,10 @@ int event_notifier_init(EventNotifier *e, int active) e->rfd = fds[0 ];
util/event_notifier-posix.c int event_notifier_init(EventNotifier *e, int active) · line 75
Quoted 10 lines
util/event_notifier-posix.c +1
-1e->wfd = fds[1 ]; } + e->initialized = true;if (active) {event_notifier_set (e); } - e->initialized = true;return 0 ; fail:
Sorry about that!
Best regards,
Maxim levitsky