From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 1 13:50:22 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C3C316A4CE for ; Mon, 1 Dec 2003 13:50:22 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 488D143F85 for ; Mon, 1 Dec 2003 13:50:21 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hB1LoLFY046851 for ; Mon, 1 Dec 2003 13:50:21 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hB1LoK8p046850; Mon, 1 Dec 2003 13:50:21 -0800 (PST) (envelope-from gnats) Date: Mon, 1 Dec 2003 13:50:21 -0800 (PST) Message-Id: <200312012150.hB1LoK8p046850@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Andrea Cocito Subject: Re: kern/57631: Boot failing for ALi chipsets, patch attached X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Andrea Cocito List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2003 21:50:22 -0000 The following reply was made to PR kern/57631; it has been noted by GNATS. From: Andrea Cocito To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: kern/57631: Boot failing for ALi chipsets, patch attached Date: Mon, 1 Dec 2003 22:48:55 +0100 Just in case: if someone needs a working miniinst iso with the patch it is available at http://bio.ieo-research.it/tmp/ I have been asked by maybe 20 ppl a fixed kernel.... I don't understand why this was not fixed. The code makes no sens also in current 5.2 (where the specific issue of ALi is fixed by a workaround). This piece of code: for (;;) { gatt = agp_alloc_gatt(dev); if (gatt) break; /* * Probably contigmalloc failure. Try reducing the * aperture so that the gatt size reduces. */ if (AGP_SET_APERTURE(dev, AGP_GET_APERTURE(dev) / 2)) { agp_generic_detach(dev); return ENOMEM; } } .. just makes no sense ! It will NEVER try to allocate a smaller aperture (as the comment suggests), all the checks are reversed... it will either panic because trying to aloocate zero bytes, or fail in any case... unless it is asked to allocated ONE byte..... Instead of the dirty workaround to avoid reaching the broken code: + if (entries == 0) { + device_printf(dev, "bad aperture size\n"); + return NULL; + } ... it is way better to FIX the broken code. The proposed patch fixes it, also for otehr agp devices. Ciao, A.