DragonFly BSD
DragonFly kernel List (threaded) for 2003-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Tentitive (untested) ISA DMA space allocation fix.

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 14 Sep 2003 11:26:23 -0700 (PDT)

:>     then hopefully I will be able to track it down when I get my TWE
:>     card in about two weeks.  I'll also take a quick look at the TWE
:>     code to see if there is something obvious.
:Still no love from the twe driver with this patch applied.... :-(

    It could be this line in twe_freebsd.c:

         * Data must be 64-byte aligned; allocate a fixup buffer if it's not.
        if (((vm_offset_t)tr->tr_data % TWE_ALIGNMENT) != 0) {
            tr->tr_realdata = tr->tr_data;                              /* save
pointer to 'real' data */   
            tr->tr_flags |= TWE_CMD_ALIGNBUF;
            tr->tr_data = malloc(tr->tr_length, TWE_MALLOC_CLASS, M_NOWAIT);
/* XXX check result here */

    It is assuming that malloc returns 64-byte aligned data.  I'm not sure
    if this is going to be true in all cases, it depends on the actual
    length being sent to malloc.  Try adding a check and a panic after
    the malloc:

    tr->tr_data = malloc ...
    if ((vm_offset_t)tr->tr_data % TWE_ALIGNMENT)
	panic("TWE malloc %d bytes not %d-aligned", tr->tr_length, TWE_ALIGNMENT);

					Matthew Dillon 

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]