Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4428302ybl; Mon, 3 Feb 2020 18:51:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwD7TescEz+/S6hvvT+lfqYUbXOAFirKqjB4jVAnRJwGaBJcdfJU0xTSnPBOtHswYxdmm+l X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr19977863otc.337.1580784690430; Mon, 03 Feb 2020 18:51:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580784690; cv=none; d=google.com; s=arc-20160816; b=ng6fUeYnQKgLc4ssmixxCRMb7TCnkO4ScxrxRR/7tQFTeRPRIOCFPvk3xZgmFf5U+/ O1EgV3f+f27fMstTYm7u4e6qAVcFmBAnilhHq9VeJ5ibcOAY66tGFMlJcgAoiIact61n vawMFPkLiQcltVg7kj8lLLWgoW2YZZwhnWNlJjdCjGdaD4XN3ox2312CUSIo2YD+Hc9z CWe07edZX0LEunT82DSYFFMAWv7sy0+UKbk0yPaYEtARjAoBKId/FybOG2/N/8j7Dq7Q XT+myG2SJADxovn4o7jxco8Czu26gruvl013sUWMDXxVUweWUwYHkHHlJms77hQ2kdPv CsQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SIPb87j1x52DpZAA2dXWxz9TdyllVrxg7vta0P2dsgQ=; b=L8md3ZPnPvV904T6E3qEaXdAFsldMouZ2J7Ujv2B0ff93dxvDcPs5lUS3EJTBmgJuA 9SDg0jhZwVj+vReYwgAlmc9jUUEh/9bCgftq+QrW1KRkFMCJuz0hzEOHJ4x95NvDH7hq dygEZd6ADYKuTshuxnJPc894qQ8HL8ttvxkuEX5CzeLvvuB2KZWC+E6vSDLW7HyKJRJo P5k/rDedp+N1LW+726uBX3hVdWXesD7OCZLdBGa/FFsBLWzUhSF3LGEbpEmF15k8k7LJ nzu9tLta1HqKAT5vxDNUzBSnoHDafBAuM7M98evp01r50x4CiWeiRb7KI4e/5pyFmxX2 ZgyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GjTFy4PX; 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 h21si11213451otk.196.2020.02.03.18.51.17; Mon, 03 Feb 2020 18:51:30 -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=GjTFy4PX; 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 S1727015AbgBDCuZ (ORCPT + 99 others); Mon, 3 Feb 2020 21:50:25 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:53864 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726924AbgBDCuY (ORCPT ); Mon, 3 Feb 2020 21:50:24 -0500 Received: by mail-pj1-f67.google.com with SMTP id n96so676590pjc.3 for ; Mon, 03 Feb 2020 18:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SIPb87j1x52DpZAA2dXWxz9TdyllVrxg7vta0P2dsgQ=; b=GjTFy4PXP77tBt3f62/r618RgWIPd4s3gK9eoOMnIMN3eZZjMiQVJNAMaiDepHdQjY 9cNUAoU9LEpMNiYuHvSsPEj3utzgeztTXwF+blSAwre6pwBqspmd3Ef9fqSXwA9TS1GS K3i6XA/D0eczxbWXKaKxy9y2xdfl8f7ZXBr18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SIPb87j1x52DpZAA2dXWxz9TdyllVrxg7vta0P2dsgQ=; b=QQ6FFKemeyUSFY/iT6/Qd/1//1s0VyV04tRonWw1eT6/v4NpXPNEyn9K0C2KUM0rO4 4zmjZpUK/NFo7haReESinVPPyWZukHKvQDJsl0s1orzNTaUgWOS25WYHIJkEzFQbn0id GALltnVpHt5o/Q/bDsCVfwmH10cLi7ru8oRCII5rSKXZY1VeOEOGsH2cmARzYg2Zu5XW mSuqXDZ8RLo+uXz+oKEakE3W4W4p5bmzvfQrc6bYpjFcnG4y7nrn/INWPTUyX4bzMTsN On+w6EwjDEPqSLSzrARUNxJ0/y6OX1zO6uQjrf1AamLa+vkEFQC1T5nZkHyUgW8mQrEc tDCA== X-Gm-Message-State: APjAAAV8FYnLcoHuN0s/VWtgXfSrG8qIGf3/EAGlTX+MY5tf24YOQnoc r7+DeH4NIJQMKPFk8iHMDLq0bw== X-Received: by 2002:a17:902:864a:: with SMTP id y10mr27112565plt.2.1580784624133; Mon, 03 Feb 2020 18:50:24 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id z30sm23150340pfq.154.2020.02.03.18.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 18:50:23 -0800 (PST) Date: Tue, 4 Feb 2020 11:50:21 +0900 From: Sergey Senozhatsky To: Tomasz Figa Cc: Hans Verkuil , Sergey Senozhatsky , Hans Verkuil , Mauro Carvalho Chehab , Kyungmin Park , Marek Szyprowski , Sakari Ailus , Laurent Pinchart , Pawel Osciak , Linux Media Mailing List , Linux Kernel Mailing List Subject: Re: [RFC][PATCH 12/15] videobuf2: add begin/end cpu_access callbacks to dma-sg Message-ID: <20200204025021.GF41358@google.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -ss