From patchwork Wed Jul 7 17:54:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 58136 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2B90BB6F04 for ; Thu, 8 Jul 2010 03:54:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756002Ab0GGRyO (ORCPT ); Wed, 7 Jul 2010 13:54:14 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:36655 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754460Ab0GGRyN (ORCPT ); Wed, 7 Jul 2010 13:54:13 -0400 Received: by wwb24 with SMTP id 24so3087941wwb.1 for ; Wed, 07 Jul 2010 10:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=f4cSIUOwzAheZQwnrc6ycNQp8rTuO80gDTiLwm+cqws=; b=GNVphZEhDUCVTZFnzAgTeIuZEvW8ZZxtKwKB2dvESKqqnJWQoCHWSreAJRtPj+MZlI FJman8K+SyluKLgRioUO0DAWxd3IR3aZOdTDwx2fdqI6O5q22h6QF2lWvp63+LyjCHS1 AFfoFYIwq++qSuQ4jCkiUeKco4viDTANZNcf4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=u/W4hXZd9wAOXUc1NFHWD9d6tovOJeDFM39MqIVkkQIMRo9TIQ8iCyYe+qhpFjXT1i h7JQzO0gpRCIh6u6nSpVhD9Ifg59Zp+rcnWZUe+pHXeyvYRvnwOElHunWLZPgoYrPL/e R4A+8yd6gU/s4uI62d4RGHIxbED+7USryx/oo= Received: by 10.213.27.68 with SMTP id h4mr5775948ebc.4.1278525250053; Wed, 07 Jul 2010 10:54:10 -0700 (PDT) Received: from localhost (mail.dev.rtsoft.ru [213.79.90.226]) by mx.google.com with ESMTPS id v59sm63179745eeh.4.2010.07.07.10.54.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Jul 2010 10:54:09 -0700 (PDT) Date: Wed, 7 Jul 2010 21:54:06 +0400 From: Anton Vorontsov To: kgdb-bugreport@lists.sourceforge.net Cc: Russell King , "David S. Miller" , Jason Wessel , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RFC 0/4] ARM/KGDB: Some fixes for SMP machines Message-ID: <20100707175406.GA28424@oksana.dev.rtsoft.ru> References: <20100707171222.GA16448@oksana.dev.rtsoft.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100707171222.GA16448@oksana.dev.rtsoft.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jul 07, 2010 at 09:12:22PM +0400, Anton Vorontsov wrote: [...] > 2. The patches are against a heavily patched kernel, and so far > I didn't rebase them onto the 'debug core' rework as found > in the very latest mainline kernels. I'll rebase the patches > soon, so for now this is just an RFC. BTW, I'm testing with another small fixup applied, I didn't send it as a patch because this deadlock was already fixed in the debug_core implementation (which KGDB is using nowadays). But for the completeness, here it is: (Don't deadlock if there's a wannabe-master CPUs, which entered KGDB via exception, not NMI/IPI). --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/kgdb.c b/kernel/kgdb.c index e7a2274..65bf75d 100644 --- a/kernel/kgdb.c +++ b/kernel/kgdb.c @@ -1522,7 +1522,9 @@ return_normal: * from the debugger. */ for_each_online_cpu(i) { - while (atomic_read(&cpu_in_kgdb[i])) + while (atomic_read(&cpu_in_kgdb[i]) && + !(kgdb_info[i].exception_state & + DCPU_WANT_MASTER)) cpu_relax(); } }