From owner-cvs-all Thu Jan 16 16:34: 4 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E53637B401; Thu, 16 Jan 2003 16:34:01 -0800 (PST) Received: from is1.mh.itc.u-tokyo.ac.jp (is1.mh.itc.u-tokyo.ac.jp [133.11.205.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id E274243F1E; Thu, 16 Jan 2003 16:33:58 -0800 (PST) (envelope-from simokawa@sat.t.u-tokyo.ac.jp) Received: from is1.mh.itc.u-tokyo.ac.jp (is1.mh.itc.u-tokyo.ac.jp [127.0.0.1]) by is1.mh.itc.u-tokyo.ac.jp (Postfix) with ESMTP id 59D6A21816B; Fri, 17 Jan 2003 09:33:51 +0900 (JST) Received: from mailhosting.itc.u-tokyo.ac.jp (IDENT:mirapoint@mailhosting.itc.u-tokyo.ac.jp [133.11.205.3]) by is1.mh.itc.u-tokyo.ac.jp (8.11.3/8.11.3) with ESMTP id h0H0XoJ25631; Fri, 17 Jan 2003 09:33:50 +0900 Received: from ett.sat.t.u-tokyo.ac.jp (ett.sat.t.u-tokyo.ac.jp [133.11.135.3]) by mailhosting.itc.u-tokyo.ac.jp (Mirapoint Messaging Server MOS 2.9.3.2) with ESMTP id AHR23400; Fri, 17 Jan 2003 09:33:50 +0900 (JST) Date: Fri, 17 Jan 2003 09:33:50 +0900 Message-ID: From: Hidetoshi Shimokawa To: Nate Lawson Cc: Sam Leffler , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/firewire firewire.c fwdev.c fwohci.c fwohcivar.h In-Reply-To: References: <20e801c2bdad$770d56f0$5a557f42@errno.com> User-Agent: Wanderlust/2.11.0 (Wonderwall) REMI/1.14.3 (Matsudai) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.4 (patch 8) (Honest Recruiter) (i386--freebsd) X-Face: OE([KxWyJI0r[R~S/>7ia}SJ)i%a,$-9%7{*yihQk|]gl}2p#"oXmX/fT}Bn7: #j7i14gu$jgR\S*&C3R/pJX List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At Thu, 16 Jan 2003 15:47:24 -0800 (PST), Nate Lawson wrote: > > On Thu, 16 Jan 2003, Sam Leffler wrote: > > > >> Modified files: > > > >> sys/dev/firewire firewire.c fwdev.c fwohci.c fwohcivar.h > > > >> Log: > > > >> Improve memory allocation. > > > >> - Don't use contigmalloc() and allocate page by page to avoid > > > >> allocation failure. > > > >> - allocate buffer by PAGE_SIZE. > > > > > > > > Some comments. > > > > > > > >> - contigfree((void *)(uintptr_t)sc->fc.sid_buf, > > > >> - OHCI_SIDSIZE, M_DEVBUF); > > > >> + free((void *)(uintptr_t)sc->fc.sid_buf, M_DEVBUF); This is to stop compiler warning. > > > malloced buffers are not guaranteed to be accessable by a device. > > > Use bus dma instead. Moreover, sid_buf must be 2KB aligned and continuous in physical memory. Can I assumed 2KB malloced buffer is 2KB aligned on all plathomes? (or still need to use contigmalloc?) > > New drivers should use bus_dma. I recently hit an issue like this with > > jumbo mbufs not being handled by the bge driver because it doesn't use bus > > dma. > > Valid points. I just wanted to clarify that many of his mallocs are not > for buffers addressed by dma but also for control/header structures. > Those do not need to be changed. 1394 OHCI needs large context program area. For example, to transmit DV stream, current code requests (16*3) bytes * 2400 blocks and each block must be continuous. Is there any code to help such allocation with bus dma? I agree with original code(you know the code is not written by me) has many flaws and I'm fixing it one by one. Of course, converting to bus dma is in TODO list but not the first one now. See http://developer.intel.com/technology/1394/download/ohci_11.htm for detail. /\ Hidetoshi Shimokawa \/ simokawa@sat.t.u-tokyo.ac.jp PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message