xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xen.org>
To: Julian Pidancet <julian.pidancet@gmail.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Xen randomly stuck in mdelay() during MP initialization
Date: Wed, 11 Jan 2012 15:27:10 +0000	[thread overview]
Message-ID: <CB335ACE.371D2%keir@xen.org> (raw)
In-Reply-To: <CAKZ=5EVXak0SBJAY1gft4qxYFsBavrLYjxJV4tViUST_9uNUMw@mail.gmail.com>

On 11/01/2012 14:51, "Julian Pidancet" <julian.pidancet@gmail.com> wrote:

> On Wed, Jan 11, 2012 at 1:28 PM, Keir Fraser <keir.xen@gmail.com> wrote:
>> On 11/01/2012 13:06, "Julian Pidancet" <julian.pidancet@gmail.com> wrote:
>> 
>>> Hi,
>>> 
>>> When trying to boot xen 4.1 on new hardware, Xen become stuck in
>>> wakeup_secondary_cpu() in the mdelay function.
>>> 
>>>     Dprintk("Waiting for send to finish...\n");
>>>     timeout = 0;
>>>     do {
>>>         Dprintk("+");
>>>         udelay(100);
>>>         if ( !x2apic_enabled )
>>>             send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
>>>     } while ( send_status && (timeout++ < 1000) );
>>> 
>>>     printk("before mdelay\n");
>>>     mdelay(10);
>>>     printk("after mdelay\n");
>>> 
>>>     Dprintk("Deasserting INIT.\n");
>>> 
>>> The hang can happen randomly with any of the CPUs to wake up and
>>> sometime doesn't happen at all.
>>> Replacing mdelay(10) with udelay(10) seems to fix the issue.
>> 
>> Do you see this in xen-unstable? Hopefully it is working there, and we can
>> simply backport the fix.
>> 
> 
> I checked yesterday and the code of this function is the same in
> xen-unstable, but I don't encounter the problem with xen-unstable.

Well that would be because the code of this function is not the same in
xen-4.1 and xen-unstable.

> What concerns me is that this is the only place in the function where
> mdelay() is used, the rest of the function seems to be using udelay().
> What's the difference between the two ?
> Does mdelay() relies on some form of timer to execute ?

mdelay(ms) just calls udelay(1000) ms times.

 -- Keir

  parent reply	other threads:[~2012-01-11 15:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11 13:06 Xen randomly stuck in mdelay() during MP initialization Julian Pidancet
2012-01-11 13:27 ` Pasi Kärkkäinen
2012-01-11 13:28 ` Keir Fraser
2012-01-11 14:51   ` Julian Pidancet
2012-01-11 15:12     ` Jan Beulich
2012-01-11 15:28       ` Julian Pidancet
2012-01-11 15:35         ` Jan Beulich
2012-01-11 15:27     ` Keir Fraser [this message]
2012-01-11 14:53 ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CB335ACE.371D2%keir@xen.org \
    --to=keir@xen.org \
    --cc=julian.pidancet@gmail.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).