From nobody Sun Feb 8 18:49:40 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 A99AD2D7384 for ; Fri, 19 Dec 2025 21:54:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766181243; cv=none; b=CdFMigOyKJqyh01nKOivrC+Sp6UqnZVpe1qNCycAoXxbXwEbkzd/BIPATh4OLR5BoQ2w1clhJKfrLd4tk1hRzm0Hfav2WxllDN9M2Tzh4GGBRJ/CuTDK4uK/JVW0Rcq8X3uiGmsoeuYUum9sJH5pjp+TujQZTu7Aw1ouqhm1BqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766181243; c=relaxed/simple; bh=Wwk4XtNT/QwR671eROxJvK+6rFePJGFk3RXRtUiR3KA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Asvf9cu82w+WaGwC/EsAPDsQs5jREVSdzBwkqeo7aBHZvWbWDScZaun0aEJdGe94G/gs0/hvknjqIlEBHaI/f6fIM6sUwXpDDJFdxpJoEBX0g24WrTTkGoFvijG35ppalei7rx9zkFnTwqVDw0GkmSm+y6QOyoBkmVxrSFEke6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=C8dxW8Ri; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="C8dxW8Ri" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766181240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yT/vkIL4JqiLKqlGqIsKx0mk6qKhYZKvJPVbSWT23XE=; b=C8dxW8RisnnAuUzu7TOj6+w/az2793foIA3KRltOu1kjL/3CeCCYfptrej+FE7Roj1TGos DzcVqstjxGYqe9NlDq60dcHio+KUiIwD+3w/uBU/TDn6ytjaQI+Zz3ytNKDZTxhUOUIs9n 54iBaY04xHsp2xtea9H6Fku2rhQ0Zns= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-71bDXKARMI2wW1XdZGx_IQ-1; Fri, 19 Dec 2025 16:53:57 -0500 X-MC-Unique: 71bDXKARMI2wW1XdZGx_IQ-1 X-Mimecast-MFC-AGG-ID: 71bDXKARMI2wW1XdZGx_IQ_1766181235 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7950D18005AE; Fri, 19 Dec 2025 21:53:55 +0000 (UTC) Received: from GoldenWind.redhat.com (unknown [10.22.80.166]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 31C7B300021A; Fri, 19 Dec 2025 21:53:53 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: "Timur Tabi" , "Dave Airlie" , "Maarten Lankhorst" , "Ben Skeggs" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "Lyude Paul" Subject: [PATCH 2/2] drm/nouveau/kms/nv50-: Assert we hold nv50_disp->lock in nv50_head_flush_* Date: Fri, 19 Dec 2025 16:52:03 -0500 Message-ID: <20251219215344.170852-3-lyude@redhat.com> In-Reply-To: <20251219215344.170852-1-lyude@redhat.com> References: <20251219215344.170852-1-lyude@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" Now that we've had one bug that occurred in nouveau as the result of nv50_head_flush_* being called without the appropriate locks, let's add some lockdep asserts to make sure this doesn't happen in the future. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/head.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouv= eau/dispnv50/head.c index 3dd742b4f8232..e32ed1db6c566 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c @@ -43,6 +43,9 @@ nv50_head_flush_clr(struct nv50_head *head, union nv50_head_atom_mask clr =3D { .mask =3D asyh->clr.mask & ~(flush ? 0 : asyh->set.mask), }; + + lockdep_assert_held(&head->disp->mutex); + if (clr.crc) nv50_crc_atomic_clr(head); if (clr.olut) head->func->olut_clr(head); if (clr.core) head->func->core_clr(head); @@ -65,6 +68,8 @@ nv50_head_flush_set_wndw(struct nv50_head *head, struct n= v50_head_atom *asyh) void nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh) { + lockdep_assert_held(&head->disp->mutex); + if (asyh->set.view ) head->func->view (head, asyh); if (asyh->set.mode ) head->func->mode (head, asyh); if (asyh->set.core ) head->func->core_set(head, asyh); --=20 2.52.0