From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: Xen randomly stuck in mdelay() during MP initialization Date: Wed, 11 Jan 2012 15:27:10 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Julian Pidancet Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 11/01/2012 14:51, "Julian Pidancet" wrote: > On Wed, Jan 11, 2012 at 1:28 PM, Keir Fraser wrote: >> On 11/01/2012 13:06, "Julian Pidancet" wrote: >> = >>> Hi, >>> = >>> When trying to boot xen 4.1 on new hardware, Xen become stuck in >>> wakeup_secondary_cpu() in the mdelay function. >>> = >>> =A0 =A0 Dprintk("Waiting for send to finish...\n"); >>> =A0 =A0 timeout =3D 0; >>> =A0 =A0 do { >>> =A0 =A0 =A0 =A0 Dprintk("+"); >>> =A0 =A0 =A0 =A0 udelay(100); >>> =A0 =A0 =A0 =A0 if ( !x2apic_enabled ) >>> =A0 =A0 =A0 =A0 =A0 =A0 send_status =3D apic_read(APIC_ICR) & APIC_ICR_= BUSY; >>> =A0 =A0 } while ( send_status && (timeout++ < 1000) ); >>> = >>> =A0 =A0 printk("before mdelay\n"); >>> =A0 =A0 mdelay(10); >>> =A0 =A0 printk("after mdelay\n"); >>> = >>> =A0 =A0 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 c= an >> 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