kern/57631: Boot failing for ALi chipsets, patch attached

Andrea Cocito blackye at break.net
Mon Dec 1 13:50:22 PST 2003


The following reply was made to PR kern/57631; it has been noted by GNATS.

From: Andrea Cocito <blackye at break.net>
To: freebsd-gnats-submit at 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.
 


More information about the freebsd-bugs mailing list