Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3949756pxb; Mon, 1 Feb 2021 08:39:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjKBsy+4gSKBpIEi9KUCWQdQTETKQ8osTaVudLbk+r6lTeKrNgjL+T/X3wfu6G7KNcUjR+ X-Received: by 2002:a17:907:3e1b:: with SMTP id hp27mr17852030ejc.506.1612197584322; Mon, 01 Feb 2021 08:39:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612197584; cv=none; d=google.com; s=arc-20160816; b=LD/TTfJBSxGp48M+rsdjokXpHavQ7awvxFkGgGqmh09dVHNUmbF5v67Dzdv0srNUNl wXNs3gViY1OjfLcDxenauPZKKgsoNiL7pTf4JNYIaC98+Drt3QuKfNjA32Ru0tk1RJRA TNxoEO6jN3mIbl/nCitxK48c3P3D5NNKMXkvrqzXK903S7hu9awxTQl2V1mTC0GfRZue 6PQhLtbb7oXBulBnIf/pDu9/8DrpSo0yofFTq3KrtqKioHOKoifEMhn6clM/CnIR7KOb EL0dSjfHTT6LHeUwqDtu/sL92n1cPQ/TEm+7JTbCrEIW7hF1HfmmPluSpNpZ3nKYIFkB QolA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=PfzWel+HIgMTJVCfraHqn9jh0O9dOuf4aKzUEvSP+ms=; b=lVgth8Z6CTjsZStLyB1tTjSKKvK9y6L2VXD2SvMwfnCKneUKTDbUXQl6Jl7+b/yNDp E8bkTDSTFsiEAnnYCiMtUliJsoxYdYrf0lnv9+RMnz9ewCk9N0pcMAx5IC+0U6C3TDRI M8fkm8yM2JXRTHkopMPRD099kkIAG8j1jOJHJZlkwy0fQqHf6aULrAr3iichi1SpJSOG TY6zRiOhvnmhRhQ+nqyIy4S0csR9ugjzbk8G4sjfigd52rd+jjqPhiAqRxEe/acRRXDt oV99f8HIgxtCZGBq/dGhTkwkZSFU95OxelKo493HSOOFmSIzCZHn4royoUiDMn4Db4nD RqcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si889059edq.484.2021.02.01.08.39.18; Mon, 01 Feb 2021 08:39:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230355AbhBAQiL (ORCPT + 99 others); Mon, 1 Feb 2021 11:38:11 -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?