From patchwork Thu Aug 30 17:20:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10582401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B84E17DB for ; Thu, 30 Aug 2018 17:24:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F18B2C2FC for ; Thu, 30 Aug 2018 17:24:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 409982C30A; Thu, 30 Aug 2018 17:24:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C47132C2FC for ; Thu, 30 Aug 2018 17:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=yisRaq2FINN8GWLfwrfgXJR/Vbsm/cvowIuutNK2dM8=; b=d0p 0YCOgQLIlume+dJETqZ7Pgixnffv+yK9353nFRYpQqh0TeE3bL0MZcBYJiAUnNHz4LveVtp2Wegnw gCWhdHL9nBSo41/2g8pxwwxOrpjZOKdqSHEqXIxq87nyOZ+R5vnF/rUvfBkIZ+mY4fwbUVC50mMj2 VsI4dXZQMT5tbElXTghi3ZZmGxd13l0HUzOC4hJyPzYBYI3XoXXa5rxirRrMEc0l3CVYSvpT44lib IrbY+lp1mLjLY3Tt1Oi4ue1izv6v2M9A94vIKkS3f6FTxBUG1S1qB6cW7Gt4SEpwx7dimpaAfKoZH wYS5PoollkMe5yYW5VAKP+o/QpTVF0w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvQfw-00089b-Hx; Thu, 30 Aug 2018 17:24:08 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvQd8-0006nJ-OE for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 17:21:50 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 5904126C052 From: Ezequiel Garcia To: linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC 0/3] Introduce usb_{alloc,free}_noncoherent API Date: Thu, 30 Aug 2018 14:20:27 -0300 Message-Id: <20180830172030.23344-1-ezequiel@collabora.com> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_102114_960257_771E81EC X-CRM114-Status: UNSURE ( 8.38 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomasz Figa , "Matwey V . Kornilov" , Keiichi Watanabe , Alan Stern , Laurent Pinchart , kernel@collabora.com, Ezequiel Garcia MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Following the discussion on PWC [1] and UVC [2] drivers, where use non-consistent mappings for the URB transfer buffers was shown to improve transfer speed significantly, here's a proposal for a non-coherent USB helpers. With this pachset, it's possible to get 360x288 raw analog video using stk1160 and a AM335x Beaglebone Black board. This isn't possible in mainline, for the same reasons Matwey has explained [1]. First patch is a hack, obviously incomplete, to add support for non-consistent mappings on ARM. The second patch introduces the usb_{alloc,free}_noncoherent API, while the third patch is an example on stk1160. I'm sending this patchset as RFC, just to get the ball rolling. [1] https://lkml.org/lkml/2018/8/21/663 [2] https://lkml.org/lkml/2018/6/27/188 Ezequiel Garcia (3): HACK: ARM: dma-mapping: Get writeback memory for non-consistent mappings USB: core: Add non-coherent buffer allocation helpers stk1160: Use non-coherent buffers for USB transfers arch/arm/include/asm/pgtable.h | 3 ++ arch/arm/mm/dma-mapping.c | 9 ++-- drivers/media/usb/stk1160/stk1160-video.c | 22 +++------ drivers/usb/core/buffer.c | 29 +++++++----- drivers/usb/core/hcd.c | 5 +- drivers/usb/core/usb.c | 56 ++++++++++++++++++++++- include/linux/usb.h | 5 ++ include/linux/usb/hcd.h | 4 +- 8 files changed, 97 insertions(+), 36 deletions(-)