diff mbox series

[2/2] gpio_pwr: use shutdown function for reboot

Message ID 20210625111842.3790-3-maxim.uvarov@linaro.org
State New
Headers show
Series arm/virt: fix machine poweroff | expand

Commit Message

Maxim Uvarov June 25, 2021, 11:18 a.m. UTC
qemu has 2 type of functions: shutdown and reboot. Shutdown
function has to be used for machine shutdown.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 hw/gpio/gpio_pwr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell June 25, 2021, 11:56 a.m. UTC | #1
On Fri, 25 Jun 2021 at 12:18, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
> qemu has 2 type of functions: shutdown and reboot. Shutdown
> function has to be used for machine shutdown.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  hw/gpio/gpio_pwr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/gpio/gpio_pwr.c b/hw/gpio/gpio_pwr.c
> index 7714fa0dc4..dbaf1c70c8 100644
> --- a/hw/gpio/gpio_pwr.c
> +++ b/hw/gpio/gpio_pwr.c
> @@ -43,7 +43,7 @@ static void gpio_pwr_reset(void *opaque, int n, int level)
>  static void gpio_pwr_shutdown(void *opaque, int n, int level)
>  {
>      if (level) {
> -        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
> +        qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
>      }
>  }

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Peter Maydell June 29, 2021, 3:29 p.m. UTC | #2
On Fri, 25 Jun 2021 at 12:56, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Fri, 25 Jun 2021 at 12:18, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> >
> > qemu has 2 type of functions: shutdown and reboot. Shutdown
> > function has to be used for machine shutdown.
> >
> > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> > ---
> >  hw/gpio/gpio_pwr.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/hw/gpio/gpio_pwr.c b/hw/gpio/gpio_pwr.c
> > index 7714fa0dc4..dbaf1c70c8 100644
> > --- a/hw/gpio/gpio_pwr.c
> > +++ b/hw/gpio/gpio_pwr.c
> > @@ -43,7 +43,7 @@ static void gpio_pwr_reset(void *opaque, int n, int level)
> >  static void gpio_pwr_shutdown(void *opaque, int n, int level)
> >  {
> >      if (level) {
> > -        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
> > +        qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
> >      }
> >  }
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

There are clearly more problems with this GPIO setup that we need
to get to the bottom of. But in the meantime this patch 2 is an
obvious bug fix, so I'm going to to apply it to target-arm.next.

thanks
-- PMM
diff mbox series

Patch

diff --git a/hw/gpio/gpio_pwr.c b/hw/gpio/gpio_pwr.c
index 7714fa0dc4..dbaf1c70c8 100644
--- a/hw/gpio/gpio_pwr.c
+++ b/hw/gpio/gpio_pwr.c
@@ -43,7 +43,7 @@  static void gpio_pwr_reset(void *opaque, int n, int level)
 static void gpio_pwr_shutdown(void *opaque, int n, int level)
 {
     if (level) {
-        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
+        qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
     }
 }