From owner-svn-src-all@freebsd.org Mon Nov 9 12:29:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C2BA29A13; Mon, 9 Nov 2015 12:29:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A23E1B12; Mon, 9 Nov 2015 12:29:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1027D1FE023; Mon, 9 Nov 2015 13:29:12 +0100 (CET) Subject: Re: svn commit: r290610 - head/sys/x86/x86 To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511091219.tA9CJwe7067036@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <564091FF.8090605@selasky.org> Date: Mon, 9 Nov 2015 13:30:55 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201511091219.tA9CJwe7067036@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Mon, 09 Nov 2015 12:29:14 -0000 On 11/09/15 13:19, Roger Pau Monné wrote: > + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { > + /* > + * If we have to keep the offset of each page this function > + * is not suitable, switch back to bus_dmamap_load_ma_triv > + * which is going to do the right thing in this case. > + */ > + error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, ma_offs, > + flags, segs, segp); > + return (error); > + } Hi, There has been an update made to the USB stack, which is currently the only client of "BUS_DMA_KEEP_PG_OFFSET", which means this check can probably be skipped or relaxed a bit. The condition which must be fullfilled is: #ifdef USB_DEBUG if (nseg > 1 && ((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) != ((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) { /* * This check verifies there is no page offset hole * between the first and second segment. See the * BUS_DMA_KEEP_PG_OFFSET flag. */ DPRINTFN(0, "Page offset was not preserved\n"); error = 1; goto done; } #endif See: sys/dev/usb/usb_busdma.c --HPS