From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] macb: Add support of the netpoll API Date: Fri, 17 Apr 2009 04:39:45 -0700 (PDT) Message-ID: <20090417.043945.67766586.davem@davemloft.net> References: <20090417.023357.121366056.davem@davemloft.net> <20090417115011.5c3d17e1@hskinnemoen-d830> <20090417.034416.110856368.davem@davemloft.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: thomas.petazzoni@free-electrons.com, netdev@vger.kernel.org, michael@free-electrons.com To: haavard.skinnemoen@atmel.com Return-path: Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:60355 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756537AbZDQLjx (ORCPT ); Fri, 17 Apr 2009 07:39:53 -0400 In-Reply-To: <20090417.034416.110856368.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: From: David Miller Date: Fri, 17 Apr 2009 03:44:16 -0700 (PDT) > From: Haavard Skinnemoen > Date: Fri, 17 Apr 2009 11:50:11 +0200 > >> David Miller wrote: >>> From: Haavard Skinnemoen >>> Date: Fri, 17 Apr 2009 11:25:53 +0200 >>> >>> > I guess you're right -- we just have to be careful about calling >>> > printk() from within the driver. But it seems a lot easier to just drop >>> > the lock before dumping an error message than it is to work around that >>> > disable_irq() deadlock. And if you're running with verbose debugging >>> > enabled, you probably shouldn't be using netconsole anyway. >>> >>> Therefore, do you agree to add Thomas's patch as-is? >> >> No, therefore, I'd prefer local_irq_save() :-) > > I'm pretty sure there is a specific reason driver's use > disable_irq() rather than disabling local cpu IRQs. > > I just can't remember it at the moment. > > And there absolutely must be a reason, because disable_irq() > is a lot more expensive. Ok, after doing some research, the reason seems to be that drivers which have lockless IRQ handlers have to do things this way to guarentee other cpus are not inside of the interrupt handler. Since we are using a lock here, local_irq_save(), or disabling IRQs in the ethernet chip itself, should work fine. So I'm OK with the local_irq_save() idea, someone please post the patch.