Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1062021pxb; Thu, 28 Jan 2021 07:13:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHWSwBz30wJh4Wr922Qi+RoqvL0yXoUr73YE2o9kmE2/wVegmqPKyHui36+7ipC4JXOIOy X-Received: by 2002:a50:e8c1:: with SMTP id l1mr12318776edn.168.1611846798711; Thu, 28 Jan 2021 07:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611846798; cv=none; d=google.com; s=arc-20160816; b=YApdTgp0WzIn1fjWQPklM+FzT7eHcglPd1vnz+j/rLR71YQ4T9qFVJcCEKw1v8LtDK iA+iAm/0f+xmWHqs5gQAuy57GvXDjFxFiN8XhsxUPGfyvauBMSYnV+kk0+itUBxUdBiQ L7gZjuh2Dh5fHNOy8F5qli4HoSS80H0X4qgwPBhOCVZqmudCJ2wMTU+QfaG3M6eNpQ6x T6mDPWd6mohunqpERkT1o2RgglcZ7eRa2yG0sHnAFVVICKbq0Qa3OaBEZpTsVaGy8j/6 7AhQO4kUxa0xstkjJEoEQFto5HDZ/g2dSQEUfWm/jF2S0WRbdLs1gwpzjzQMmhtP1OTx 1S9w== 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=d8/fuRwbkoDImINQhBByOIZpWtAEvKsB3DF96T3j3g8=; b=gW9ErVdMoAw4AIq7MN3lJtx6fhW/BkxEHyLZH4jYN7poVJ0GopYOcP0y2xk6zPUWYa gz3sCfIk1ZhMnSzCBdZY/qYy1bz66+G1033JA60s8zT/yIOKhNEDzNpDXyxBocWGlsCe 99D3r3YD4zlJl1OZ/Vn1O1bGY4pTxVZBikmqtAbUsJnpeTZbHzj1nEezn/8MOlptsGm6 Phax2d+bYAGCeQA07pst+U4YIWBN2GekM/sH7Dnll2RnOj6G7xfZRHhMSdD4lzWAJfLi +M/2WnGXhJLH3l0nu51z7fRURtNlkPxazm7hc2pq5e+8c+Ltxrc8FkB2fSB63Q56kyZf Ts3g== 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 gn20si2746072ejc.578.2021.01.28.07.12.53; Thu, 28 Jan 2021 07:13:18 -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 S232178AbhA1PL2 (ORCPT + 99 others); Thu, 28 Jan 2021 10:11:28 -0500 Received: from verein.lst.de ([213.95.11.211]:57690 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbhA1PKk (ORCPT ); Thu, 28 Jan 2021 10:10:40 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 4C75668AFE; Thu, 28 Jan 2021 16:09:55 +0100 (CET) Date: Thu, 28 Jan 2021 16:09:55 +0100 From: Christoph Hellwig To: Mauro Carvalho Chehab , Marek Szyprowski , Tomasz Figa , Ricardo Ribalda , Sergey Senozhatsky , iommu@lists.linux-foundation.org Cc: linux-media@vger.kernel.org, Robin Murphy , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API Message-ID: <20210128150955.GA30563@lst.de> References: <20210128145837.2250561-1-hch@lst.de> <20210128145837.2250561-7-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210128145837.2250561-7-hch@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I just included this patch as-is, but here are a few comments: On Thu, Jan 28, 2021 at 03:58:37PM +0100, Christoph Hellwig wrote: > +static void uvc_urb_dma_sync(struct uvc_urb *uvc_urb, bool for_device) > +{ > + struct device *dma_dev = dma_dev = stream_to_dmadev(uvc_urb->stream); > + > + if (for_device) > + dma_sync_sgtable_for_device(dma_dev, uvc_urb->sgt, > + DMA_FROM_DEVICE); > + else > + dma_sync_sgtable_for_cpu(dma_dev, uvc_urb->sgt, > + DMA_FROM_DEVICE); > +} Given that we vmap the addresses this also needs flush_kernel_vmap_range / invalidate_kernel_vmap_range calls for VIVT architectures.