🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.netbsd.tech.kern
Article #10

Re: bus_dma without bouncing

#10
From: Taylor R Campbell
Date: Tue, 27 Oct 2026 14:43
34 lines
3413 bytes
> Date: Tue, 27 Oct 2026 10:33:46 -0400 (EDT)
> From: Mouse <mouse@Rodents-Montreal.ORG>
> 
> > [1] [...].  But there are plenty of devices that require aligned
> >     addresses for DMA, such as Intel wireless cards which require 8-
> >     or 12-bit alignment.  [...]
> 
> What does 12-bit alignment even _mean_ on an 8-bit-addressing-unit
> machine (which IIRC includes everything NetBSD runs on)?  Does it
> differ from 3-byte alignment in any practical sense?  Do the interfaces
> even support alignment to other than a power of two?

By `k-bit alignment' I meant that the k low-order bits of the (byte)
addresses must be zero.  I.e., an address is 8-bit-aligned if it is an
integral multiple of 256, and an address is 12-bit-aligned if it is an
integral multiple of 4096, under this definition.

This constraint arises because the DMA registers don't even have space
for the low 8 (or 4 or 12 or whatever) bits:

   2046 	/* Set physical address of RX ring (256-byte aligned). */
   2047 	IWM_WRITE(sc,
   2048 	    IWM_FH_RSCSR_CHNL0_RBDCB_BASE_REG, sc->rxq.desc_dma.paddr >> 8);
   2049 
   2050 	/* Set physical address of RX status (16-byte aligned). */
   2051 	IWM_WRITE(sc,
   2052 	    IWM_FH_RSCSR_CHNL0_STTS_WPTR_REG, sc->rxq.stat_dma.paddr >> 4);

https://nxr.NetBSD.org/xref/src/sys/dev/pci/if_iwm.c?r=1.94#2046

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <20261027144359.164F184DD5@mail.netbsd.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <202610271433.KAA26130@Stone.Rodents-Montreal.ORG>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Taylor R Campbell <riastradh@NetBSD.org>
Newsgroups: muc.lists.netbsd.tech.kern
Subject: Re: bus_dma without bouncing
Date: Tue, 27 Oct 2026 14:43:48 +0000
Organization: Newsgate at muc.de e.V.
Sender: tech-kern-owner@NetBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <20261027144359.164F184DD5@mail.netbsd.org>
References: <202610271433.KAA26130@Stone.Rodents-Montreal.ORG>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="30580"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org;
	s=20240131; t=1793112241;
	bh=BuB5FYQivKUj1YGOVrbzN1OiOHTfO3zxWNrC68pQQk4=;
	h=To:CC:In-reply-to:Subject:Date:From:List-Id:List-Unsubscribe;
	b=JphKJmw6WlV56oruGNPtGvdkaC4pfHvTMf1ZtOJFQaiI6gDmtnpR1kkAzhi+rTp8z
	 tiLDatagnwEVFsou2MskoHtUfOssFa67S/xlAkDiF5rLw3wWW7W+h/KwE6XtDmX4pF
	 ubBs/cAobhI1O8KZ1QQAw9gZbonfrr46rk85R9fA=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org;
	s=20240131; t=1793112239;
	bh=BuB5FYQivKUj1YGOVrbzN1OiOHTfO3zxWNrC68pQQk4=;
	h=To:CC:In-reply-to:Subject:Date:From;
	b=qFcbwaq4rP2Ap99fk4lNBBwQA6vMn9aAtfges3KMKw/imfArFw5WjSNp3FI6DBs8u
	 otp16ioNfQ02Zfz3erfOkuJaBI5k8SEqAuHxps91n2Ly3TaqMh9te4dE0pEjWTPBuY
	 62JdIwQCUuzXJ1uNRATeHJllZu1OriLIy1ywse+E=
In-reply-to: <202610271433.KAA26130@Stone.Rodents-Montreal.ORG> (mouse@Rodents-Montreal.ORG)
Precedence: bulk
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes