From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382332; b=hMwUuaDYxQTWKgZ+/rnosINpX3YLKi1m2glkgn49e8Ln7tQcz8DNAuBfp1KShnRdF1fD kK4NaVLzgxIp0Dh6s9P3UDuzXWG9HR4tD1oKkN/r+Kj4nyTUMk97PwpGnBcMSQPyMSByA 0LmOc5NIrAH0YWO830PTIp5t1Aqnd6DfyJZ7RvEyy5Fschy9UAC/1ol4JzOQQ8eNH8Efg YC5Nv2WvjO9d3q9g6FIHcTq3EaIv8mA91XzCWZ8wrYfW0rOwW50l0RChPsLe6oecMM3gJ 867tHAyEsmU2nd0Tr/tLDW/DIRJYiLT5TPs/Q1YXRe1HrrpR9UuLcolW3bBzLoH9LrQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382332; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=tEIhhNKWEysraASDjuMHSA0HVhWW8xg5DVOg5+xXRfQ=; b=hYWBZOF/CgOGBUNZQKy7E+aMcBFvthidMPvz5WwIqDuMGs3nvB2y3C6FSHmCxUYHUUQB ZQ0k6rWf60r4OkXraMZyu2PcSKI6p/LcFKHA/Q1PxaNXSOtPKIfFF0jzuWJ5B5XLsSXye bdCuLoJpMCiA2E/6dhZPmFMLByugJmy393uX7Y+IHO8JaFa8Bi294O3/boagQylYOaqno XqoQnxQVH7nNYgRQTBQWhL/JmXNZGxtr1trruQNj0pWbtzY5AOP3NPCYnnKA4mG6F1nPd fL6rNa2ZIfgKD7YMw2IeTWzwmIGHsc94GFGapPaiPRY9yvia1EY3cfxy9ZEy2ZEdp0A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=eHFf9zsn; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20E25606A68D; Fri, 4 Dec 2026 11:05:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=eHFf9zsn Received: by smtp.kernel.org (Postfix) with ESMTPSA id 486D51F00933; Fri, 4 Dec 2026 11:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382331; bh=tEIhhNKWEysraASDjuMHSA0HVhWW8xg5DVOg5+xXRfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eHFf9zsnxw5tl2MPdzVt7TF6QcScQ/CqqFjbzjAjXwO9lQKIh66F06Ek/iEooKmNO qwgNU6lK+oa/WimF2FI/BscIezaeH1nOTxFPaAeSXGs/gNYpbyQ76jqjiRo7RBCJYb pkM2i2ZxvAL+6yXEB1L1ukBv+crsqPbIlNFO0MvU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Iago Toral Quiroga , =?UTF-8?q?Ma=C3=ADra=20Canal?= Subject: [PATCH 6.18 367/703] drm/vc4: Hold a runtime PM reference while allocating the binner BO Date: Fri, 4 Dec 2026 19:04:26 +0900 Message-ID: <20261204100637.574504618@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maíra Canal commit a7d7a25b566635ac1ee6af1c3ef06484cf752c3f upstream. bin_bo_alloc() arms the out-of-memory interrupt once it has allocated the binner BO, and accessing a V3D register requires the block to be powered. vc4_submit_cl_ioctl() already holds a runtime PM reference by the time it reaches vc4_get_bcl(), but vc4_create_bo_ioctl() reaches vc4_grab_bin_bo() without one, so the write can land on a suspended device. Take the reference in vc4_v3d_bin_bo_get(), which covers both callers, and take it before bin_bo_lock so that runtime PM is never waited for with the mutex held. Cc: stable@vger.kernel.org Fixes: 35c8b4b2c0fe ("drm/vc4: Allocate binner bo when starting to use the V3D") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261111-vc4-irq-cleanup-v2-1-aa757bb742f2@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vc4/vc4_v3d.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -320,11 +320,15 @@ static int bin_bo_alloc(struct vc4_dev * int vc4_v3d_bin_bo_get(struct vc4_dev *vc4, bool *used) { - int ret = 0; + int ret; if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4)) return -ENODEV; + ret = vc4_v3d_pm_get(vc4); + if (ret) + return ret; + mutex_lock(&vc4->bin_bo_lock); if (used && *used) @@ -340,6 +344,7 @@ int vc4_v3d_bin_bo_get(struct vc4_dev *v complete: mutex_unlock(&vc4->bin_bo_lock); + vc4_v3d_pm_put(vc4); return ret; }