Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Aug 1995 20:13:16 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org
Subject:   Re: How to abort a DMA transfer ?
Message-ID:  <199508201813.UAA01188@uriah.heep.sax.de>
In-Reply-To: <199508201701.TAA12803@labinfo.iet.unipi.it> from "Luigi Rizzo" at Aug 20, 95 07:01:00 pm

next in thread | previous in thread | raw e-mail | index | archive | help
As Luigi Rizzo wrote:
> 
> How (within a device driver) do I abort a DMA transfer which has
> been started but has not completed yet ? I am having this problem
> in the driver for a hand-scanner (the scanner does some read ahead;
> meanwhile, a user might close the device and we want to abort the
> transfer and free the buffer). I am surprised I haven't seen (or
> understood!) anything like this in existing drivers, not even in
> the floppy driver!

You are surprised to have not seen this in the floppy driver?  This
surprises me. :-)

Actually, i'd immediately kill the floppy controller if i would abort
a transfer in progress.  The only means then would raise the reset
line of the FDC.

I'm not sure if setting some masking bit in one of the DMAC registers
will actually _abort_ a transfer.  Van Gilluwe does only speak about
masking a request.  The culprit is that DMA operation is usually
IO-controlled (via the TC signal) instead of being software-
controlled.

Why don't you simply continue the started request, and throw away its
results once the DMAC has signalled the command completetion by an
interrupt (and the interrupt handler sees that the device is closed
now)?  I would personally do everything in avoiding even touching such
a hot iron like the DMAC.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508201813.UAA01188>