From: Linus T. <tor...@tr...> - 2002-06-15 20:54:25
|
On Sat, 15 Jun 2002, Keith Whitwell wrote: > > > > I also hope you do the toggle with a locked cycle so that you don't lose > > any information.. > > Is this necessary if the toggle is really just a write? Jose, you're not > doing a read-modify-write operation on that flag are you? That depends on the DMA engine too. For example, if the DMA engine _just_ reads the commands from memory, then you should be able to just toggle the flag by doing a regular read-modify-write (or, if you just keep track of what the last word was, do just a write to avoid the uncached read) But in the USB example, the DMA engine will not just read the commands, it will also update their status ("I've done this command"), and if you then use a regular non-atomic read-modify-write, you may lose information (ie the updated command status might get lost, and the DMA engine might end up doing the command twice or something). (Note that the USB command structure is likely _much_ more complex than the mach64 command structure, so I suspect you may not have these kinds of issues on the mach64 at all). > I suppose to some extent we're relying on the atomicity of the mach64's use of > that flag as well -- I don't know if there are any obvious ways they could get > it wrong (I assume they just fetch it once...) -- so that's probably not a > huge problem. In that case, a simple write (with just the "end bit" cleared or whatever the marker is) should be fine. Linus |