From owner-freebsd-usb@FreeBSD.ORG Tue Dec 18 20:40:51 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C77CDFDB for ; Tue, 18 Dec 2012 20:40:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-oa0-f50.google.com (mail-oa0-f50.google.com [209.85.219.50]) by mx1.freebsd.org (Postfix) with ESMTP id 7B04B8FC15 for ; Tue, 18 Dec 2012 20:40:51 +0000 (UTC) Received: by mail-oa0-f50.google.com with SMTP id n16so1165310oag.23 for ; Tue, 18 Dec 2012 12:40:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=/pIEfr53v03284Ea+DhfkZjGveH0+e/BG2XjwgP1yNo=; b=mY81bKsw2JGYOe8CSvDJrvB/7knA8KKFvXvzLV6pVplfU75pLkQ1s474APb151R3dn BfOkWTn6xVIMyYo3qOhxqpbSVcxvF4aDRyAIbDsFlrXleUkWKVCymsNhxczdT0iC1lrH OLPiZml/VK/FUgeJ8gJwm9hToGFw+S4UcNRCySDst/C3v5JPz0li+I68wm5NRrP5xyQl W1erheGizN+uewZhmuUp1wmRJVChlbfapdeCkSdTRc+lgjyT6vxJe9c4Z7wSHU7MsGl2 Lip2YI4F11/EBqCiBG3+0augh8ngLaUXctKSl2IxyiY70frE7ab7rxmqf4gTeJoWPObc wpWg== X-Received: by 10.60.13.134 with SMTP id h6mr2764727oec.64.1355862769696; Tue, 18 Dec 2012 12:32:49 -0800 (PST) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPS id zz6sm1917217oeb.1.2012.12.18.12.32.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Dec 2012 12:32:48 -0800 (PST) Sender: Warner Losh Subject: Re: EHCI on armv6 with Write-Back caches Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <201212182044.11326.hselasky@c2i.net> Date: Tue, 18 Dec 2012 13:32:46 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1482FC19-720A-480A-BAD2-C8CD306E2E5F@bsdimp.com> References: <20121218204931.5322922d@fubar.geek.nz> <201212181306.44926.hselasky@c2i.net> <20121219081229.383d9f41@fubar.geek.nz> <201212182044.11326.hselasky@c2i.net> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQn9bYpDh+KkuPPeRnx5CW/dmfK6qfOvju/TZufeYykNN+C3eM5gfoxE2wUtZdwoQexITM3l Cc: Oleksandr Tymoshenko , Andrew Turner , freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2012 20:40:51 -0000 On Dec 18, 2012, at 12:44 PM, Hans Petter Selasky wrote: > On Tuesday 18 December 2012 20:12:29 Andrew Turner wrote: >> On Tue, 18 Dec 2012 13:06:44 +0100 >>=20 >> Hans Petter Selasky wrote: >>> Hi Andrew, >>>=20 >>>> The BUS_DMA_COHERENT flag does nothing on armv6 as we need the = cache >>>> enabled for atomic operations to work correctly and we would have = to >>>> disable the cache on the entire page. This is acceptable behaviour >>>> from the description of the flag in the busdma man page. >>>=20 >>> Yes, but when I allocate memory from the USB stack, then I want that >>> memory to not be cached. It is simply not that useful to have that >>> memory cached. I didn't check the latest state of busdma, but if I'm >>> not mistaken, if the BUS_DMA_COHERENT flag is set on the DMA tag, = the >>> flush/invalidate will simply return and do nothing. Maybe that is = the >>> problem ... >>=20 >> The exact meaning of BUS_DMA_COHERENT depends on the architecture. = The >> code is still required to call bus_dmamap_sync with a coherent map = but >> when the flag is implemented the cost of the operation will be = reduced. >> It doesn't guarantee the memory is uncached, it may be implemented = that >> way but the USB code can't rely on it. >>=20 >> Andrew >=20 > The USB code doesn't rely on this flag. I'm wondering if BUSDMA by = accident=20 > sets this flag, so that the cache sync ops are not called. No. It doesn't. Does the USB code still touch bytes in the same cache line while the DMA = is still outstanding? Warner=