Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966238AbXJSM57 (ORCPT ); Fri, 19 Oct 2007 08:57:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759351AbXJSM5n (ORCPT ); Fri, 19 Oct 2007 08:57:43 -0400 Received: from cerber.ds.pg.gda.pl ([153.19.208.18]:44609 "EHLO cerber.ds.pg.gda.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758976AbXJSM5m (ORCPT ); Fri, 19 Oct 2007 08:57:42 -0400 Date: Fri, 19 Oct 2007 13:57:33 +0100 (BST) From: "Maciej W. Rozycki" To: Jarek Poplawski cc: Andy Fleming , Andrew Morton , Jeff Garzik , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes In-Reply-To: <20071019081706.GA2598@ff.dom.local> Message-ID: References: <20071015125301.GC3015@ff.dom.local> <20071016062108.GB1000@ff.dom.local> <20071017085809.GA1658@ff.dom.local> <20071019081706.GA2598@ff.dom.local> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1014 Lines: 31 On Fri, 19 Oct 2007, Jarek Poplawski wrote: > But then... your patch seems to make it possible, because it enables > irq to the initial state of the counter. Of course, this could happen > on closing only. That's because free_irq() does not disable the interrupt in the correct manner. The scenario is more or less like this: phy_interrupt() [depth == 0] disable_irq() depth++; status |= IRQ_DISABLED; ... free_irq() [depth == 1] status |= IRQ_DISABLED; ... phy_change() [depth == 1] enable_irq() depth--; status &= ~IRQ_DISABLED; oops! Now if free_irq() correctly incremented the depth counter, then the last enable_irq() would still decrement it, but with its initial value of 2 it would not change the status to reenable the line. Maciej - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/