Suspending DMA Transacions and Northbridge Chipset

Hello to everyone. I have one question to ask. Can Windows OS (Windows 7/8.1/10) have the functionality to suspend a DMA stream from internal HDD to external USB HDD or from internal HDD to USB Flash Memory Stick ? What I mean by suspend is if a user is copying files and folders from the C: HDD drive to a external USB HDD or external Flash Memory Stick and the copying process completely stops (not a single byte being transferred) and then there a pause of 30 seconds or more then continues with the DMA transaction. Does the OS or a kernel mode driver have the capability of interrupting and suspending the DMA transaction ? Thank you

I’m not aware of any built-in DMA “pause” functionality, but a driver could certainly approximate something along these lines by delaying when it programs the device to DMA a mapped buffer, or when it asks HAL to map the next chunk of a larger transaction.

If you’re using KMDF, you could for example start a timer with DueTime=30s from your DMA completion EvtInterruptDpc, and have the timer’s callback invoke WdfDmaTransactionDmaCompleted instead of calling it from the DPC. This would effectively introduce a 30s pause between when the DMA transfer completed and when the next one will be mapped.

I’m curious, what is this for?

Or were you asking if you can pause any running DMA transactions on the system, not just ones performed by your driver?

> Can Windows OS (Windows 7/8.1/10) have the functionality to suspend a DMA stream

from internal HDD to external USB HDD or from internal HDD to USB Flash Memory Stick ?

I guess you have to wait for Mr.Roberts help - he is the one who is specialised in questions about DMA from internal HDD to external USB HDD, the ones concerning C basics, the ones about writing drivers in Java, etc,etc,etc.It may sound incredible, but he is able to answer questions like that without any irritation…

Anton Bassov

>completely stops (not a single byte being transferred) and then there a pause of 30 seconds or more

This looks very much like the hung ATA controller, with the hang being resolved by the watchdog reset timer in the driver.

If you use MsAhci driver (Windows inbox) on pre-Win8 OS - then this is a well-known bug in this driver. Either switch off AHCI in favor of good old pre-AHCI IDE, or install the vendor’s driver instead of inbox one.

Also, ensure that your hard drive is not deteritoriating and making auto-retries with audible clicks.

This is not about DMA. This is about something else stops, most probably hardware. DMA stops as a consequence - the whole process stops, no more IRPs are submitted to the driver.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

xxxxx@hotmail.com wrote:

Hello to everyone. I have one question to ask. Can Windows OS (Windows 7/8.1/10) have the functionality to suspend a DMA stream from internal HDD to external USB HDD or from internal HDD to USB Flash Memory Stick ? What I mean by suspend is if a user is copying files and folders from the C: HDD drive to a external USB HDD or external Flash Memory Stick and the copying process completely stops (not a single byte being transferred) and then there a pause of 30 seconds or more then continues with the DMA transaction. Does the OS or a kernel mode driver have the capability of interrupting and suspending the DMA transaction ?

The action you’re talking about is not just a single huge DMA
transaction. There are many, many players involved here. The read path
from a SATA drive is using DMA to read into buffers that are then passed
up to the user-mode “copy” application, one buffer at a time. The copy
application then sends that buffer down through the USB driver stack,
where it gets chopped up into packet-sized bites to go on the USB wire.

It is entirely possible for a CPU-bound application to prevent the copy
app from running, which will stop the copy process.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

xxxxx@hotmail.com wrote:

I guess you have to wait for Mr.Roberts help - he is the one who is specialised in questions about DMA from internal HDD to external USB HDD, the ones concerning C basics, the ones about writing drivers in Java, etc,etc,etc.It may sound incredible, but he is able to answer questions like that without any irritation…

Again, I feel compelled to point out that we were all beginners once.

I saw a shot of a Twitter tweet yesterday that asked “What was the name
of the ship in the movie Titanic?”


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> Again, I feel compelled to point out that we were all beginners once.

More on it below,

I saw a shot of a Twitter tweet yesterday that asked “What was the name of the ship
in the movie Titanic?”

What was your reaction to it? Did you repeat the above mantra about the beginners as well?

After all, I don’t see any reason why someone asking questions like that has to be more stupid than an aspiring system-level software engineer asking the questions the OP does…

Anton Bassov

@Alex. No my question is based on whether a driver application could possibly pause a DMA exchange. I have not written any drivers yet as I’m new to driver development. Would anyone have any comments on what the role of the Northbridge chipset is throughout the DMA process ?

Many thanks @Alex @Tim @Anton @Maxim

Sigh. Before you try to write a driver, I would recommend you learn a bit about computer architecture. You’re question is confusing, It demonstrates a lack of basic knowledge of how DMA operates. That’s not a question a forum can answer. It’s a question for a university computer acrhictecture class or a book.

I mean no offense. But you have to understand hammers and nails before you can start asking questions about building a house.

Peter
OSR
@OSRDrivers

xxxxx@hotmail.com wrote:

No my question is based on whether a driver application could possibly pause a DMA exchange. I have not written any drivers yet as I’m new to driver development. Would anyone have any comments on what the role of the Northbridge chipset is throughout the DMA process ?

What we call DMA is actually a historical name for what is more properly
called “bus mastering”. The device is temporarily granted the right to
become the master of the bus, instead of the root chipset. It then
controls the transfer on its own. The device is in complete control.
Once the transfer is triggered, there is no way to stop it. The CPU is
not involved in any way. That’s the whole POINT of bus mastering – to
let the CPU go on to more interesting things.

The only role of the northbridge chipset in this scenario is to route
requests to RAM. The device is presumably reading or writing from
system RAM addresses. The request goes to the PCIe root complex in the
southbridge, which puts the requests on the internal bus, and the
northbridge routes them to RAM.

As Peter said, your request shows a lack of understanding of the
architecture. In other words, you’re asking the wrong question. Tell
us what higher level objective you are actually trying to accomplish.
You mentioned trying to interfere in a copy. There are lots of ways to
do that, but none of them involve DMA.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.