Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3888567pxu; Wed, 9 Dec 2020 03:16:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxf26TN6OqTU/Hn7dWqICQQXqn008JJYcEM0ZnuhHTieaZq6qAZSpVedkv7vd+OJ0dIym7x X-Received: by 2002:aa7:c919:: with SMTP id b25mr1470522edt.108.1607512587210; Wed, 09 Dec 2020 03:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607512587; cv=none; d=google.com; s=arc-20160816; b=Y2A+TcDnWWRprqpmyNp+/uuOwVJk14d4YNCtYzvt+JKw4rAkvHOC0aX1H813zQfB10 ajhVAut8UNJZbhEoQPxtINoCuNSzTRZLcTB33EOYuRkaJIZtovcPt6hEzE0RtZ0KKu9X GQrrVhfnjnW41yqA9hDRoS7XjQ7ic03+Qu0LTr+hltljfylF4IKPDJaGVPF97QAvpKqs XLoUer6olpckqClPEBB+9+G8L9EDciKW99hVTNo8Rw3bBvLryXbzODCVBcH4r5FeX7x8 gKsIRHTZ19P69QC/eY9myY1R7g7sU1kredWHEp81dltSft1UVDoq9FfnrzujltWwEF7s c/5A== 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=DafYQzIwXIwFZgHg1sYUus6k3vvu7i607TlfHVYqelI=; b=SuTb9QQ6t7WG3L9qv4aYy4VgwFebb6xpRjwxJ6V63a6a/fCxTosUXHc6p0UuUi/z8g nHvfw27k7HsFGIyzHNv0LYWeWVPeq6+FiaS0XVGo9+AXSyrdPOzXpaX6UWzHPsXBk0AX favdtr7j/niwPYel0nVl3KfaJsUdRD+PnaFL/FXXVKYdGh8e5qf4BkHAnzJzg6Kq2nbh Dp1G27x0lffk/GtEvtdHmwz6AUAxONu5rv48Ntx4/qfMysWoE25K0lhsdgf7AQT26Ih6 tBoQ2X4Bf/urEYzQ523YCthdouJlvCfWT4S2xaTJj2hM45RZ6EpuUhRxwtQiH+cTCQu3 uooQ== 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 g1si592744ejf.377.2020.12.09.03.16.04; Wed, 09 Dec 2020 03:16:27 -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 S1730113AbgLILNT (ORCPT + 99 others); Wed, 9 Dec 2020 06:13:19 -0500 Received: from verein.lst.de ([213.95.11.211]:49749 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729807AbgLILNS (ORCPT ); Wed, 9 Dec 2020 06:13:18 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 51AA868AFE; Wed, 9 Dec 2020 12:12:35 +0100 (CET) Date: Wed, 9 Dec 2020 12:12:35 +0100 From: Christoph Hellwig To: Tomasz Figa Cc: Christoph Hellwig , Sergey Senozhatsky , Ricardo Ribalda , Marek Szyprowski , Robin Murphy , Mauro Carvalho Chehab , IOMMU DRIVERS , Joerg Roedel , Linux Doc Mailing List , Linux Kernel Mailing List , Linux Media Mailing List , Sergey Senozhatsky Subject: Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API Message-ID: <20201209111235.GA22806@lst.de> References: <20201125221917.150463-1-ribalda@chromium.org> <20201130083410.GD32234@lst.de> <20201201033658.GE3723071@google.com> <20201201144916.GA14682@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 Tue, Dec 08, 2020 at 01:54:00PM +0900, Tomasz Figa wrote: > >From the media perspective, it would be good to have the vmap > optional, similarly to the DMA_ATTR_NO_KERNEL_MAPPING attribute for > coherent allocations. Actually, in the media drivers, the need to have > a kernel mapping of the DMA buffers corresponds to a minority of the > drivers. Most of them only need to map them to the userspace. > > Nevertheless, that minority actually happens to be quite widely used, > e.g. the uvcvideo driver, so we can't go to the other extreme and just > drop the vmap at all. My main problem is that the DMA_ATTR_NO_KERNEL_MAPPING makes a mess of an API. I'd much rather have low-level API that returns the discontiguous allocations and another one that vmaps them rather than starting to overload arguments like in dma_alloc_attrs with DMA_ATTR_NO_KERNEL_MAPPING. > > In any case, Sergey is going to share a preliminary patch on how the > current API would be used in the V4L2 videobuf2 framework. That should > give us more input on how such a helper could look. Awesome!