Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1779025rwb; Thu, 17 Nov 2022 01:42:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf6HCkmdCol4O5xcItlfgwhMhGV71A/HMnbn51oTe2YotVunRrBjZFEDPVPa2NX+q9uubSay X-Received: by 2002:a50:fa83:0:b0:461:565e:8779 with SMTP id w3-20020a50fa83000000b00461565e8779mr1427378edr.387.1668678142719; Thu, 17 Nov 2022 01:42:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668678142; cv=none; d=google.com; s=arc-20160816; b=W3OLRwKpuZ6BR4eBgyn9Q4urgRZfMyFrG00jeRKlLJHZeRF/Zm2zgbB/oFgVVOgPhE juNCFekBOZ+V6RPfXjTd+ve2plTBvpOZhQtqhDkvwAvqBSkvF+j3321xN86WmkjqfaQZ azmsJB6TXEh9R3OcMn+Wyv2eiDjhTKI29BUmvomyrARZEOGUxpSPf+LorFa5MFsLix/1 gpfTDbstF1OO3zzEgKdXWZIF0NWsNK64VyaL0b9stLONRcT1mXW6LWdGpAED3WlU/6x6 9LCQLej9QEQ8L0+usgyZt3eHAupok+6ggpxDxXloxJXq6yltGSSJQPVvzHVvJSFFKKBo Cdww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Oslu0Pj8sz8Ci9LachaV9uA0UKMe/XE6voPlYdvS6+4=; b=p+8q7bndXzB+lDXM+NHHKWjNVCV4xj62psDyNzP0VUD8sXqJWGk0lN9v7PD+4BQ5Tz qo62giVRb2o8tFc0GKXi3iayeQ6dmd96LocvgeddA7EJCtOS/yIuMzjcrvbbNleX5w2H NZfD5DqB+lmSeQIj4iuHzLh5Y7i7HATVyvchlVdFXvFnlAW+b531PrGhiA6hA8+9eh0f YcSE/7Y4zTkxnQfSJYvCq8tPIlad71cpy3pz80XKKsKcRlXM64v/eFvsVtinJo1TLkJ6 KE/Aa1Uip3JrGaJx1K4WaqZj4ZVQTbQLNtoaDbQVgHUfF3SxxQJA7vvqOE5HAy0xCxvo 6GUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=f6GwjHb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a1709063c4600b007123952b00dsi157947ejg.100.2022.11.17.01.41.58; Thu, 17 Nov 2022 01:42:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=f6GwjHb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239574AbiKQJE6 (ORCPT + 91 others); Thu, 17 Nov 2022 04:04:58 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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