svn commit: r186830 - in stable/7/sys: . contrib/pf dev/cxgb pci sys

Konstantin Belousov kib at FreeBSD.org
Tue Jan 6 15:18:15 UTC 2009


Author: kib
Date: Tue Jan  6 15:18:14 2009
New Revision: 186830
URL: http://svn.freebsd.org/changeset/base/186830

Log:
  MFC r186433:
  
  Clear busy state on the pages which are after the one that failed the bind
  attempt.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/pci/agp.c
  stable/7/sys/sys/copyright.h   (props changed)

Modified: stable/7/sys/pci/agp.c
==============================================================================
--- stable/7/sys/pci/agp.c	Tue Jan  6 15:10:26 2009	(r186829)
+++ stable/7/sys/pci/agp.c	Tue Jan  6 15:18:14 2009	(r186830)
@@ -563,6 +563,7 @@ agp_generic_bind_memory(device_t dev, st
 		device_printf(dev, "memory already bound\n");
 		error = EINVAL;
 		VM_OBJECT_LOCK(mem->am_obj);
+		i = 0;
 		goto bad;
 	}
 	
@@ -591,7 +592,6 @@ agp_generic_bind_memory(device_t dev, st
 				 * Bail out. Reverse all the mappings
 				 * and unwire the pages.
 				 */
-				vm_page_wakeup(m);
 				for (k = 0; k < i + j; k += AGP_PAGE_SIZE)
 					AGP_UNBIND_PAGE(dev, offset + k);
 				goto bad;
@@ -621,8 +621,10 @@ agp_generic_bind_memory(device_t dev, st
 bad:
 	mtx_unlock(&sc->as_lock);
 	VM_OBJECT_LOCK_ASSERT(mem->am_obj, MA_OWNED);
-	for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
-		m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(i));
+	for (k = 0; k < mem->am_size; k += PAGE_SIZE) {
+		m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k));
+		if (k >= i)
+			vm_page_wakeup(m);
 		vm_page_lock_queues();
 		vm_page_unwire(m, 0);
 		vm_page_unlock_queues();


More information about the svn-src-stable-7 mailing list