Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4052520rwb; Tue, 20 Sep 2022 08:11:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4bgPuj/8sxZewDcDwMC2Tiy09AYmT8Ti8hkEDv6HTwGwERV1n/zQ+dZl5UOyMtiFZy1YBH X-Received: by 2002:a17:906:7304:b0:6ff:a76:5b09 with SMTP id di4-20020a170906730400b006ff0a765b09mr17110195ejc.193.1663686695247; Tue, 20 Sep 2022 08:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663686695; cv=none; d=google.com; s=arc-20160816; b=0C78bv5LJqbM6xA35UJt54UBsWSgqTerZYs/HfI3k4fVIMcWlfzbF6zrQoefp12eRw 3lO6zps1jxipSj23o8ML6rhixa3+0iMGtHlE8Kd/c5Q+V8iVSBrw9bz2cpewgsqw1Xob 4nXfXLNSTdfY0hWYptnw/TUAIOy4rbmHgRxoZuNbJmtzNGaf4e/RYlGIoZNAsl0VpF7W 5bvQQ4ltHO2blWwauXO50MSCdW3DAbMpzHDdWRD7tQBCNCtJdXEqs+gzC3EK7XFuYugw fXBL+/uNPAq0mDmcJDKPnaf5YaVccC+asxiIl2E/BtJpKfWki78UPrkIgymDDyZbP/Xd pTWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=A5SHHtL7QW2l54muzkKKvK4LNnKVv9lnQOHGxIBuRuE=; b=NIrBjVWUUU/WYrc8HxV/+B8bU6cEn/3q/iAlYFj1+/mShiY20dzuawjZ+dWI98pgIb rheDO3Fw8zibbvpiF2HWD4yhN3snbbGrMlAlBeAb5qYqXPnXufZQxMz/fF0k4TW0QhhI E278FUl7BOE2OaMLGYA2MMTsO+FNyCTXGL2bh3YEoVc8dPt7Mxg/YsIom0okt9+vAzqn DWiwXQNZJscyzxcwPdh4mjkLfqhdbv9tyoiRcJP307yvQhYxRSbedOyTzLnAUiKufu0K 4TRRovqWCr8IN5rKsRVwxuVXrOT+GsDvqzHjgx1nt/VTGk2GJTffO1YolbT8QSBIkjXv 57nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I0YUoX79; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id uz29-20020a170907119d00b0077c6f26aa3bsi1484366ejb.656.2022.09.20.08.11.09; Tue, 20 Sep 2022 08:11:35 -0700 (PDT) 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=@linaro.org header.s=google header.b=I0YUoX79; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231576AbiITOQl (ORCPT + 99 others); Tue, 20 Sep 2022 10:16:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbiITOQT (ORCPT ); Tue, 20 Sep 2022 10:16:19 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF63E36869 for ; Tue, 20 Sep 2022 07:14:02 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id g5so3537944ybg.11 for ; Tue, 20 Sep 2022 07:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=A5SHHtL7QW2l54muzkKKvK4LNnKVv9lnQOHGxIBuRuE=; b=I0YUoX79VzdB1su5c8YsyhJqRmH5BNT4YqtIql7uMHjv4tNfOgHifd92qluReG4d/X i+jYW3HyitXzOX4IonS8R0ZONlFkR1k7gzgwSfoZiyoaclz0ttvaXwLoZb7ZtxANBu5Y 3z526ei+ptSUlr9B43I+BPqd8EpQylJ4cBJQM2NB3es8UnHI+rMDDmASlishpV745ZiR FmF+Tn/kij0Q3tHjPuP7PPUW7rGa0WojF+SdtI5DCR6jLM2zwity5aoAXKaUhJv2tGwk A1NAE6VKh7Q2gKgry+vltVNnOPdcodRj2m1ez7wQy3SuDN63Pt0F5Dl77GROsIrV6LU3 c7sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=A5SHHtL7QW2l54muzkKKvK4LNnKVv9lnQOHGxIBuRuE=; b=2S/CCcJ989B3Sf/9wIk5+e/V6f62FOCVNiOyPRpBWBFeHDBxweUmDm+N65PL2RJhgS 8zUW1HrmCvqiJY1ET3FU6I7xJJR0f39gsojU7MnvQaBV32endorh+qlbOVrKcsAZAJdz OCGXvvSJWXuGICXQHwxEH0CbwsxxPrwi/ZopW6xwtNMoV7KJ4v2ih8JqGVjh615Ei/Ov wBc7krqkeQOVICpTtuJ+HiF9BKceXpXD2z3bN1cyQaeZ1Z6jNM0lJ8W7NctbWgih8Rmg zChVll2gmbkJeZ9luGu3diXzjzx9Hbo4X5RakIgVLxa3gucjPfGrJTZ+kU6kP9YgzuyF hxxg== X-Gm-Message-State: ACrzQf0AhtOCfmYjPxgLFUpX5m9rGRqH59WolR9IQwMispSopZUQdZI3 P/LuxZGZ8BfAAH8jsacXhenm/oFSgyIcpqmT+oB44A== X-Received: by 2002:a25:af52:0:b0:6b3:de78:452a with SMTP id c18-20020a25af52000000b006b3de78452amr10092889ybj.157.1663683242012; Tue, 20 Sep 2022 07:14:02 -0700 (PDT) MIME-Version: 1.0 References: <20220913192757.37727-1-dmitry.osipenko@collabora.com> <20220913192757.37727-16-dmitry.osipenko@collabora.com> In-Reply-To: <20220913192757.37727-16-dmitry.osipenko@collabora.com> From: Sumit Semwal Date: Tue, 20 Sep 2022 19:43:49 +0530 Message-ID: Subject: Re: [PATCH v5 15/21] dma-buf: Move dma_buf_vmap() to dynamic locking specification To: Dmitry Osipenko Cc: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Clark , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , Qiang Yu , Srinivas Kandagatla , Amol Maheshwari , Jason Gunthorpe , Leon Romanovsky , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Tomi Valkeinen , Russell King , Lucas Stach , Christian Gmeiner , Ruhl Michael J , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Osipenko , linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernel@collabora.com, virtualization@lists.linux-foundation.org, linux-rdma@vger.kernel.org, linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Hi Dmitry, Thanks very much for the series. On Wed, 14 Sept 2022 at 00:59, Dmitry Osipenko wrote: > > Move dma_buf_vmap/vunmap_unlocked() functions to the dynamic locking > specification by asserting that the reservation lock is held. Thanks for the patch; just a minor nit - I think you mean dma_buf_vmap / vunmap() here, and not _unlocked? Best, Sumit. > > Acked-by: Christian K=C3=B6nig > Signed-off-by: Dmitry Osipenko > --- > drivers/dma-buf/dma-buf.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c > index 50db7571dc4b..80fd6ccc88c6 100644 > --- a/drivers/dma-buf/dma-buf.c > +++ b/drivers/dma-buf/dma-buf.c > @@ -1450,6 +1450,8 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct ios= ys_map *map) > if (WARN_ON(!dmabuf)) > return -EINVAL; > > + dma_resv_assert_held(dmabuf->resv); > + > if (!dmabuf->ops->vmap) > return -EINVAL; > > @@ -1510,6 +1512,8 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct = iosys_map *map) > if (WARN_ON(!dmabuf)) > return; > > + dma_resv_assert_held(dmabuf->resv); > + > BUG_ON(iosys_map_is_null(&dmabuf->vmap_ptr)); > BUG_ON(dmabuf->vmapping_counter =3D=3D 0); > BUG_ON(!iosys_map_is_equal(&dmabuf->vmap_ptr, map)); > -- > 2.37.3 > -- Thanks and regards, Sumit Semwal (he / him) Tech Lead - LCG, Vertical Technologies Linaro.org =E2=94=82 Open source software for ARM SoCs