From owner-svn-src-all@FreeBSD.ORG Tue Dec 23 16:04:33 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B2671065687; Tue, 23 Dec 2008 16:04:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AA6C8FC19; Tue, 23 Dec 2008 16:04:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBNG4Xm6006630; Tue, 23 Dec 2008 16:04:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBNG4X91006629; Tue, 23 Dec 2008 16:04:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812231604.mBNG4X91006629@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 23 Dec 2008 16:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186433 - head/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2008 16:04:33 -0000 Author: kib Date: Tue Dec 23 16:04:33 2008 New Revision: 186433 URL: http://svn.freebsd.org/changeset/base/186433 Log: Clear busy state on the pages which are after the one that failed the bind attempt. Reported and tested by: ganbold Reviewed by: rnoland MFC after: 2 weeks Modified: head/sys/dev/agp/agp.c Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Tue Dec 23 15:47:31 2008 (r186432) +++ head/sys/dev/agp/agp.c Tue Dec 23 16:04:33 2008 (r186433) @@ -564,6 +564,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; } @@ -592,7 +593,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; @@ -622,8 +622,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();