All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] event_notifier: Set ->initialized earlier in event_notifier_init()
@ 2021-02-16 12:02 Greg Kurz
  2021-02-16 16:12 ` Paolo Bonzini
  2021-02-17 14:59 ` Maxim Levitsky
  0 siblings, 2 replies; 3+ messages in thread
From: Greg Kurz @ 2021-02-16 12:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Greg Kurz, mlevitsk

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

Fixes: e34e47eb28c0 ("event_notifier: handle initialization failure better")
Cc: mlevitsk@redhat.com
Signed-off-by: Greg Kurz <groug@kaod.org>
---
 util/event_notifier-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index 5b2110e86198..8307013c5df0 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -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:
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] event_notifier: Set ->initialized earlier in event_notifier_init()
  2021-02-16 12:02 [PATCH] event_notifier: Set ->initialized earlier in event_notifier_init() Greg Kurz
@ 2021-02-16 16:12 ` Paolo Bonzini
  2021-02-17 14:59 ` Maxim Levitsky
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-02-16 16:12 UTC (permalink / raw)
  To: Greg Kurz, qemu-devel; +Cc: mlevitsk

On 16/02/21 13:02, Greg Kurz wrote:
> 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
> 
> Fixes: e34e47eb28c0 ("event_notifier: handle initialization failure better")
> Cc: mlevitsk@redhat.com
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>   util/event_notifier-posix.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
> index 5b2110e86198..8307013c5df0 100644
> --- a/util/event_notifier-posix.c
> +++ b/util/event_notifier-posix.c
> @@ -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:
> 

Queued, thanks.

Paolo



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] event_notifier: Set ->initialized earlier in event_notifier_init()
  2021-02-16 12:02 [PATCH] event_notifier: Set ->initialized earlier in event_notifier_init() Greg Kurz
  2021-02-16 16:12 ` Paolo Bonzini
@ 2021-02-17 14:59 ` Maxim Levitsky
  1 sibling, 0 replies; 3+ messages in thread
From: Maxim Levitsky @ 2021-02-17 14:59 UTC (permalink / raw)
  To: Greg Kurz, qemu-devel; +Cc: Paolo Bonzini

On Tue, 2021-02-16 at 13:02 +0100, Greg Kurz wrote:
> 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
> 
> Fixes: e34e47eb28c0 ("event_notifier: handle initialization failure better")
> Cc: mlevitsk@redhat.com
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>  util/event_notifier-posix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
> index 5b2110e86198..8307013c5df0 100644
> --- a/util/event_notifier-posix.c
> +++ b/util/event_notifier-posix.c
> @@ -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:
Sorry about that!

Best regards,
	Maxim levitsky



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-17 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 12:02 [PATCH] event_notifier: Set ->initialized earlier in event_notifier_init() Greg Kurz
2021-02-16 16:12 ` Paolo Bonzini
2021-02-17 14:59 ` Maxim Levitsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.