Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE326606A322 for ; Thu, 3 Dec 2026 14:24:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fArmAf9c Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3083E112925; Thu, 3 Dec 2026 14:24:05 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id DCF4D10E74B for ; Thu, 3 Dec 2026 14:23:58 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id C656143BB8; Thu, 3 Dec 2026 14:23:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99E331F00926; Thu, 3 Dec 2026 14:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796307838; bh=Su9DK0Zc6xc0q0QoyuEeXTN4vwaBkm9nVRq9BisoyRk=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=fArmAf9cZsF8E+Mtpwo/KdjwhZWuawUf3fAm9eHzqz8BP9vcVzu8f3WPSGiZrRePb QgTKs8qCpai5vPxwDd1lMCB6x0RyYZAQlOSk501+/vh+u/Hex4DrTJOcLEu1rIW9b2 8eDdOponQ1Vdh7AaSOoupLE0quHpub+EoUqxDJGCHehQYN4JbcagCT+8kb/1YLRxDU BrsXbzYIPe3eDgL1H/vNRe1snnP1nfv4zrVqAnL2JBrh+B0ruouzLlqSr5XkRZmlge rm/fOzxn7zqkYfRiT/vqJ4IA0rCiQUcySjD4l27JjedVGr9j2R3Uvt2wJqc0z3aPBK d79zCZnQNEgpQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 06/10] drm/sched: Disallow initializing entities with un-initialized schedulers To: "Tvrtko Ursulin" , dri-devel@lists.freedesktop.org In-Reply-To: <20261203140128.6813-7-tvrtko.ursulin@igalia.com> References: <20261203140128.6813-1-tvrtko.ursulin@igalia.com> <20261203140128.6813-7-tvrtko.ursulin@igalia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 14:23:58 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] drm/sched: drm_sched_entity_init() breaks v3d_open() on V3D 3.3 -- commit c97e2213d0d6c3fa3066c68d77008ddc604e5ff1 Author: Tvrtko Ursulin drm/sched: Disallow initializing entities with un-initialized schedulers This commit rejects uninitialized schedulers in drm_sched_entity_init() and drm_sched_entity_modify_sched() by checking that every scheduler in sched_list has a non-NULL sched_rq. > diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/s= cheduler/sched_entity.c > index 03e68b4102d50..69bcefdf2c55a 100644 > --- a/drivers/gpu/drm/scheduler/sched_entity.c > +++ b/drivers/gpu/drm/scheduler/sched_entity.c > @@ -90,6 +90,19 @@ ktime_t drm_sched_entity_stats_job_add_gpu_time(struct= drm_sched_job *job) > return duration; > } > =20 > +static bool drm_sched_list_is_initialized(struct drm_gpu_scheduler **sch= ed_list, > + unsigned int num_sched_list) > +{ > + unsigned int i; > + > + for (i =3D 0; i < num_sched_list; i++) { > + if (!sched_list[i] || !sched_list[i]->sched_rq) > + return false; > + } > + > + return true; > +} > + > /** > * drm_sched_entity_init - Init a context entity used by scheduler when > * submit to HW ring. > @@ -119,7 +132,10 @@ int drm_sched_entity_init(struct drm_sched_entity *e= ntity, > unsigned int num_sched_list, > atomic_t *guilty) > { > - if (!entity || !sched_list || !num_sched_list || !sched_list[0]) > + if (!entity || !sched_list || !num_sched_list) > + return -EINVAL; > + > + if (!drm_sched_list_is_initialized(sched_list, num_sched_list)) > return -EINVAL; [Severity: High] Does returning -EINVAL here break v3d_open() on V3D 3.3? On V3D 3.3 (brcm,7268-v3d), v3d_has_csd() is false, so v3d_sched_init() in drivers/gpu/drm/v3d/v3d_sched.c skips initializing the V3D_CSD and V3D_CACHE_CLEAN schedulers and leaves their sched_rq NULL. v3d_open() in drivers/gpu/drm/v3d/v3d_drv.c still calls drm_sched_entity_init() for all V3D_MAX_QUEUES, so every open() of the V3D device node now fails with -EINVAL. v3d_open() (and v3d_postclose(), which calls drm_sched_entity_destroy() for all queues) would need to skip V3D_CSD and V3D_CACHE_CLEAN when !v3d_has_csd(v3d) before enforcing this check. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203140128.6813= -1-tvrtko.ursulin@igalia.com?part=3D6