From owner-freebsd-sparc64@FreeBSD.ORG Wed Aug 18 07:42:42 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B7A416A4CE; Wed, 18 Aug 2004 07:42:42 +0000 (GMT) Received: from ns.kt-is.co.kr (ns.kt-is.co.kr [211.218.149.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C73943D58; Wed, 18 Aug 2004 07:42:41 +0000 (GMT) (envelope-from yongari@kt-is.co.kr) Received: from michelle.kt-is.co.kr (ns2.kt-is.co.kr [220.76.118.193]) (authenticated bits=128) by ns.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id i7I7f1Ah027920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 18 Aug 2004 16:41:02 +0900 (KST) Received: from michelle.kt-is.co.kr (localhost.kt-is.co.kr [127.0.0.1]) by michelle.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id i7I7gHTv008816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Aug 2004 16:42:18 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Received: (from yongari@localhost) by michelle.kt-is.co.kr (8.12.10/8.12.10/Submit) id i7I7gHao008815; Wed, 18 Aug 2004 16:42:17 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Date: Wed, 18 Aug 2004 16:42:17 +0900 From: Pyun YongHyeon To: Ken Smith Message-ID: <20040818074217.GC8375@kt-is.co.kr> References: <200408170909.i7H99taL082002@postoffice.e-easy.com.au> <20040817115518.W68839@ury.york.ac.uk> <20040818010554.GB5194@electra.cse.Buffalo.EDU> <20040818052628.GA8375@kt-is.co.kr> <20040818072641.GB8375@kt-is.co.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040818072641.GB8375@kt-is.co.kr> User-Agent: Mutt/1.4.1i X-Filter-Version: 1.11a (ns.kt-is.co.kr) cc: sos@freebsd.org cc: sparc64@freebsd.org Subject: Re: Insta-panic with recent -current on Ultra10 X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: yongari@kt-is.co.kr List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2004 07:42:42 -0000 > > The following patch seems to fix the issue on AXe. > ... > --- ata-chipset.c.orig Mon Aug 16 20:29:47 2004 > +++ ata-chipset.c Wed Aug 18 16:15:48 2004 > @@ -1578,7 +1578,7 @@ > wordp[idx++] = htole32(prd[i].count & ~ATA_DMA_EOT); > length += (prd[i].count & ~ATA_DMA_EOT); > } while (!(prd[i++].count & ATA_DMA_EOT)); > - wordp[idx - 1] |= htole32(ATA_DMA_EOT); > + wordp[idx - 1] = htole32(ATA_DMA_EOT | wordp[idx - 1]); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Oops. This is not correct one. Sorry. Please ignore the patch for ata-chipset.c. > wordp = (u_int32_t *) > (window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_LSG_OFFSET); > --- ata-dma.c.orig Mon Aug 16 20:29:47 2004 > +++ ata-dma.c Wed Aug 18 16:06:45 2004 > @@ -57,6 +57,7 @@ > static MALLOC_DEFINE(M_ATADMA, "ATA DMA", "ATA driver DMA"); > > /* misc defines */ > +#define MAXSEGSZ PAGE_SIZE > #define MAXTABSZ PAGE_SIZE > #define MAXWSPCSZ PAGE_SIZE > #define MAXCTLDMASZ (2 * (MAXTABSZ + MAXPHYS)) > @@ -199,16 +200,25 @@ > { > struct ata_dmasetprd_args *args = xsc; > struct ata_dma_prdentry *prd = args->dmatab; > - int i; > + bus_size_t cnt; > + u_int32_t lastcount; > + int i, j; > > if ((args->error = error)) > return; > - > + lastcount = j = 0; > for (i = 0; i < nsegs; i++) { > - prd[i].addr = htole32(segs[i].ds_addr); > - prd[i].count = htole32(segs[i].ds_len); > + /* > + * A maximum segment size was specified for bus_dma_tag_create, but > + * some busdma code does not seem to honor this, so fix up if needed. > + */ > + for (cnt = 0; cnt < segs[i].ds_len; cnt += MAXSEGSZ, j++) { > + prd[j].addr = htole32(segs[i].ds_addr + cnt); > + lastcount = ulmin(segs[i].ds_len - cnt, MAXSEGSZ) & 0xffff; > + prd[j].count = htole32(lastcount); > + } > } > - prd[i - 1].count |= htole32(ATA_DMA_EOT); > + prd[j - 1].count = htole32(ATA_DMA_EOT | lastcount); > } > > static int Regards, Pyun YongHyeon -- Pyun YongHyeon