Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 2003 13:50:21 -0800 (PST)
From:      Andrea Cocito <blackye@break.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/57631: Boot failing for ALi chipsets, patch attached
Message-ID:  <200312012150.hB1LoK8p046850@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/57631; it has been noted by GNATS.

From: Andrea Cocito <blackye@break.net>
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.
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312012150.hB1LoK8p046850>