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=1796380828; b=eFIGAkD+pb7iKJ1ikq5HHw9SloRQq7HoiY+dWoLgIkdcCgPkGATgOhsW3LUvgO/Hi6LK 8LvKuMKs7YDuPTZnj5kcuEsODsxX/6Y1jfsIGYc2FJCpMUelwtg6s6xMKFHjPnLw+uA4R Ihx9gFlkLges7tiN0XmP2XK4HBjBRIoMofIfJDtnpQfmzGeIA5V1txprC3qrDUNUzjgcn bfYGX3y9a/tXKKn3FujXZm9yFJSOiEbUuX3di0DU5k4f/0tniKcqxganR2LTIGm/Lt7+W JJETGV6va21Aho00V64lfMjSnON10ZBZ3MC/saOsrqmGgiXOKg4PnjgBZHC6e5effAA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380828; 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=NvvU1JirjGksiLgoU8Wzj6YAjqSEkiqTuFILK964I/I=; b=Ty3EX0HZWB/jKSouJ2c9gG6tkC0W4+0JLZqngswipfU1Cq+m/h4ZprePObBVXK4xC2fC JKcFYG8q86XhCpKUP0UdYrd9b3TdzNn/cw45IFGUZBVK/1vKn7V755IHCHf6wu7WN8Qx6 zK4Wd5Vfo23Wrv5aZJf/Dje28O4XzGSlNdEfwDB+VypSujciu9Mw+y3aYSPVIbcWDVxom 0rHNUdrBhxkIE6BlNWwtWhwAcHokB0weFKRoep7OgZ6NtVxNYlwlYG5c0Ad/RLC35BreQ ysh7l05mjLAjtFf88iXAq71useavfg51CL7/boR5QB7fkzcjV6NJrpeB2fQs/C9gYLA== 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=1gn6aksc; 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 339B7606A334; Fri, 4 Dec 2026 10:40:28 +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=1gn6aksc Received: by smtp.kernel.org (Postfix) with ESMTPSA id A29A61F000C2; Fri, 4 Dec 2026 10:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380828; bh=NvvU1JirjGksiLgoU8Wzj6YAjqSEkiqTuFILK964I/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1gn6akscbJzL7S7VrBVHPWgqRxuKJnwFBm7pHwXXDFGyAxuRqI6Ih7I2U+F04jzCs wFFmbhGwU9ufTEPLWacMoRlbYfgOyWpe2dK5ahSi+EsyekX0ABcIhkX0Fl68WkkqU7 XwpFfrK04cpSNfJxaRwp1ux5H1De+zdEYCm2T+tg= 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 7.3 400/742] drm/vc4: Hold a runtime PM reference while allocating the binner BO Date: Fri, 4 Dec 2026 19:04:24 +0900 Message-ID: <20261204100645.721996267@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 @@ -322,11 +322,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) @@ -342,6 +346,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; }