From owner-freebsd-hackers Wed May 17 15:57: 6 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from portnoy.lbl.gov (portnoy.lbl.gov [131.243.2.11]) by hub.freebsd.org (Postfix) with ESMTP id 75A6C37BEA0 for ; Wed, 17 May 2000 15:57:02 -0700 (PDT) (envelope-from jin@portnoy.lbl.gov) Received: (from jin@localhost) by george.lbl.gov () id PAA25512; Wed, 17 May 2000 15:56:58 -0700 (PDT) Date: Wed, 17 May 2000 15:56:58 -0700 (PDT) From: Jin Guojun (FTG staff) Message-Id: <200005172256.PAA25512@george.lbl.gov> To: bright@wintelcom.net Subject: Re: How to make system Sync Cc: hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alfred Perlstein stated: > > I had a couple of system out of sync problems. > > > > (1) PCI sync problem: > > ATM adapter updates a buffer return pointer and generates intr, > > but when driver pulls out the information that updated by adapter, > > some memory in the last piece of the pool is garbage. > > e.g. > > head -> c0100000 > > tail -> c0100400 > > > > c0100000 -> buf0 > > c0100004 -> buf1 > > ... > > c0100100 -> bufn > > ... > > c0100160 -> bad address or 0 > > ... > > > > If I let driver tsleep() for a while, the problem can be improved. > > So, it looks like that adapter pushed (DMA) the data into memory, > > but not been seen by CPU right way due to the DMA sync issue. > > How can we sync the DMA transaction in BSD? > > I think the way you accomplish this is by telling the adapter to > generate an interrupt when it's completed its DMA operation, you > seem to be generating interupts at the start instead of the end. I do not think I have control on when interrupt can be started. The interrupts are generated when either the # of buffers below the buffer threshold or the I/O packages greater than I/O threshold. In Solaris driver, a ddi_dma_sync() routine is used for DMA sync in this case: #define BCD_FLUSH_CACHE_FOR_HOST(dhandle, offset, length) \ ddi_dma_sync(dhandle, offset, length, DDI_DMA_SYNC_FORKERNEL) Only thing I am not clear is that reference manual says: For this adapter, the SDRAM_CTRL register "should" have LB_64_ENB bit set to 1. There is no further information on this register. I wonder this could cause the problem since majority PC motherboards have a 32-bit PCI local bus (LB). -Jin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message