lkml.org 
[lkml]   [1999]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectPCI ordering [was Re: Universal Driver Interface spec available]
Date
Alan Cox wrote:
>
> The only horrible case to watch is terminating a live DMA. PCI does write
> posting so doing
>
>
> writel(STOP_DMA, card->control);
> kfree(buf);
>
> is fatal every so often, as the write will be posted, the buffer freed,
> reallocated and trashed before the DMA is posted. Instead use
>
> writel(STOP_DMA, card->control);
> readl(card->anythingboring);
> kfree(buf);

In theory even this isn't safe, since the read return is allowed to pass
inbound DMAs according to the PCI spec. In practice I doubt any non-
buggy hardware would actually do this to you. (I've got some hardware
that does, and I certainly consider it to be buggy...)

--
............................................................................
Peter Desnoyers
162 Pleasant St. (617) 661-1979 pjd@fred.cambridge.ma.us
Cambridge, Mass. 02139 (978) 461-0402 (work) pjd@giga-net.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.036 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site