From owner-p4-projects@FreeBSD.ORG Sun Jan 27 14:44:41 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B6DD816A46C; Sun, 27 Jan 2008 14:44:41 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63F4C16A421 for ; Sun, 27 Jan 2008 14:44:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 534D413C45B for ; Sun, 27 Jan 2008 14:44:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0REifgo088419 for ; Sun, 27 Jan 2008 14:44:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0REifwu088416 for perforce@freebsd.org; Sun, 27 Jan 2008 14:44:41 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 27 Jan 2008 14:44:41 GMT Message-Id: <200801271444.m0REifwu088416@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 134197 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2008 14:44:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=134197 Change 134197 by hselasky@hselasky_laptop001 on 2008/01/27 14:43:58 Bugfix. When we load memory into DMA it is also multi segment. "usbd_get_page()" should compute the physical address based on the offset and the first "usbd_page" alone when "ismultiseg" is false. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#88 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#88 (text+ko) ==== @@ -2050,12 +2050,18 @@ page = pc->page_start; + if (pc->ismultiseg) { + page += (offset / USB_PAGE_SIZE); offset %= USB_PAGE_SIZE; res->length = USB_PAGE_SIZE - offset; res->physaddr = page->physaddr + offset; + } else { + res->length = 0 - 1; + res->physaddr = page->physaddr + offset; + } if (!pc->buffer) { /* Case 1b - Non Kernel Virtual Address */ @@ -2440,6 +2446,7 @@ /* setup page cache */ pc->page_offset_buf = 0; pc->page_offset_end = size; + pc->ismultiseg = 1; if (size > 0) { @@ -2792,6 +2799,7 @@ /* setup page cache */ pc->page_offset_buf = 0; pc->page_offset_end = size; + pc->ismultiseg = 1; if (size > 0) {