Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5108212rwb; Sun, 13 Nov 2022 22:05:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf6lEtbukZKqnPgMiIrxpSmeFC0xPVkUvUB3aWo4AexgLs/V0/oFaKTCYUY/hKhlaTV6G28V X-Received: by 2002:a17:90a:9a85:b0:213:e4:3f57 with SMTP id e5-20020a17090a9a8500b0021300e43f57mr11980449pjp.204.1668405917777; Sun, 13 Nov 2022 22:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668405917; cv=none; d=google.com; s=arc-20160816; b=o7JUiBkUOTOmFWTLmWHpIt0+JSzQYQ+Yzvt4b151C8igGsGsMM8EGb+Bx10UTFGxro jqJJTDcMlrdCyzy0lPtZlguKPEiNj9jSVV74LD8vJ48ObqGuYkcVuXo+VlXSnDT4yj4q 5iN7eo670aS/fEU2eUXdPJCvyIvXCR4Bn5HFci3h/oDlH6hMUb24NtdZYSAKOGy9Rt4A vIUnczrfFGeUEWNRLnX8lm+w0sgg5fSCNnukzLJWaWXmkprfNenczSYQ+u+CNyZdKkUx JxEzDPtP8+pXwUnOyu04+QWizvS8LHSUjErNmEoiT+swu5Gj3SHB4Ji3+5JX9l78HK5G lsLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=ShWkmDDgnIz8JEqHGHDUzJovR/KTvgrYk+MdmxwWEAI=; b=c7HMXd6ChawyX/FMlMau2RTe/4vpKyhxh/BYaucWymOeGi0CUJ8g90TdylmXIBMubR 34CPk3kIFuXJ1p4CDHsoJOZA13X2PvCNN3dLri0qrTitNnSWzgoyHXW9/A/dgVg/LXqv Zf/H066a7J6hVrXc9U30p+3CdVMrdQSywr4xOnFXVhtRT8VoWVKiiw2/SmZY3mF/82gs 7c/VDmHhgqn71s+ska4pVG8GwbYngb8bQtZTLjsJpoA6/5BEVmX+8yg++1We32X+1j2Q cZkshNE+phDjt+6knIrnioN4q5EcndxvapkGmNftty1bAd1x4sqaBWqxk9MrYR2eTds+ jRdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=M6oFjAb9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ip4-20020a17090b314400b00212e8cd5603si9683387pjb.114.2022.11.13.22.05.05; Sun, 13 Nov 2022 22:05:17 -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=@googlemail.com header.s=20210112 header.b=M6oFjAb9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235249AbiKNF3v (ORCPT + 89 others); Mon, 14 Nov 2022 00:29:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbiKNF3u (ORCPT ); Mon, 14 Nov 2022 00:29:50 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E26212D0E; Sun, 13 Nov 2022 21:29:49 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id j16so17521521lfe.12; Sun, 13 Nov 2022 21:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=ShWkmDDgnIz8JEqHGHDUzJovR/KTvgrYk+MdmxwWEAI=; b=M6oFjAb9H7upWMZ1gY9NJ/kc+g+erCu4WoGXXCT5lXPWnl/RXxHPBTyV1KLUAIHk/A Rh1Uu5LoghwGvCVeRw6EUkrnlIddm8KAzSiHZmjCvXNysfvrnd0qW6TX1wnYEj0+Ntg1 dMdGYWp12oCxRSDO9/tGsx7Ss9JIR5Ot2vM5zHDsYGR5kuiTHiJGcThUFil0RkgluNJe T6KHP0I9HC28qUedf9RlDsPxpzClAF20mdHbH+PTwn8hzN+CgKep+SNR+WgTHUhlvM2t AB/NU2n/Gd7pApevS+qZtZM+UtC6drf1StNYHKztiToLi01hC8obboH3EOyekflc0NxH FHCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ShWkmDDgnIz8JEqHGHDUzJovR/KTvgrYk+MdmxwWEAI=; b=nqmOyZuXaXyF7RINPXnXWZyN0x8diKZp0aPDRzJGjo6rJxBRQ9iCfG+rcXCSRSEs4H a3HsahI+neRz2sFoDASETXT60a/rffRy8MedL12/JHHcQ+m4Z6f629iShhMzUZn65J5u /Y/pCEUCGUueg2HB9lX5Fakr1q/dapYBcQcHzfdSGDLwI7NVc1HBgOEBha5g6o/me9CL TWlvl/Fk1MesE2Yn+1EH9Q2kUYEr8TQGvEwrxn/udr8Uc8Zh2Ye1yC7nIQyDFsboSU7W 70+LIP1nZd82jWi7bokmhcC8Vw3ySmksre9Utd3mOkZhtCLqRtacPZacyUJxSlCBTsc1 Fzsg== X-Gm-Message-State: ANoB5pm/yF4kAK6W73ycWJzuw60H9Cy5t1kjeRGkjWTwNP2D6zLkml+0 JG3snTB+HXSDkrkAzMgPo9A= X-Received: by 2002:a05:6512:3b0c:b0:4a0:13b:6618 with SMTP id f12-20020a0565123b0c00b004a0013b6618mr3442388lfv.15.1668403787592; Sun, 13 Nov 2022 21:29:47 -0800 (PST) Received: from thinkpad-p72 ([78.133.163.249]) by smtp.gmail.com with ESMTPSA id p7-20020a2eb107000000b0026de0c8098csm1853693ljl.26.2022.11.13.21.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 21:29:47 -0800 (PST) From: Lukasz Wiecaszek X-Google-Original-From: Lukasz Wiecaszek Date: Mon, 14 Nov 2022 06:29:44 +0100 To: Dmitry Osipenko Cc: Lukasz Wiecaszek , Gerd Hoffmann , kernel test robot , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] udmabuf: add vmap method to udmabuf_ops Message-ID: <20221114052944.GA7264@thinkpad-p72> References: <20221113150511.8878-1-lukasz.wiecaszek@gmail.com> <50cece73-a499-eba3-7018-9e92e0791c88@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50cece73-a499-eba3-7018-9e92e0791c88@collabora.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Sun, Nov 13, 2022 at 07:35:20PM +0300, Dmitry Osipenko wrote: > On 11/13/22 18:05, Lukasz Wiecaszek wrote: > > +static int vmap_udmabuf(struct dma_buf *buf, struct iosys_map *map) > > +{ > > + struct udmabuf *ubuf = buf->priv; > > + > > + if (!ubuf->vaddr) { > > + ubuf->vaddr = vm_map_ram(ubuf->pages, ubuf->pagecount, -1); > > + if (!ubuf->vaddr) > > + return -EINVAL; > > + } > > Create a new mapping on each vmap_udmabuf() and add the corresponding > vunmap. > > Otherwise persistent vmapping shall be released together with udmabuf. > It doesn't look that persistent vmapping is needed for udmabufs. > > -- > Best regards, > Dmitry Right. Thanks for review and remarks. Adding vunmap sounds reasonable to me. Will add it somehow this week. Regards, Lukasz