WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 6/6] xen kexec: reset device state to Initializin

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 6/6] xen kexec: reset device state to Initializing during reboot
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Tue, 26 Jul 2011 10:27:35 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 26 Jul 2011 07:28:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110726115211.489145690@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110726115209.655568638@xxxxxxxxx> <20110726115211.489145690@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Jul 26, 2011 at 01:52:15PM +0200, Olaf Hering wrote:
> During kexec all devices will be shutdown, the backend drivers enter the
                                ^^ - get rid of that.

> Closed state. But in this state the kexec kernel can not connect to the
> backend because it expects the devices in InitWait state.
                                        ^- add "to be"
> After triggering the Closing event, trigger also the Initializing event
> and wait until the backend has changed its state. Without this waiting

> the kexec kernel may find a device where a state change is still in
> progress.

Uhh, say that again? Are you saying that after moving to Initializing state
we should allow the allow the state changes to proceed as they would do under
normal circumstances?

> 
> Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
> ---
>  drivers/xen/xenbus/xenbus_probe.c |   23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)
> 
> Index: linux-3.0/drivers/xen/xenbus/xenbus_probe.c
> ===================================================================
> --- linux-3.0.orig/drivers/xen/xenbus/xenbus_probe.c
> +++ linux-3.0/drivers/xen/xenbus/xenbus_probe.c
> @@ -192,8 +192,19 @@ void xenbus_otherend_changed(struct xenb
>        * work that can fail e.g., when the rootfs is gone.
>        */
>       if (system_state > SYSTEM_RUNNING) {
> -             if (ignore_on_shutdown && (state == XenbusStateClosing))
> -                     xenbus_frontend_closed(dev);
> +             if (ignore_on_shutdown) {
> +                     switch (state) {
> +                     case XenbusStateClosing:
> +                             xenbus_frontend_closed(dev);
> +                             break;
> +                     case XenbusStateInitialising:
> +                     case XenbusStateInitWait:
> +                             complete(&dev->down);
> +                             break;
> +                     default:
> +                             break;
> +                     }
> +             }
>               return;
>       }
>  
> @@ -284,6 +295,14 @@ void xenbus_dev_shutdown(struct device *
>       if (!timeout)
>               printk(KERN_INFO "%s: %s timeout closing device\n",
>                      __func__, dev->nodename);
> +
> +     if (system_state > SYSTEM_RUNNING) {
> +             xenbus_switch_state(dev, XenbusStateInitialising);
> +             timeout = wait_for_completion_timeout(&dev->down, timeout);
> +             if (!timeout)
> +                     printk(KERN_INFO "%s: %s timeout initializing device\n",
> +                            __func__, dev->nodename);
> +     }
>   out:
>       put_device(&dev->dev);
>  }
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>