Date: Mon, 27 Aug 2001 13:21:17 -0400 (EDT) From: Zhihui Zhang <zzhang@cs.binghamton.edu> To: Julian Elischer <julian@elischer.org> Cc: freebsd-hackers@freebsd.org Subject: Re: ata0-master: non aligned DMA transfer attempted Message-ID: <Pine.SOL.4.21.0108271317440.19001-100000@onyx> In-Reply-To: <3B8A78CA.A888C9BC@elischer.org>
index | next in thread | previous in thread | raw e-mail
On Mon, 27 Aug 2001, Julian Elischer wrote:
> Zhihui Zhang wrote:
>
> > I believe that message is from ata_dmasetup():
> >
> > if (((uintptr_t)data & scp->alignment) || (count & scp->alignment)) {
> > ata_printf(scp, device, "non aligned DMA transfer attempted\n");
> > return -1;
> > }
> >
> > The user address obtained by static allocation is not 16-byte aligned. The
> > kernel routine physio() grabs a physical buffer to do DMA, but it still
> > uses the user's address. The KVA associated with the buffer is not used.
> >
> > -Zhihui
>
>
> the physical address of a buffer will have the same allignment as the KVA
> address.
But how can you explain the following statement in physio():
bp->b_dev = dev;
bp->b_iodone = physwakeup;
----> bp->b_data = uio->uio_iov[i].iov_base;
bp->b_bcount = uio->uio_iov[i].iov_len;
bp->b_offset = uio->uio_offset;
bp->b_saveaddr = sa;
The bp->b_data is set to point to the user address. And later on, it is
passed to the data argument of ata_dmasetup(), where the alignment is
checked.
-Zhihui
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.21.0108271317440.19001-100000>
