From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D18DC43381 for ; Mon, 1 Feb 2021 16:38:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3604360235 for ; Mon, 1 Feb 2021 16:38:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231134AbhBAQiM (ORCPT ); Mon, 1 Feb 2021 11:38:12 -0500 Received: from verein.lst.de ([213.95.11.211]:41983 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbhBAQiL (ORCPT ); Mon, 1 Feb 2021 11:38:11 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id C42486736F; Mon, 1 Feb 2021 17:37:26 +0100 (CET) Date: Mon, 1 Feb 2021 17:37:26 +0100 From: Christoph Hellwig To: Ricardo Ribalda Cc: Christoph Hellwig , Mauro Carvalho Chehab , Marek Szyprowski , Tomasz Figa , Sergey Senozhatsky , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux Media Mailing List , Robin Murphy , Linux Kernel Mailing List , Linux Doc Mailing List Subject: Re: [PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API Message-ID: <20210201163726.GA8279@lst.de> References: <20210128145837.2250561-1-hch@lst.de> <20210128145837.2250561-7-hch@lst.de> <20210128150955.GA30563@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 28, 2021 at 06:00:57PM +0100, Ricardo Ribalda wrote: > > Given that we vmap the addresses this also needs > > flush_kernel_vmap_range / invalidate_kernel_vmap_range calls for > > VIVT architectures. > > We only read from the device to the cpu. Then can we run only > invalidate_kernel_vmap_range() ? > > something like ? > else { > dma_sync_sgtable_for_cpu(dma_dev, uvc_urb->sgt, DMA_FROM_DEVICE); > invalidate_kernel_vmap_range(uvc_urb->buffer, > uvc_urb->stream->urb_size ); > } Yes. Right now we don't have a proper state machine for the *_kernel_vmap_range, but we should probably add one once usage of this grows. Until then I need to respin my API patch to document how callers need to use *_kernel_vmap_range, as well as adding the so far missing dma-debug support. As we're getting toward the end of the merge window I'll try to get this done ASAP. How should we plan to merge this code? Do you have a tree you'd like to pick up the whole thing for? Or should I create a dma-mapping tree branch that can be pulled in?