Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4508174ybl; Tue, 21 Jan 2020 22:38:36 -0800 (PST) X-Google-Smtp-Source: APXvYqw8x3j4AuNEea7PGZDl51J02q9a574W936twmP/uQEDnd3myD6B4Dx6sWhx/7EttOBgDMqm X-Received: by 2002:aca:be57:: with SMTP id o84mr5936486oif.138.1579675116331; Tue, 21 Jan 2020 22:38:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579675116; cv=none; d=google.com; s=arc-20160816; b=ao6+oZYFERiCugcsK6PcOIKzgvZ7WrlP8eiDxhszgKojUjt9OM6XFrDw+/wyo3Y0Rp uDM967eYZQT/wn+IavaRZm9yARUjm2y7Zk+OfnWeRpyH/9SmXKcRbnv4imFlXqW1X+OO K34TKIxlB2HAH2QvGYyACLT2RNMkEusFPKdgzM2fq0I8Gx8QvB9G6/VJxQUyy9ck+qGv VcaibC0m7SsNh0ktRQTP21YaAdLVC1AznMifx+hAX+ah+jQxyg5C06lcK9KxwUbQn7Pb +wAS2oCsbVyeOKlupehqPOOlROITcpcn+lHeFLU9+LnL5t1SEuuZd6TR9aLkoWLlblqG S77w== 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=7AXcKF6W8asLiClFXriJEBFPGRWX3uOGSn/zkbdHVsU=; b=ssF3AKxsetAJg+QQfKDNb3pROvucTabatwyQ2iQYECI12hy5rUpn8JlESMuVVQcJU6 vxbgyzbQkRG46wx3OLr40l45d4zZkl19sC5Ui1iQQsIaK+Kjs+g75yXFCRiXXCYXF82F hxiXnVWsqPO1Zsalxu8Ya40wEx1WaYZUTyeNcIWcF6TegrrvVZHgPnfqUW+OJeu+PQHh hcnPofG7cVrdIzXpxiSVrfVGd45HjIIFHJiz8/mhXxZGorLNleDEgzkDDVZ3/x7VVg50 Tw/RLTWGcb2BwVvY44vgxh4hB4NfCUVP1wZUQj05hvKkzLSeQ/KGFub7MmYH7/lIaK1I lRFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YILkfm0T; 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 q2si24061225oti.273.2020.01.21.22.38.24; Tue, 21 Jan 2020 22:38:36 -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=YILkfm0T; 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 S1726181AbgAVGhR (ORCPT + 99 others); Wed, 22 Jan 2020 01:37:17 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36479 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbgAVGhR (ORCPT ); Wed, 22 Jan 2020 01:37:17 -0500 Received: by mail-pg1-f195.google.com with SMTP id k3so2929539pgc.3 for ; Tue, 21 Jan 2020 22:37:17 -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=7AXcKF6W8asLiClFXriJEBFPGRWX3uOGSn/zkbdHVsU=; b=YILkfm0TuU5vkyLd8nIqBpXHopTRzgWr2SZQipfwrFiezbx0jrz9MRs4EVDQQe3sRu huwpVi9oNtyYwMeVWc8XbUvBIua5mYWXdUBJ3YibtNYf+iOEhbbW27p1/kGr2QOAG0YG IkN9GgHGnY3Kf1WLSxIphLSKL1Nog1G7+A+sk= 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=7AXcKF6W8asLiClFXriJEBFPGRWX3uOGSn/zkbdHVsU=; b=PwXjW7qM57ZTtrlPGIlpftRqx/diuKMLRUACJ7BbNmALDdZ6ZHUtN2Se7sCpQXJjrR ECnO/GAgecSmj1nJ0LRGYh4FDQZa08gCVEnXe5oef3A8g6kyEFmEeazME/wWA72Vmw91 J7CSJ1boqNBc+2kO8lX1fl15bf/TPVtUF9jwtd/ALegaHSlS7DsDQP/0WCR0CnatpJNr +TET9dQekyR+gmaeYP02uzJGBQ1+ZawwiS29DLp8B96lo+BnvNCN7L4+NevrIAFUXvVR 8KYNd9zC9WDiNraeL+QS5AleDYsqe39sbbVgcuaysYU21goH9W/8gMKnkppmZhU+gC7C XAfg== X-Gm-Message-State: APjAAAW1cs1ZeDxtZn3hM9g7uan4zYmTFWzU5bQjQ7rLWIN4e4rZ66s/ q7QzbGS46fTwyGkLimuiivQS4A== X-Received: by 2002:a65:4d0b:: with SMTP id i11mr10025106pgt.340.1579675036728; Tue, 21 Jan 2020 22:37:16 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id i9sm46704101pfk.24.2020.01.21.22.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 22:37:15 -0800 (PST) Date: Wed, 22 Jan 2020 15:37:14 +0900 From: Sergey Senozhatsky To: Hans Verkuil Cc: Sergey Senozhatsky , Hans Verkuil , Tomasz Figa , Mauro Carvalho Chehab , Kyungmin Park , Marek Szyprowski , Sakari Ailus , Laurent Pinchart , Pawel Osciak , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 12/15] videobuf2: add begin/end cpu_access callbacks to dma-sg Message-ID: <20200122063714.GA14881@google.com> References: <20191217032034.54897-1-senozhatsky@chromium.org> <20191217032034.54897-13-senozhatsky@chromium.org> <1c5198dc-db4e-47d6-0d8b-259fbbb6372f@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c5198dc-db4e-47d6-0d8b-259fbbb6372f@xs4all.nl> 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/01/10 11:13), Hans Verkuil wrote: > On 12/17/19 4:20 AM, Sergey Senozhatsky wrote: > > Provide begin_cpu_access() and end_cpu_access() dma_buf_ops > > callbacks for cache synchronisation on exported buffers. > > > > Signed-off-by: Sergey Senozhatsky > > --- > > .../media/common/videobuf2/videobuf2-dma-sg.c | 22 +++++++++++++++++++ > > 1 file changed, 22 insertions(+) > > > > diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c > > index 6db60e9d5183..bfc99a0cb7b9 100644 > > --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c > > +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c > > @@ -470,6 +470,26 @@ static void vb2_dma_sg_dmabuf_ops_release(struct dma_buf *dbuf) > > vb2_dma_sg_put(dbuf->priv); > > } > > > > There is no corresponding vb2_sg_buffer_consistent function here. > > Looking more closely I see that vb2_dma_sg_alloc doesn't pass the dma_attrs > argument to dma_map_sg_attrs, thus V4L2_FLAG_MEMORY_NON_CONSISTENT has no > effect on dma-sg buffers. > > Is there a reason why dma_attrs isn't passed on to dma_map_sg_attrs()? Laziness. > I suspect it was just laziness in the past, and that it should be wired > up, just as for dma-contig. OK, I can include it into v2. -ss