From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 796C5C433FE for ; Thu, 17 Nov 2022 09:04:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239564AbiKQJE5 (ORCPT ); Thu, 17 Nov 2022 04:04:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239691AbiKQJEr (ORCPT ); Thu, 17 Nov 2022 04:04:47 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92BA15A6DD; Thu, 17 Nov 2022 01:04:41 -0800 (PST) Received: from [192.168.2.32] (109-252-117-140.nat.spd-mgts.ru [109.252.117.140]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id CCB366602A93; Thu, 17 Nov 2022 09:04:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668675879; bh=myO5od7Hy8GIA7LiyC3cxVd6NrDXoa1PiKxCCo4rsOo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=f6GwjHb6vzocRth+JNvAYc2pN8BmnjT1HIKyO0WpgXx0Uzfz5r4DBLdklSRwEIePh 4myD3frJhoPsIahlC8nDpTtKTT5NZQ4UNzVLi9RLQaDJa7XNsOxvu1PumSaX65lip7 0M82mlguMT/WwH7yR/NzfW/t2igHJuUxZI8h+HJ82kS+re66fLRFj8Asx5N87kwvKy yS18Cz8SVgiWwKIIHculrfu1KFzjZSILxXE7SBNCITGQN+c4DA12kz1O6Jl2KzKb3p xGfWwmyWKz41NjDbDLB1Cbnk4l2NFLeZ+ME2tGPIMJuB4Arx6sZAv3trwRfDxqkfm9 8IbSUfkmwLV5g== Message-ID: <970e798d-ea26-5e1e-ace8-7915a866f7c7@collabora.com> Date: Thu, 17 Nov 2022 12:04:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v4] udmabuf: add vmap and vunmap methods to udmabuf_ops Content-Language: en-US To: Lukasz Wiecaszek , Gerd Hoffmann Cc: Lukasz Wiecaszek , Sumit Semwal , =?UTF-8?Q?Christian_K=c3=b6nig?= , dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org References: <20221117045842.27161-1-lukasz.wiecaszek@gmail.com> From: Dmitry Osipenko In-Reply-To: <20221117045842.27161-1-lukasz.wiecaszek@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi, On 11/17/22 07:58, Lukasz Wiecaszek wrote: > The reason behind that patch is associated with videobuf2 subsystem > (or more genrally with v4l2 framework) and user created > dma buffers (udmabuf). In some circumstances > when dealing with V4L2_MEMORY_DMABUF buffers videobuf2 subsystem > wants to use dma_buf_vmap() method on the attached dma buffer. > As udmabuf does not have .vmap operation implemented, > such dma_buf_vmap() natually fails. > > videobuf2_common: __vb2_queue_alloc: allocated 3 buffers, 1 plane(s) each > videobuf2_common: __prepare_dmabuf: buffer for plane 0 changed > videobuf2_common: __prepare_dmabuf: failed to map dmabuf for plane 0 > videobuf2_common: __buf_prepare: buffer preparation failed: -14 > > The patch itself seems to be strighforward. > It adds implementation of .vmap and .vunmap methods > to 'struct dma_buf_ops udmabuf_ops'. > .vmap method itself uses vm_map_ram() to map pages linearly > into the kernel virtual address space. > .vunmap removes mapping created earlier by .vmap. > All locking and 'vmapping counting' is done in dma_buf.c > so it seems to be redundant/unnecessary in .vmap/.vunmap. > > Signed-off-by: Lukasz Wiecaszek If new patch version doesn't contain significant changes and you got acks/reviews for the previous version, then you should add the given acked-by and reviewed-by tags to the commit message by yourself. -- Best regards, Dmitry