From owner-freebsd-stable@FreeBSD.ORG Mon Jan 3 14:57:25 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F25C616A4CE for ; Mon, 3 Jan 2005 14:57:25 +0000 (GMT) Received: from mailserver.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 611ED43D39 for ; Mon, 3 Jan 2005 14:57:25 +0000 (GMT) (envelope-from emaste@phaedrus.sandvine.ca) Received: from exchange.sandvine.com ([192.168.1.61]) by mailserver.sandvine.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 3 Jan 2005 09:57:21 -0500 Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by exchange.sandvine.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 3 Jan 2005 09:57:21 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 12627) id 35AF413616; Mon, 3 Jan 2005 09:57:21 -0500 (EST) Date: Mon, 3 Jan 2005 09:57:21 -0500 From: Ed Maste To: freebsd-stable@freebsd.org Message-ID: <20050103145720.GA90754@sandvine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 03 Jan 2005 14:57:21.0410 (UTC) FILETIME=[86F12E20:01C4F1A4] Subject: Patch for PNP BIOS hang X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2005 14:57:26 -0000 A colleague of mine reported on a hang during boot on a SuperMicro board (with ACPI off): http://lists.freebsd.org/pipermail/freebsd-current/2004-March/023045.html with some more analysis: http://lists.freebsd.org/pipermail/freebsd-current/2004-July/030827.html as it turns out it doesn't actually always hang, it usually takes 30-45 minutes to boot. The problem comes from the PNP0c01 entry in the PNP BIOS, and specifically the entry: PNP0c01: adding fixed memory32 range 0xfff80000-0xffffffff, size=0x80000 In isa/isa_common.c:isa_find_memory() there's a for loop that looks for space for the memory block: for (start = config->ic_mem[i].ir_start, end = config->ic_mem[i].ir_end, align = config->ic_mem[i].ir_align; start + size - 1 <= end; start += align) { For some reason the attempt to use the given memory region fails. After adding align to start, start + size - 1 wraps and the <= end test remains true. The following patch gets this board booting for me: --- isa_common.c@@/main/sandvine_bsd_5_main/0 2005-01-02 15:39:24.000000000 -0500 +++ isa_common.c 2005-01-02 23:59:06.000000000 -0500 @@ -149,7 +149,7 @@ for (start = config->ic_mem[i].ir_start, end = config->ic_mem[i].ir_end, align = config->ic_mem[i].ir_align; - start + size - 1 <= end; + start + size - 1 <= end && start + size > start; start += align) { bus_set_resource(child, SYS_RES_MEMORY, i, start, size);