From patchwork Wed Oct 13 19:18:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 67725 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 1A77EB6F10 for ; Thu, 14 Oct 2010 06:19:21 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751044Ab0JMTTP (ORCPT ); Wed, 13 Oct 2010 15:19:15 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:36487 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750798Ab0JMTTO (ORCPT ); Wed, 13 Oct 2010 15:19:14 -0400 Received: by wwj40 with SMTP id 40so6928283wwj.1 for ; Wed, 13 Oct 2010 12:19:12 -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:mime-version:content-type:content-disposition:user-agent; bh=vQdDXky6MGYNzIEjBwp2cP7TDXkAY2FYbC80sKV747k=; b=KovO6EHN0+2VevoGS2+uhi6NsY+KCSB3gO0MOZcx1Us5y8eT1bf0jvSIEyafC4q/rO dUjipFWLjfo4V+FLYLWSBGGSfU+U/H6dDGYgZoyweYI54tEPk2uqT8nvPbtO/Mt/Vnio 2eRvxFoZwfY6IoQofEu+Lfo1pN/bDxSwVa0gI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=P2qf7TwGWq0EDr4WVN76/aI897XSnN11FdTASEoPh79WYf/FMCRIGYD7wTQ/TFNWUj L6byFlOfQ64pTBlm5TxQ2LQLFbnXFaaMDqnplikDa/GSn2wRnDD7ygK6OC0Gl6D7Qt8q MBdlh7NhEeCNfPTKZ8vrp6GNJhLoJpy34xnPk= Received: by 10.227.132.146 with SMTP id b18mr9110702wbt.148.1286997552089; Wed, 13 Oct 2010 12:19:12 -0700 (PDT) Received: from bicker (h3f06.n1.ips.mtn.co.ug [41.210.191.6]) by mx.google.com with ESMTPS id l14sm1255490weq.35.2010.10.13.12.19.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Oct 2010 12:19:09 -0700 (PDT) Date: Wed, 13 Oct 2010 21:18:53 +0200 From: Dan Carpenter To: netdev@vger.kernel.org Cc: "David S. Miller" , kernel-janitors@vger.kernel.org, mingo@elte.hu Subject: [patch] ns83820: spin_lock_irq() => spin_lock() Message-ID: <20101013191852.GD6060@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This is essentially cosmetic. At this point the IRQs are already disabled because we called spin_lock_irq(&dev->rx_info.lock). The real bug here was fixed back in 2006 in 3a10ccebe: "[PATCH] lock validator: fix ns83820.c irq-flags bug". Prior to that patch, it was a "spin_lock_irq is not nestable" type bug. The 2006 patch changes the unlock to not re-enable IRQs, which eliminates the potential deadlock. But this bit was missed. We should change the lock function as well so it balances nicely. Signed-off-by: Dan Carpenter --- 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/drivers/net/ns83820.c b/drivers/net/ns83820.c index 3bbd0aa..84134c7 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c @@ -772,7 +772,7 @@ static int ns83820_setup_rx(struct net_device *ndev) phy_intr(ndev); /* Okay, let it rip */ - spin_lock_irq(&dev->misc_lock); + spin_lock(&dev->misc_lock); dev->IMR_cache |= ISR_PHY; dev->IMR_cache |= ISR_RXRCMP; //dev->IMR_cache |= ISR_RXERR;