Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp928112lqp; Thu, 23 May 2024 04:33:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUHXBDv8iDbB8qXcCS5SIs2ucRfuN89+2Rr42PaTI/HUvrdJ/EbPj6NtTpsKJpTJd7aEBLKPwi+wGk+1zZ+2RvP//OpNm/jJbpMq1t4uA== X-Google-Smtp-Source: AGHT+IEHEhIZ9zx86irIAHC/cVR4ygNnNH0E7U1fRs7bJ12ijEY4REWc2POxpiG0xDMZED9ad8hK X-Received: by 2002:a05:6214:5789:b0:6aa:2697:274b with SMTP id 6a1803df08f44-6ab7f09d36emr50670996d6.0.1716464009946; Thu, 23 May 2024 04:33:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716464009; cv=pass; d=google.com; s=arc-20160816; b=krhJwaochVFQvRtLVh3wccKJ23F9yXPp832R0RCyRDRUeupWb6j7LZaYXzqJUW383H hs3xx49VFIsYWN8+Kc82dDuh6sPtr11iDMrwnabwF1P0HwVnbceME06A7P+IqbfjgFsb Z8t0/wMneCir1LKSh+UxSMeQpxqDAtASXFzj9RTxzKel5oCLO1P0S1BbhWIjNS4Wgyf4 FVh5zyo4nSDY+tizI7FhVliDG5tP8ulu1WdOcmYEt9zzeVz/HmqjT5g4RHe4rfeb1I4F HYXHgQJdjHoc38a4q7EtWQ2ZMXcBJiS7u0MlEuTvznirAQIfv/FiPtL4FBX0u4kn8JK9 G83A== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HwIXDhHBsdICdwBhijtcsvVOSTBVibI1qHZax723hhY=; fh=Ghx6tcIzyVO5WF7aoLQ8kSAUDZ5XrKLfQq3Zu5A2d+E=; b=g3OpWVruyQtkjONm6x4TwfWTAuWDbu4FkQs6O/EPOXCoYeXfVCYlsX1bYsE344hDVi 5FiXmuasJA7mS12EKFXNaMVRcNFSmjEOoFUyBt736hxVJ3+0StVOrTH3QiXPIoGPReML OH49l+J9/OwCy7cfRwkOsN4SdZfgan4HYYGi/mDRga6Za3betzGb+3B/FSGy/5M5Rb7G QjpHPWUYEJJ84Ayw7t+j4NEV8nYRS0YGnsc/5viCndFLQWoK42EIHWQIjwTanesAuPgJ DfB+MLQM1aMjdBz5BdGowsV69HboZukkaLkRLJL7RVLIZCcGTG+NFTsdBPN6lP37fV+p 4f3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LNUJpLZP; 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-187403-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187403-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ab8edd8acdsi21786426d6.492.2024.05.23.04.33.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 04:33:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187403-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LNUJpLZP; 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-187403-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187403-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A1A481C20DE2 for ; Thu, 23 May 2024 11:33:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C489149C66; Thu, 23 May 2024 11:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="LNUJpLZP" 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 E839314830F; Thu, 23 May 2024 11:32:51 +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=1716463973; cv=none; b=HzgyTkHTxfxyE5hO48xD0sKC8W1fRuRM+RawKZdD/ah7BHWX30TolA5kEm8POg5fSIBR+1q9cpwuwiCK4rV4cX9o8uYOXMnaTTQpUw9gtpq01FmeH4HoWXWffIm7K5UkP+CDaei7I1oOAtoffkow1XE2elLQ+c9XS4wjFCE3oeQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716463973; c=relaxed/simple; bh=xxwOORKXpYRuv1uSmAvP8hybhQbv42S6rKt7i+RykoE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ND0mZBf5T/al5gTxw2djeUk/THEgG6q7AgZ7dKIKz8ouPuReOxUuKzh/5pm8Wqt2ve4AkWG5dtt4KbQ+9+DRQgdTK+lQuO75SQ3s1rOzT1kklYiTyLfKljOs6p8zsxRHTckdWyIk3c8Bgb5pdUBYOPuNMAD+IPh8CrHbU8necEU= 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=LNUJpLZP; 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=1716463970; bh=xxwOORKXpYRuv1uSmAvP8hybhQbv42S6rKt7i+RykoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LNUJpLZPkFeJowEbnPonKue9SSW32Xo/8RewwMBwlI4V0Y9OKEIehgnw5uliyLMSw 8pIFNmXXEmGow99diw1Nxu9lpnN7/ft5I0Fiy5kGFFMXdJZaze4sGKrNgV5IkSpL0c 5vw8lo+iTNzUagaWT2qnWzDFL2WSl/5kd7UfRF2qUmZqn+MaL+WW63UHkc4SVbVcRF QRJYroAMWzWhNesF6yWXCmtqT7ugIRNQ4RlQ/H+nqN0PTPtnWvnlW9+AcQnp1Y01Ye npXQ21OcEVY/g19Kn3SXC0UTXqXTRZwyBlDT6XxTdsFk5uLKrBbucyP/lmdjVRNu5P meXGFS7MV5Ebw== Received: from localhost.localdomain (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: alarumbe) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A909E37821C5; Thu, 23 May 2024 11:32:49 +0000 (UTC) From: =?UTF-8?q?Adri=C3=A1n=20Larumbe?= To: Boris Brezillon , Rob Herring , Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Dmitry Osipenko , Zack Rusin Cc: kernel@collabora.com, =?UTF-8?q?Adri=C3=A1n=20Larumbe?= , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org Subject: [PATCH v4 3/3] drm/gem-shmem: Add import attachment warning to locked pin function Date: Thu, 23 May 2024 12:32:19 +0100 Message-ID: <20240523113236.432585-4-adrian.larumbe@collabora.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240523113236.432585-1-adrian.larumbe@collabora.com> References: <20240523113236.432585-1-adrian.larumbe@collabora.com> 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: 8bit 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. Cc: Thomas Zimmermann Cc: Dmitry Osipenko Cc: Boris Brezillon Fixes: a78027847226 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()") Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ 1 file changed, 2 insertions(+) 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_object *shmem) dma_resv_assert_held(shmem->base.resv); + drm_WARN_ON(shmem->base.dev, shmem->base.import_attach); + ret = drm_gem_shmem_get_pages(shmem); return ret; -- 2.45.1