My question is about data validity and timeliness with PCI bus master
transactions.

I have a bus master PCI device. The kernel mode driver programs the DMA
controller on the bus master device to transfer data from the deviceâ??s memory
to the hostâ??s system memory. When the transfer is complete (the deviceâ??s
internal DMA FIFOs empty), the device generates a PCI interrupt to notify the
host. At this point, the ISR schedules a DPC, which performs some handling
of the completed transfer and possibly invalidates the cache for that system
memory region. I would like to know at what point a PCI bus master driver
can expect, with 100% certainty, the transferred data to be in system memory.


Is it ridiculous to imagine that the ISR/DPC processing could happen before
the host PCI bridge can shuffle all of the data into system memory? Am I
being paranoid?

I would like someone who has intimate knowledge of this process to either
ease my concerns, or give me a little direction.

Thank you,
Lou Rohan

Re: Data validity and timeliness with PCI bus master transactions by Calvin

Calvin
Fri Nov 05 16:39:46 CST 2004

You will need to ensure the cache coherence by calling FlushAdapterBuffers
(WDM drivers), typically in your DPC routine.
If you are writing a NIC driver, you need to call NdisMUpdateSharedMemory
for the similar purpose.

If cache coherence is maintained by H/W platform, those functions are nop.

HTH,
Calvin
--
Calvin Guan Software Engineer/Radeon NT Drivers
ATI Technologies Inc. Markham ON, Canada
www.ati.com
"Lou Rohan" <Lou Rohan@discussions.microsoft.com> wrote in message
news:CB810619-EC1E-4BF3-9797-A925DBA9EF25@microsoft.com...
> My question is about data validity and timeliness with PCI bus master
> transactions.
>
> I have a bus master PCI device. The kernel mode driver programs the DMA
> controller on the bus master device to transfer data from the device's
memory
> to the host's system memory. When the transfer is complete (the device's
> internal DMA FIFOs empty), the device generates a PCI interrupt to notify
the
> host. At this point, the ISR schedules a DPC, which performs some
handling
> of the completed transfer and possibly invalidates the cache for that
system
> memory region. I would like to know at what point a PCI bus master driver
> can expect, with 100% certainty, the transferred data to be in system
memory.
>
>
> Is it ridiculous to imagine that the ISR/DPC processing could happen
before
> the host PCI bridge can shuffle all of the data into system memory? Am I
> being paranoid?
>
> I would like someone who has intimate knowledge of this process to either
> ease my concerns, or give me a little direction.
>
> Thank you,
> Lou Rohan
>



Re: Data validity and timeliness with PCI bus master transactions by Maxim

Maxim
Fri Nov 05 19:44:22 CST 2004

> You will need to ensure the cache coherence by calling FlushAdapterBuffers
> (WDM drivers), typically in your DPC routine.

This is not cache coherence, this is flushing of bounce buffers. The call is
absolutely mandatory and can be understood as undo for MapTransfer.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Re: Data validity and timeliness with PCI bus master transactions by Alexander

Alexander
Fri Nov 05 21:27:53 CST 2004

Does it also guarantee that the PCI-PCI bridges have flushed any posted
writes?

"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:%235w4cI6wEHA.3288@TK2MSFTNGP14.phx.gbl...
>> You will need to ensure the cache coherence by calling
>> FlushAdapterBuffers
>> (WDM drivers), typically in your DPC routine.
>
> This is not cache coherence, this is flushing of bounce buffers. The call
> is
> absolutely mandatory and can be understood as undo for MapTransfer.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>



Re: Data validity and timeliness with PCI bus master transactions by Maxim

Maxim
Fri Nov 05 22:33:07 CST 2004

Usually the hardware is working in a way so that a status register must be
read to check for DMA done. This read will flush the posted writes.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:%23mXbcC7wEHA.4028@TK2MSFTNGP15.phx.gbl...
> Does it also guarantee that the PCI-PCI bridges have flushed any posted
> writes?
>
> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> news:%235w4cI6wEHA.3288@TK2MSFTNGP14.phx.gbl...
> >> You will need to ensure the cache coherence by calling
> >> FlushAdapterBuffers
> >> (WDM drivers), typically in your DPC routine.
> >
> > This is not cache coherence, this is flushing of bounce buffers. The call
> > is
> > absolutely mandatory and can be understood as undo for MapTransfer.
> >
> > --
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > maxim@storagecraft.com
> > http://www.storagecraft.com
> >
> >
>
>