From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 229E3403B13 for ; Thu, 11 Jun 2026 13:02:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781182968; cv=none; b=LOhAQBwqs3G2nWFmdSLbzHgUrGEXFiXjyDzvYfiHTs4+yOnx5Sv0d91ri66co0B3mY94XmFDwpub4wQ8f4uNUoCRYaDN2zDfp6JqvXVXU9hxRTKtTaBVPME51rithVNnofzNwYt4FKF0ubBxrfGEqXOIldgxX7gkb1PhIC1jQXY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781182968; c=relaxed/simple; bh=0BnLN75br1/UMx6Db0d6QQNSaIWPqGJH8ELYuVtlFec=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=W5otKCOf9AssPhFTAGdOz82weil9VSljmhcY1RPf/BZS+ujppUpd5MyzCMJmslmQhM9s0EPWJ1lyPDFruvlCO2wLQPhn/oYgygNV9ubXA5zZp+Pp2W/bm40KNHMRF63cst95jt5TNZH/swBwO661R0Cm1i5BqLjLEMPcyfWPgh8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W2gtE65Z; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W2gtE65Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 633081F0089C; Thu, 11 Jun 2026 13:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781182965; bh=LaunKh9fq8CcYIKd3nFETlqAjeP/HHTp66QUxPtcxXI=; h=From:To:Cc:Subject:Date; b=W2gtE65ZxuXJt0Y6NB3AMdDKp/h7quuqkCyq6s16JY+us2X6m349Jk1RquS7Ybgb8 fLMWdNhu726eIABMj4Gpw9cTSB7wleaJAb297g4+PxVAR2m0QRhJD5rLdbmdMEmSPL x+EoTf4IROJpclbqL7KKYgvV0C0YDunCY+Te36R66NgSPe11wSPfXos5tai6QXUZDq xleU9fNmDhIX7s7AhW5OQ+YWwoj0MayBE/3EopNztqjLuK/IEyK4nLs6ZkkE0uHN9I kV1Y95Glpd0E+mFfByqSDNZN0jJTrcyR1FOdiDWTdMLJb84r2ZcnyXfCvVUf7PzNde qUc9q0hiDDp5Q== From: Arnd Bergmann To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , Vitaly Prosyak Cc: Arnd Bergmann , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] amdgpu: lockdep: move temporary mutexes off stack Date: Thu, 11 Jun 2026 15:02:33 +0200 Message-Id: <20260611130240.3388318-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann In randconfig builds, the newly added function frequently exceeds the limit for stack frames, like: drivers/gpu/drm/amd/amdgpu/amdgpu_lockdep.c:84:5: error: stack frame size (1312) exceeds limit (1280) in 'amdgpu_lockdep_init' [-Werror,-Wframe-larger-than] Change this to use static allocation for the locks to reduce this at the expense of a slightly larger driver binary. Fixes: 1d0f5838b126 ("drm/amdgpu: Add lockdep annotations for lock ordering validation") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/amdgpu/amdgpu_lockdep.c | 24 ++++++--------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_lockdep.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_lockdep.c index d5d71fd7c70d..cf723c9f9216 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_lockdep.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_lockdep.c @@ -85,13 +85,13 @@ int amdgpu_lockdep_init(void) { struct amdgpu_reset_domain *reset_domain = NULL; struct amdgpu_reset_control reset_ctl; - struct mutex userq_sch_mutex; - struct mutex userq_mutex; - struct mutex notifier_lock; - struct mutex vram_lock; - struct mutex srbm_mutex; - struct mutex grbm_idx_mutex; - spinlock_t mmio_idx_lock; + static DEFINE_MUTEX(userq_sch_mutex); + static DEFINE_MUTEX(userq_mutex); + static DEFINE_MUTEX(notifier_lock); + static DEFINE_MUTEX(vram_lock); + static DEFINE_MUTEX(srbm_mutex); + static DEFINE_MUTEX(grbm_idx_mutex); + static DEFINE_SPINLOCK(mmio_idx_lock); unsigned long flags; /* @@ -102,16 +102,6 @@ int amdgpu_lockdep_init(void) if (!reset_domain) return -ENOMEM; - /* Initialize dummy locks */ - mutex_init(&userq_sch_mutex); - mutex_init(&userq_mutex); - mutex_init(¬ifier_lock); - mutex_init(&vram_lock); - mutex_init(&reset_ctl.reset_lock); - mutex_init(&srbm_mutex); - mutex_init(&grbm_idx_mutex); - spin_lock_init(&mmio_idx_lock); - /* * Associate dummy locks with the same class keys used for real * driver locks. This ensures lockdep connects the ordering learned -- 2.39.5