Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1297371ybv; Thu, 6 Feb 2020 01:24:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzO6j1D0YhAHWWxWv8pakBNRn/X2uj5ONG3ZVtqUUkHF0U/IlCHL4Ce6XH+yixycrCRZhN7 X-Received: by 2002:aca:b2c5:: with SMTP id b188mr6295158oif.163.1580981099788; Thu, 06 Feb 2020 01:24:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580981099; cv=none; d=google.com; s=arc-20160816; b=OkJhQrTzb+kIdBz0F6GCKCc+ylWwNJKA/3MO7befekbRl7Gh77z85uhLgk/PKh5ZOQ gOCPngjh0WHIRIi9dJ89O82UElcIdG7nqD7wY1mT8DpmoMtEy6yIshumhcv/7GnAmLNM GmLoPX+ofrmgJSuGMCj6Bjidc1H4FYRFeeCC0Ff0+ehpIDYddqxEH/kivO2mxuAclZyg de7QB0kCZPsO3TPWqYw8FwJDIZRGmtkdMedgd4AKXifq5/pYqUhDh+veuzPlP/lyjmSz IJicoVvW1ebaU3ccjKyMr2tc1BhEVz6dOL3jj6mKKGxviwxnDKqGfVP1yEh7ddBpO9WA lW2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=We7DoVh7zLbEobTGikMeJVx0fJF9wa4d1jWsJYX+VpE=; b=ZNmNncFJomEt3n1Ef245IYT7BWxi37rbqTGiLfKm6hBVPTXmi93QZzBe+NzrWG/SrN eU/P//afz5oDJlWZP4bPoDL0Qb1+Mds+s8m5sJvERtL5uWd3eqgWwCpPk0wdO8ktg38x DP4eP5aotMUDoKi8Vto8Q4YVSCob2JTiMCKsE6Is30zlLfRQfSmLYSN5sL2sCHl2C8mL +D7Rz29TWYzly6wO3G9JxfHnuBYLxn5nTYlVfYw5uRahGIjVbmTnMcQfZbqBRxy+nVj4 0L7p3HK8GItfFzLrWX1qb5lh6JGycC2iBmFjfXSxbBeZWPeNIRZLKWzpwRKMFqpDsOo4 f9+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V53GVGtE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id i6si1494196oth.182.2020.02.06.01.24.47; Thu, 06 Feb 2020 01:24:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V53GVGtE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728064AbgBFIwE (ORCPT + 99 others); Thu, 6 Feb 2020 03:52:04 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34197 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbgBFIwE (ORCPT ); Thu, 6 Feb 2020 03:52:04 -0500 Received: by mail-ed1-f68.google.com with SMTP id r18so5099382edl.1 for ; Thu, 06 Feb 2020 00:52:03 -0800 (PST) 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=We7DoVh7zLbEobTGikMeJVx0fJF9wa4d1jWsJYX+VpE=; b=V53GVGtE+FiWi1Ic1qjEMrk3/vEvAhXyW5H0b0fxm+6774kxmE8OyeaawuPxs1gH4b c+0FT6j2HTkSaJT6uEthX7ZOUXERC0g8efQ01yJ78SbJsqPTMPOADs6e2eP5V0D4MgrQ 5mxhqpf+6HI1BZDpX71QwLwNyugqDu8duGIlY= 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=We7DoVh7zLbEobTGikMeJVx0fJF9wa4d1jWsJYX+VpE=; b=I4liVZHlrK4KlXghwW3FPz/NYZ6TzNX9k/AopkLewuHTpnEi1td/QET/JT8Dk0LLkr FMwJ4Fl+npUrRu62AE6DY3M+y/e1fXaBVbY5eM+OXsO2RvE2RcstsunBhi8k9flgyYDE b3r2lTZ45P9zGbjM/6rey8Ay14f1NSJsH0wyPTfwtPf+fPTig5pEp3GEZEMAIbFgKDoN mSf9MAOZtepGZDuPjygT55Vnz3iCe0QyOxwmTtYZ7gSise8jl/7pk2krvtQ6So2JOLI3 FVYqMABSTq3xablRRKaEfBYigHWRkLYGOayc/FrXY/y+8bgsVAEllF40CJq7K3yf6GqY MNqg== X-Gm-Message-State: APjAAAVdNpIphTkf9WjBg/IzsfRX2jyeiSQZ9Eeely11sNS0fFyRRjGA ot0ZGRFz5tkmkxA48jTriFq0j3XKg+1F0A== X-Received: by 2002:a05:6402:6cc:: with SMTP id n12mr2096523edy.344.1580979122353; Thu, 06 Feb 2020 00:52:02 -0800 (PST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com. [209.85.221.52]) by smtp.gmail.com with ESMTPSA id n11sm215998edv.66.2020.02.06.00.52.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Feb 2020 00:52:01 -0800 (PST) Received: by mail-wr1-f52.google.com with SMTP id m16so6071549wrx.11 for ; Thu, 06 Feb 2020 00:52:00 -0800 (PST) X-Received: by 2002:adf:f58a:: with SMTP id f10mr2727400wro.105.1580979119629; Thu, 06 Feb 2020 00:51:59 -0800 (PST) MIME-Version: 1.0 References: <20191217032034.54897-1-senozhatsky@chromium.org> <20191217032034.54897-13-senozhatsky@chromium.org> <1c5198dc-db4e-47d6-0d8b-259fbbb6372f@xs4all.nl> <560ba621-5396-1ea9-625e-a9f83622e052@xs4all.nl> <20200204025021.GF41358@google.com> In-Reply-To: <20200204025021.GF41358@google.com> From: Tomasz Figa Date: Thu, 6 Feb 2020 17:51:46 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 12/15] videobuf2: add begin/end cpu_access callbacks to dma-sg To: Sergey Senozhatsky Cc: Hans Verkuil , Hans Verkuil , Mauro Carvalho Chehab , Kyungmin Park , Marek Szyprowski , Sakari Ailus , Laurent Pinchart , Pawel Osciak , Linux Media Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 4, 2020 at 11:50 AM Sergey Senozhatsky wrote: > > On (20/02/03 19:04), Tomasz Figa wrote: > [..] > > > I very much agree with that. But this should be very clearly documented. > > > Should V4L2_CAP_MEMORY_NON_CONSISTENT always be set in this case? > > > > > > > Yes, IMHO that would make sense. My understanding is that currently > > the consistency of allocated memory is unspecified, so it can be > > either. With V4L2_FLAG_MEMORY_NON_CONSISTENT, the userspace can > > explicitly ask for inconsistent memory. > > > > Moreover, I'd vote for setting V4L2_CAP_MEMORY_NON_CONSISTENT when > > V4L2_FLAG_MEMORY_NON_CONSISTENT is guaranteed to return inconsistent > > memory to avoid "optional" features or "hints" without guaranteed > > behavior. > > Documentation/DMA-attributes.txt says the following > > DMA_ATTR_NON_CONSISTENT > ----------------------- > > DMA_ATTR_NON_CONSISTENT lets the platform to choose to return either > consistent or non-consistent memory as it sees fit. By using this API, > you are guaranteeing to the platform that you have all the correct and > necessary sync points for this memory in the driver. Good point. And I also realized that some platforms just have no way to make the memory inconsistent, because they may have hardware coherency. Then we need to keep it a hint only. Best regards, Tomasz