From: Jeff Garzik <jeff@garzik.org>
To: Kyle McMartin <kyle@parisc-linux.org>
Cc: netdev@vger.kernel.org, grundler@parisc-linux.org,
val_henson@linux.intel.com, akpm@osdl.org
Subject: Re: [PATCH 6/9] [TULIP] Fix IRQ/DMA race
Date: Wed, 09 Aug 2006 01:35:05 -0400 [thread overview]
Message-ID: <44D97409.1050002@garzik.org> (raw)
In-Reply-To: <11549840343640-git-send-email-kyle@parisc-linux.org>
Kyle McMartin wrote:
> From: Grant Grundler <grundler@parisc-linux.org>
>
> IRQs are racing with tulip_down().
> DMA can be restarted by tulip_interrupt() _after_ we call
> tulip_stop_rxtx() and the DMA buffers are unmapped. The result
> is an MCA (hard crash on ia64) because of an IO TLB miss.
>
> Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
> ---
> drivers/net/tulip/interrupt.c | 4 ++++
> drivers/net/tulip/tulip_core.c | 17 +++++++----------
> 2 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
> index 99ccf2e..19faa0e 100644
> --- a/drivers/net/tulip/interrupt.c
> +++ b/drivers/net/tulip/interrupt.c
> @@ -87,6 +87,10 @@ int tulip_refill_rx(struct net_device *d
> }
> tp->rx_ring[entry].status = cpu_to_le32(DescOwned);
> }
> +
> +/* FIXME: restarting DMA breaks tulip_down() code path.
> + tulip_down() will unmap the RX and TX descriptors.
> + */
> if(tp->chip_id == LC82C168) {
> if(((ioread32(tp->base_addr + CSR5)>>17)&0x07) == 4) {
> /* Rx stopped due to out of buffers,
> diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
> index 81905f4..363e5f6 100644
> --- a/drivers/net/tulip/tulip_core.c
> +++ b/drivers/net/tulip/tulip_core.c
> @@ -742,21 +742,20 @@ #endif
>
> /* Disable interrupts by clearing the interrupt mask. */
> iowrite32 (0x00000000, ioaddr + CSR7);
> + ioread32 (ioaddr + CSR7); /* flush posted write */
>
> - /* Stop the Tx and Rx processes. */
> - tulip_stop_rxtx(tp);
> + spin_unlock_irqrestore (&tp->lock, flags);
>
> - /* prepare receive buffers */
> - tulip_refill_rx(dev);
> + free_irq (dev->irq, dev); /* no more races after this */
> + tulip_stop_rxtx(tp); /* Stop DMA */
same old comment: need to stop DMA before releasing interrupt handler.
next prev parent reply other threads:[~2006-08-09 5:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-07 20:44 [PATCH 0/9] tulip patches from parisc-linux Kyle McMartin
2006-08-07 20:53 ` [PATCH 1/9] [TULIP] Fix PHY init and reset Kyle McMartin
2006-08-07 20:53 ` [PATCH 2/9] [TULIP] Print physical address in tulip_init_one Kyle McMartin
2006-08-07 20:53 ` [PATCH 3/9] [TULIP] Make tulip_stop_rxtx() failure case slightly more informative Kyle McMartin
2006-08-07 20:53 ` [PATCH 4/9] [TULIP] Clean tulip.h so it can be used by winbond-840.c Kyle McMartin
2006-08-07 20:53 ` [PATCH 5/9] [TULIP] Flush MMIO writes in reset sequence Kyle McMartin
2006-08-07 20:53 ` [PATCH 6/9] [TULIP] Fix IRQ/DMA race Kyle McMartin
2006-08-07 20:53 ` [PATCH 7/9] [TULIP] Defer tulip_select_media() to process context Kyle McMartin
2006-08-07 20:53 ` [PATCH 8/9] [TULIP] Make DS21143 printout match lspci output Kyle McMartin
2006-08-07 20:53 ` [PATCH 9/9] [TULIP] Fix section mismatch in de2104x.c Kyle McMartin
2006-08-09 5:37 ` Jeff Garzik
2006-08-09 5:36 ` [PATCH 8/9] [TULIP] Make DS21143 printout match lspci output Jeff Garzik
2006-08-09 5:35 ` Jeff Garzik [this message]
2006-08-09 6:44 ` [PATCH 6/9] [TULIP] Fix IRQ/DMA race Valerie Henson
2006-08-09 5:33 ` [PATCH 5/9] [TULIP] Flush MMIO writes in reset sequence Jeff Garzik
2006-08-09 5:33 ` [PATCH 4/9] [TULIP] Clean tulip.h so it can be used by winbond-840.c Jeff Garzik
2006-08-09 15:00 ` Grant Grundler
2006-08-10 12:26 ` Jeff Garzik
2006-08-09 5:30 ` [PATCH 3/9] [TULIP] Make tulip_stop_rxtx() failure case slightly more informative Jeff Garzik
2006-08-09 5:29 ` [PATCH 1/9] [TULIP] Fix PHY init and reset Jeff Garzik
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=44D97409.1050002@garzik.org \
--to=jeff@garzik.org \
--cc=akpm@osdl.org \
--cc=grundler@parisc-linux.org \
--cc=kyle@parisc-linux.org \
--cc=netdev@vger.kernel.org \
--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).