Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Nov 2014 11:47:41 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273965 - head/sys/dev/agp
Message-ID:  <201411021147.sA2BlfVQ063197@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Sun Nov  2 11:47:40 2014
New Revision: 273965
URL: https://svnweb.freebsd.org/changeset/base/273965

Log:
  - agp_generic_unbind_memory: flush AGP TLB before unwiring pages
  - agp_bind_pages: assert that pages have been wired down
  
  MFC after:	1 month

Modified:
  head/sys/dev/agp/agp.c

Modified: head/sys/dev/agp/agp.c
==============================================================================
--- head/sys/dev/agp/agp.c	Sun Nov  2 11:28:15 2014	(r273964)
+++ head/sys/dev/agp/agp.c	Sun Nov  2 11:47:40 2014	(r273965)
@@ -645,6 +645,9 @@ agp_generic_unbind_memory(device_t dev, 
 	 */
 	for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE)
 		AGP_UNBIND_PAGE(dev, mem->am_offset + i);
+
+	AGP_FLUSH_TLB(dev);
+
 	VM_OBJECT_WLOCK(mem->am_obj);
 	for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
 		m = vm_page_lookup(mem->am_obj, atop(i));
@@ -653,8 +656,6 @@ agp_generic_unbind_memory(device_t dev, 
 		vm_page_unlock(m);
 	}
 	VM_OBJECT_WUNLOCK(mem->am_obj);
-		
-	AGP_FLUSH_TLB(dev);
 
 	mem->am_offset = 0;
 	mem->am_is_bound = 0;
@@ -1000,6 +1001,8 @@ agp_bind_pages(device_t dev, vm_page_t *
 	mtx_lock(&sc->as_lock);
 	for (i = 0; i < size; i += PAGE_SIZE) {
 		m = pages[OFF_TO_IDX(i)];
+		KASSERT(m->wire_count > 0,
+		    ("agp_bind_pages: page %p hasn't been wired", m));
 
 		/*
 		 * Install entries in the GATT, making sure that if



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