netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Grant Grundler <grundler@parisc-linux.org>
Cc: Francois Romieu <romieu@fr.zoreil.com>,
	Valerie Henson <val_henson@linux.intel.com>,
	Andrew Morton <akpm@osdl.org>,
	netdev@vger.kernel.org
Subject: Re: PATCHv3 2.6.17-rc5 tulip free_irq() called too late
Date: Fri, 16 Jun 2006 12:16:25 -0400	[thread overview]
Message-ID: <4492D959.6010803@pobox.com> (raw)
In-Reply-To: <20060616160623.GF7868@colo.lackof.org>

Grant Grundler wrote:
> [ Jeff, apologies. I hit "reply" instead of "group reply" on previous email.
>   I've added everyone back on the cc list.]
> 
> On Fri, Jun 16, 2006 at 11:30:32AM -0400, Jeff Garzik wrote:
> ...
>>> Are you saying this sequence won't mask interrupts on tulip?
>>>
>>>        /* Disable interrupts by clearing the interrupt mask. */
>>>        iowrite32 (0x00000000, ioaddr + CSR7);
>>>        ioread32 (ioaddr + CSR7);       /* flush posted write */
>> It does not stop the generation of interrupt events.
> 
> This use of "interrupt events" is misleading.
> The CPU does not sees these "interrupt events" once we mask interrupts.
> 
>> The DMA engine is still running, packets are still being received.
>> The above code sequence does not change that.
> 
> I agree. And I'm asking why does anyone care?
> We clean that up after IRQs are stopped from being delivered to the CPU.
> 
> ...
>>> Secondly, since you have ignored the two previous times I've asked,
>>> I'll presume you agree that if firmware leaves it in this state
>>> (pending, masked interrupts), that the driver has to (and does)
>>> handle it.
>> There is no firmware involved here, at any level, after boot.
> 
> I agree.  What about at boot time?

We reset the chip each time we do an interface-up.


>> The needed task in the driver has been the same since this thread 
>> started:  (1) stop generating new work [stop DMA engine], and (2) 
>> quiesce the hardware.  And it must happen in that order.
> 
> No it doesn't. I've proven it works in the order I've proposed
> on pretty damn anal HW.
> 
>> Setting the interrupt mask register to zero doesn't stop new work from 
>> appearing.
> 
> I agree. It stops the "screaming interrupt" problem. The fact that we
> are in "close" or "down" routine means the user already decided
> they don't care if new packets do or do not arrive.
> 
> Unless you can point to a real user who is affected by
> my proposed patch, I ask again patch v3 be accepted.

All users are affected.  There is still a race window due to calling 
free_irq() before stopping the DMA engine, you've simply minimized it.

I don't see why it's so difficult to see

(a) you are introducing a non-standard ordering, different from other 
net drivers
(b) you are introducing an ordering that is counter to how the hardware 
is designed
(c) if you follow the natural ordering, you are GUARANTEED not to have 
screaming interrupts, DMA still going across the PCI bus, and dozens of 
other details.

Rather than running through all of these details, and tweaking your 
patch for each of them (as you have done with V1->V2 and V2->V3), simply 
_guarantee_ that you will not have problems.

	Jeff



  reply	other threads:[~2006-06-16 16:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-31 19:52 PATCH 2.6.17-rc5 tulip free_irq() called too late Grant Grundler
2006-06-08 14:43 ` Jeff Garzik
2006-06-08 15:22   ` Grant Grundler
2006-06-08 15:32     ` Grant Grundler
2006-06-08 15:38       ` Jeff Garzik
2006-06-08 15:47         ` Grant Grundler
2006-06-08 15:32     ` Jeff Garzik
2006-06-08 15:36       ` Grant Grundler
2006-06-08 17:01   ` Grant Grundler
2006-06-13 23:55     ` PATCHv3 " Grant Grundler
2006-06-14  0:06       ` Valerie Henson
2006-06-14  0:33       ` Jeff Garzik
2006-06-14  4:44         ` Grant Grundler
2006-06-14 13:05           ` Kyle McMartin
2006-06-14 14:54             ` Grant Grundler
2006-06-14 15:03           ` Jeff Garzik
2006-06-14 18:14             ` Grant Grundler
2006-06-14 19:51               ` Jeff Garzik
2006-06-14 22:25                 ` Grant Grundler
2006-06-14 20:47               ` Francois Romieu
2006-06-14 22:30                 ` Grant Grundler
2006-06-15 20:30                   ` Francois Romieu
2006-06-16  5:47                     ` Grant Grundler
2006-06-16  7:32                       ` Jeff Garzik
2006-06-16 15:25                         ` Grant Grundler
     [not found]                         ` <20060616152400.GA7868@colo.lackof.org>
     [not found]                           ` <4492CE98.50900@pobox.com>
2006-06-16 16:06                             ` Grant Grundler
2006-06-16 16:16                               ` Jeff Garzik [this message]
2006-06-22  0:43       ` Valerie Henson
2006-06-23  5:00         ` Grant Grundler
2006-06-26 22:31           ` [PATCH] Fix tulip shutdown DMA/irq race Valerie Henson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4492D959.6010803@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=akpm@osdl.org \
    --cc=grundler@parisc-linux.org \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    --cc=val_henson@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).