Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp949446lqm; Thu, 2 May 2024 00:02:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzUARCt8qdi6s/kRRCdEePGnEdhndOvobYn0UXRUFPErINAqDed0EvB0jyhiwGak2wnSqiRvCbv5FrAldF8XgYAgNW8cSYP6Ali84daw== X-Google-Smtp-Source: AGHT+IFTF28rT8FQem/POF5xGnv0RD939DJY+//LyWQSqwhawl8lERcbxT0iK18PlRYWBJ8YLZEf X-Received: by 2002:a05:6a21:2d8d:b0:1af:35fa:d0aa with SMTP id ty13-20020a056a212d8d00b001af35fad0aamr1368672pzb.43.1714633325901; Thu, 02 May 2024 00:02:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714633325; cv=pass; d=google.com; s=arc-20160816; b=NxNqzyeiwrgzt3iTc6IE6k/q6iCJmLwBzoJu6QUMT7GDyqB/F2Y+HFUVWHmlo/1AC6 Wb8Y0fV1XPzxG8+z/SC4ionkogFX4tl4EYWWEHZvQRGiY1vppBz2JJUToq8yZUCQx/FN vLY8VVYganI4ksSEiiOJE3/FKcajQB1/9bHbth3IhlBe7DSa4vBY6oMLMUd6IUB12Zra HnViMfBhh84o0B810NlLTfmlZFGzrDEqRITcGEURvmk6i+4xrvBfizvAszRcb5bgN19d H9f6/xhhpkuJBGrZ9894g64bNvdRoNZiZdcken15zaaGGVL/o1AwIAt9XG4fH9PaCchR XN9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=D99HRo5ilXyzSBholtqCDhgIV6YeXLR3vnijmdnrm3w=; fh=m1MQwVFo3zz4IMvhePJntG85uPowMRmwb53EbKyxFjY=; b=Yp11fMimPydSxsv4UsKGjcOFFtQNxGeDMwmubSPTTaNyiBZIoUU3J1yeV4a1KBqmtj Kk4fOrIgazsEhDkAK/f/JkpJe6kkCV7Z9WHlX0PR4yscE6joPwd0W/lVS8y9vDVWo+l8 rHwRJPrPCc6NVYu67yY0F2yv0OQy8rnar76zPH2MVGZEL6bVKdR4aKnVHlEPqPE7hNXV /b0+rO9tz7yQqVJ7oZSXh19HHD0X00wjLnaZhnRNpVRw1W0IoMXzpc4HPzutylnBK5wF DJztN1MUKoTIzrNO1rWeGIWjAzXiJlBzMYE9dSxjAY/88NTdFZ1WePhgLrUmB1ieimxP kbxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=FjEkK6MI; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-166030-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166030-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a20-20020a17090ae21400b002a85806f6e1si497341pjz.172.2024.05.02.00.02.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 00:02:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166030-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=FjEkK6MI; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-166030-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166030-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 98DCA2825C7 for ; Thu, 2 May 2024 07:02:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BB7821A04; Thu, 2 May 2024 07:01:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="FjEkK6MI" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC4131C6A1; Thu, 2 May 2024 07:01:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714633315; cv=none; b=UZqq3xwCmBBMZeZcC1IS22hYrp7hCL1wHmBGNYmM3QsYlCk07lcFnILQzsbLO2IhP/VR/+hjr1S9sGvSAKB3lxMj2tt1xmOvctLHXevebcLbPeLeitICBVEHe5xNklcqjid5kmWN48lKMh5oTGHGfgXl4Jetl0CJh5IL8C4A4X0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714633315; c=relaxed/simple; bh=ye0z1gvg/13+dE7aKuIpgiRz56aWOAjKJk0D7Jw1sUo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hVX+29GzROm7mVcwniXgmVR7+7vU4F++BJPj0qaCk2+B/3WuNRxH8UTm2SwACkWrEafWuc7HrIDQ8+8t4ZE8EX5ns2oogyBw+PGTqUYX2TMD2rQixlkhIQL+zCBGZaNKEhSjuSOVhriXFRCE/aOspmY2788NnKw1kaLvLfaC8u4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=FjEkK6MI; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1714633311; bh=ye0z1gvg/13+dE7aKuIpgiRz56aWOAjKJk0D7Jw1sUo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FjEkK6MIljTrW0uRzXQtKQ1y+L14noagP3H/HU6s67kg11Ms7psh0xBb+Uy8Vxp/0 m3W/xptTS4qVG6ogj0md1BNlSq/ovLmjiE28jRYKCpcBgPxZuXqnLJj7J3TbaD8cCK LcX3zoQNgKeOabzgC+q415bkgSvNDwGBf+Xs6EyP/sAwjw7Ch7m2c9OELBUWiWECNx SVRgHGQqDCS9w/740n9hXChe/oZbLvS2Ea33E7KRMKGAUoq0RObgbyVHGtJjNipn8d 6FYWxYhjaH0LOBfsOgj5VFcKhlbWA7Gd9rHqmNE9BAdIfgYEr6p7QpArQ3yDz+Muo6 KuN8lPAhZp5wA== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D4D2F378001E; Thu, 2 May 2024 07:01:50 +0000 (UTC) Date: Thu, 2 May 2024 09:01:49 +0200 From: Boris Brezillon To: =?UTF-8?B?QWRyacOhbg==?= Larumbe Cc: Qiang Yu , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Steven Price , Sumit Semwal , Christian Koenig= , Dmitry Osipenko , Zack Rusin , kernel@collabora.com, dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v3 2/2] drm/gem-shmem: Add import attachment warning to locked pin function Message-ID: <20240502090149.6b33817e@collabora.com> In-Reply-To: <20240501065650.2809530-3-adrian.larumbe@collabora.com> References: <20240501065650.2809530-1-adrian.larumbe@collabora.com> <20240501065650.2809530-3-adrian.larumbe@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 1 May 2024 07:56:00 +0100 Adri=C3=A1n Larumbe wrote: > Commit ec144244a43f ("drm/gem-shmem: Acquire reservation lock in GEM > pin/unpin callbacks") moved locking DRM object's dma reservation to > drm_gem_shmem_object_pin, and made drm_gem_shmem_pin_locked public, so we > need to make sure the non-NULL check warning is also added to the latter. >=20 > Signed-off-by: Adri=C3=A1n Larumbe > --- > drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm= _gem_shmem_helper.c > index 177773bcdbfd..ad5d9f704e15 100644 > --- a/drivers/gpu/drm/drm_gem_shmem_helper.c > +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c > @@ -233,6 +233,8 @@ int drm_gem_shmem_pin_locked(struct drm_gem_shmem_obj= ect *shmem) > =20 > dma_resv_assert_held(shmem->base.resv); > =20 > + drm_WARN_ON(shmem->base.dev, shmem->base.import_attach); If we add a WARN_ON() here, we can probably drop the one in drm_gem_shmem_pin(), and do the same for drm_gem_shmem_unpin[_locked]() to keep things consistent. > + > ret =3D drm_gem_shmem_get_pages(shmem); > =20 > return ret;