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=1796383710; b=CaS7YlfZg8hIo+raugrNB/DOkp/P476uFbSgu/7oA2z28GA3xnlHRyvaYqCehdh/93ML FLnKnfa7FYQvFEq9/xoDytY4nZU+YkJnDMGD8f9ysZcGfQelCF4/G+YZbwDEUql/p3Hju VYgUa0Z077MqpMK6t3ZjoEPy191BlWFylJaAbP7zChbU2pGepS05IsR1HNMH9ntTycIfB +ThyxSO4EfOoY9pBD9BW+xUxzuOPpzlhek771nD+hDlLITCmCYMkfOyM54mQSdSBmTDSh Bv+kxBctbahDFClSxa+dG5FFBnW3NEv9PldNw2b+b7Il//0ApOwGGRjK9cTiDiDTWRQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383710; 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=86zf2rG3XCCzAc/Mqepx2DhlKxQgBwpo4MwbKCyVUPc=; b=uyEFtaqgbsqMxshQvccIRx7Gcm+4voqj2IVIrTCZ4NbtUk9tSb1IawBBR0LjL7bLi2/Q OAF6o1vYjSbxA9wYISSAXAWW6HJnXteErW3YvIQTx3Aue4hsOtXACL7FlkqsqOrmqZ6Be NZiNJWsDzP6fX6fRCvijp1Pr1zpUubfCHPoJL5+K8VJVZoCLUfCu78fFdVAX2OYB5Tplt T5eAzrwkQBpzXLC74Q75D/XSdUzeLP65K1iXH/uQIJCD84CzP05r79EdwZSnh+IrXuqEx d3lhczUM23SMeh0OyN8/mUmn6YhmsuE/vmbQgOvvBflGairTwZGW5dqcC1GszQaO74g== 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=Dynmbm7d; 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 1C5B8606A322; Fri, 4 Dec 2026 11:28:30 +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=Dynmbm7d Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAF0B1F000C2; Fri, 4 Dec 2026 11:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383709; bh=86zf2rG3XCCzAc/Mqepx2DhlKxQgBwpo4MwbKCyVUPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Dynmbm7dBiz9ZXrlsmzOJWnAwDEk5+dWo0sfd7lqQEsx/Jh9AUhFFLN6iCzpb07Tx mtQJAmtQV0mv6zWFesalniPiVfaDlhxk5IdY79kF/znLtACmeEtvlwO2Mjq2sP/jNv oY0leXCtS0xXikxlo/KFWd1IO2fR1KNK/C+thXBY= 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.12 339/555] drm/vc4: Hold a runtime PM reference while allocating the binner BO Date: Fri, 4 Dec 2026 19:06:22 +0900 Message-ID: <20261204100622.878206374@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev 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.12-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; }