Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1146408pxj; Fri, 18 Jun 2021 00:06:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH9tjDPmSUS1JDfLZM9kbGjOdymPDrNMd7ooYtZorqtLUbtXyWJO9acq0qpxgFIyHqhXlL X-Received: by 2002:a05:6e02:1aa9:: with SMTP id l9mr5647220ilv.185.1623999997453; Fri, 18 Jun 2021 00:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623999997; cv=none; d=google.com; s=arc-20160816; b=RQguaHfOskgI/wgPXgVa3+Q/z4eyKi9kshFGY2U6XqGL+W7hiGlsMqa3zV87xj9t3Z PU0J0JUX2SE5n1KzAQF7rkDUbcmxe8g15mAJItJGbL2WELBy9HLO+HSk/oclA29vtnON x3P7Jhb0ls7PtyT5GR14jvO+hZ0DWp9kMhmnwg47MDTixk/FCverOD32xVV5tfWDsr0d J7sf4EZqqBrV7j1viu1HrtXioUx3tb/tofEfJn3/AJqXhu+UxyfDVAWTx4zXWm8FAJKj bhdcjuQAoHDrqt/iY4LmBpwO8wgfWuZlL7/WfSkFr/zz5XawRZuiFIcKsbxurp2jAFgl tPlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6aJ7JLNwP8uQqbzACgqcuvU9N5foWZsWndyEyLlqRCY=; b=rWRkGR7K7GrCcoo1Xd07ihjhbc35jF4vV2FvsDfXAxuEFzedIle9pUZrSYVlMNooWr tvj9lAoocWDv2+M4rLQvzhk5K73KFP7rE6yJGdE/8zJTbGVBjrVrgcJVd040wuvq1Z4p q/ImY/iATJugmGJ3owXeypD5H+FxJQYBylDerG8d8R6x/ELA0yr/9OcHIHePPOEB343b IXRJ5ceKWW0lCwoL0+M1hO1sP8nANXY+a9Bo7Kz+erIlYj8lK41ysreH8rayRoaaOuj7 HqeKk9cy2/fXEMtmqAd2z6GvdqIeJjntfD0waKTMwA+HpqPSzWCwxPsPjJhYkO9S466E BzZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Bs1lVn/F"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si9333575iow.61.2021.06.18.00.06.25; Fri, 18 Jun 2021 00:06:37 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b="Bs1lVn/F"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231760AbhFRDX7 (ORCPT + 99 others); Thu, 17 Jun 2021 23:23:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230484AbhFRDX6 (ORCPT ); Thu, 17 Jun 2021 23:23:58 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EFF1C061574 for ; Thu, 17 Jun 2021 20:21:48 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id d7so6672070edx.0 for ; Thu, 17 Jun 2021 20:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6aJ7JLNwP8uQqbzACgqcuvU9N5foWZsWndyEyLlqRCY=; b=Bs1lVn/Fv7HQ1gsS939rabvK+bgf5OnBx3+M7rkEyVztWkpe3oLTsa8T3TpZ6VCOil FuB2/gbtM56yMReJ5wFMl/eXIAK1Vx5BOp+s8bekj51rQ47Dgv4UOa8M8/pgCG/wCdpG ndNqRM2AFGTW82VnxFJdle/ZOI8IF+k6V6D10= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6aJ7JLNwP8uQqbzACgqcuvU9N5foWZsWndyEyLlqRCY=; b=t9O4gP4gbV3oGIPm0IYup/8q/k6YhbDjDFtDkYjAnUwLPGVNP7c0A3lwxqKzrh0k0G OfLEyQLIHfwVv8PoTZ6YFeBpjfim3jus+p3gFpfYX7XnGI8TKTNeJSs/RDlLgiOIMWP5 2r4kfsCqk/5CaWTR6ZQMZ+dzcvdiMbo1rd7YIkIDceeU8wZhACBRewWx7Xqk2U65Hc25 5K5wFfpQzvxdlUiJeqZuB5kKV1O3bGEQMLbGTfEWHEUXzrSah6Rswm0hRVGaynoCOn1U dIIq5NptLHRK0+mLJ61lKb6qtsjkKewvOssG1+b85aZxl3vSh1udLBjNt1DSeFbaVc7D H8qQ== X-Gm-Message-State: AOAM5305Q0fBN8m7NRr+o7gywVzyoSAoShqaH9bZM6zYajJNiR4h4PWo notub+ms0jl8yUOiMHQXvNGqhttE8BeNJA== X-Received: by 2002:aa7:dd5a:: with SMTP id o26mr1968657edw.277.1623986506698; Thu, 17 Jun 2021 20:21:46 -0700 (PDT) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com. [209.85.221.52]) by smtp.gmail.com with ESMTPSA id d22sm443845ejj.47.2021.06.17.20.21.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Jun 2021 20:21:46 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id c5so9002121wrq.9 for ; Thu, 17 Jun 2021 20:21:45 -0700 (PDT) X-Received: by 2002:a5d:4f08:: with SMTP id c8mr9725940wru.197.1623986505267; Thu, 17 Jun 2021 20:21:45 -0700 (PDT) MIME-Version: 1.0 References: <20210427131344.139443-1-senozhatsky@chromium.org> <20210427131344.139443-9-senozhatsky@chromium.org> <10a0903a-e295-5cba-683a-1eb89a0804ed@xs4all.nl> <20210617080107.GA1422@lst.de> <20210617085233.GA4702@lst.de> <20210617100656.GA11107@lst.de> In-Reply-To: <20210617100656.GA11107@lst.de> From: Tomasz Figa Date: Fri, 18 Jun 2021 12:21:33 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHv2 8/8] videobuf2: handle non-contiguous DMA allocations To: Christoph Hellwig Cc: Sergey Senozhatsky , Hans Verkuil , Ricardo Ribalda , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 17, 2021 at 7:07 PM Christoph Hellwig wrote: > > On Thu, Jun 17, 2021 at 06:40:58PM +0900, Tomasz Figa wrote: > > Sorry, I meant dma_alloc_attrs() and yes, it's indeed a misnomer. Our > > use case basically has no need for the additional coherent mapping, so > > creation of it can be skipped to save some vmalloc space. (Yes, it > > probably only matters for 32-bit architectures.) > > Yes, that is the normal use case, and it is solved by using > dma_alloc_noncoherent or dma_alloc_noncontigous without the vmap > step. True, silly me. Probably not enough coffee at the time I was looking at it. With that, wouldn't it be possible to completely get rid of dma_alloc_{coherent,attrs}() and use dma_alloc_noncontiguous() + optional kernel and/or userspace mapping helper everywhere? (Possibly renaming it to something as simple as dma_alloc().