Scatter-gather dma, XP driver verifier problem

Devs,

I’m trying to put together some scatter-gather DMA code. The first time I
tried to MapTransfer, driver verifier bugchecked complaining, “HAL Verifier
detected violation - VF: Driver did not flush adapter buffers – bytes
mapped: 2f8 (0 max)”

This is all well and good, so I added a line to flush the buffers just
before MapTransfer looking like:

(*pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->FlushAdapterBuffer
s)
(pdx->DmaInfo[iDMAChannel].AdapterObject,
pdx->DmaInfo[iDMAChannel].pMdl,
pdx->DmaInfo[iDMAChannel].MapRegisterBase,
pdx->DmaInfo[iDMAChannel].TransferVa,
pdx->DmaInfo[iDMAChannel].TransferSize,
FALSE);

longAddr =
(pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->MapTransfer)
(pdx->DmaInfo[iDMAChannel].AdapterObject,
pdx->DmaInfo[iDMAChannel].pMdl,
pdx->DmaInfo[iDMAChannel].MapRegisterBase,
vaddr,
&elen,
!isread);

The driver verifer still bugchecks complaining about the lack of adapter
flushes. This is on the first pass through the code after the application
starts.

Thanks for any help…

Evan Hillman
General Standards
435-755-0309


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

This sounds remarkably familiar. What is the length of the buffer?
Scatter/Gather operations do NOT like zero length transfers and earlier
builds of XP verifier did some really nasty things.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net
(949) 7372731

-----Original Message-----
From: Evan Hillman [mailto:xxxxx@attbi.com]
Sent: Wednesday, January 02, 2002 4:41 PM
To: NT Developers Interest List
Subject: [ntdev] Scatter-gather dma, XP driver verifier problem

Devs,

I’m trying to put together some scatter-gather DMA code. The first time I
tried to MapTransfer, driver verifier bugchecked complaining, “HAL Verifier
detected violation - VF: Driver did not flush adapter buffers – bytes
mapped: 2f8 (0 max)”

This is all well and good, so I added a line to flush the buffers just
before MapTransfer looking like:

(*pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->FlushAdapterBuffer
s)
(pdx->DmaInfo[iDMAChannel].AdapterObject,
pdx->DmaInfo[iDMAChannel].pMdl,
pdx->DmaInfo[iDMAChannel].MapRegisterBase,
pdx->DmaInfo[iDMAChannel].TransferVa,
pdx->DmaInfo[iDMAChannel].TransferSize,
FALSE);

longAddr =
(pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->MapTransfer)
(pdx->DmaInfo[iDMAChannel].AdapterObject,
pdx->DmaInfo[iDMAChannel].pMdl,
pdx->DmaInfo[iDMAChannel].MapRegisterBase,
vaddr,
&elen,
!isread);

The driver verifer still bugchecks complaining about the lack of adapter
flushes. This is on the first pass through the code after the application
starts.

Thanks for any help…

Evan Hillman
General Standards
435-755-0309


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> I’m trying to put together some scatter-gather DMA code. The first time I

tried to MapTransfer, driver verifier bugchecked complaining, “HAL Verifier
detected violation - VF: Driver did not flush adapter buffers – bytes
mapped: 2f8 (0 max)”

This is all well and good, so I added a line to flush the buffers just
before MapTransfer looking like:

(*pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->FlushAdapterBuffer
s)
(pdx->DmaInfo[iDMAChannel].AdapterObject,
pdx->DmaInfo[iDMAChannel].pMdl,
pdx->DmaInfo[iDMAChannel].MapRegisterBase,
pdx->DmaInfo[iDMAChannel].TransferVa,
pdx->DmaInfo[iDMAChannel].TransferSize,
FALSE);

longAddr =
(pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->MapTransfer)
(pdx->DmaInfo[iDMAChannel].AdapterObject,
pdx->DmaInfo[iDMAChannel].pMdl,
pdx->DmaInfo[iDMAChannel].MapRegisterBase,
vaddr,
&elen,
!isread);

The driver verifer still bugchecks complaining about the lack of adapter
flushes. This is on the first pass through the code after the application
starts.

I suspect that’s because the Driver Verifier read DDK and saw it
saying that adapter buffers should be flushed after DMA transfer :slight_smile:


Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> > I’m trying to put together some scatter-gather DMA code. The first time I

> tried to MapTransfer, driver verifier bugchecked complaining, “HAL Verifier
> detected violation - VF: Driver did not flush adapter buffers – bytes
> mapped: 2f8 (0 max)”
>
> This is all well and good, so I added a line to flush the buffers just
> before MapTransfer looking like:
>
>
>
(*pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->FlushAdapterBuffer
> s)
> (pdx->DmaInfo[iDMAChannel].AdapterObject,
> pdx->DmaInfo[iDMAChannel].pMdl,
> pdx->DmaInfo[iDMAChannel].MapRegisterBase,
> pdx->DmaInfo[iDMAChannel].TransferVa,
> pdx->DmaInfo[iDMAChannel].TransferSize,
> FALSE);
>
> longAddr =
> (pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->MapTransfer)
> (pdx->DmaInfo[iDMAChannel].AdapterObject,
> pdx->DmaInfo[iDMAChannel].pMdl,
> pdx->DmaInfo[iDMAChannel].MapRegisterBase,
> vaddr,
> &elen,
> !isread);
>
> The driver verifer still bugchecks complaining about the lack of adapter
> flushes. This is on the first pass through the code after the application
> starts.

I suspect that’s because the Driver Verifier read DDK and saw it
saying that adapter buffers should be flushed after DMA transfer :slight_smile:

I’ve looked through your message once more and realized you put
it there trying to fool the Verifier. I now think you should be
trying to explain why the Verifier said “(0 max)”. It looks very
suspicious.


Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Call FlushAdapterBuffers method after the DMA is done.

Max

----- Original Message -----
From: “Evan Hillman”
To: “NT Developers Interest List”
Sent: Thursday, January 03, 2002 3:41 AM
Subject: [ntdev] Scatter-gather dma, XP driver verifier problem

> Devs,
>
> I’m trying to put together some scatter-gather DMA code. The first time I
> tried to MapTransfer, driver verifier bugchecked complaining, “HAL Verifier
> detected violation - VF: Driver did not flush adapter buffers – bytes
> mapped: 2f8 (0 max)”
>
> This is all well and good, so I added a line to flush the buffers just
> before MapTransfer looking like:
>
>
> (*pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->FlushAdapterBuffer
> s)
> (pdx->DmaInfo[iDMAChannel].AdapterObject,
> pdx->DmaInfo[iDMAChannel].pMdl,
> pdx->DmaInfo[iDMAChannel].MapRegisterBase,
> pdx->DmaInfo[iDMAChannel].TransferVa,
> pdx->DmaInfo[iDMAChannel].TransferSize,
> FALSE);
>
> longAddr =
> (pdx->DmaInfo[iDMAChannel].AdapterObject->DmaOperations->MapTransfer)
> (pdx->DmaInfo[iDMAChannel].AdapterObject,
> pdx->DmaInfo[iDMAChannel].pMdl,
> pdx->DmaInfo[iDMAChannel].MapRegisterBase,
> vaddr,
> &elen,
> !isread);
>
> The driver verifer still bugchecks complaining about the lack of adapter
> flushes. This is on the first pass through the code after the application
> starts.
>
> Thanks for any help…
>
> Evan Hillman
> General Standards
> 435-755-0309
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com