From nobody Sun Feb 8 17:16:22 2026 Received: from exactco.de (exactco.de [176.9.10.151]) (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 4F679320CC2 for ; Tue, 2 Dec 2025 15:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=176.9.10.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764690596; cv=none; b=Th0GarwBDIGh1pDdCW0xkYn9Dz1lA4TC1F+2+a8jzTkrMPvHzaS/JgGxA8lPYCmK1cZWnY4EYjVlnDixfUTfYaqpDMZttHPFiBIzYD0O83RjTYtxAH9zur0HmsCYiilonZTKG42mFjv3Bs6YMGzBIf0hP8SfCNHsL57HN+5Tz8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764690596; c=relaxed/simple; bh=KIYAd+gcZkowr0IbU/6IOYP+xP/8ZMWF6YlzcyqPyX8=; h=Date:Message-Id:To:Cc:Subject:From:Mime-Version:Content-Type; b=Pz2CZI0iJtGbWX8Xfg8uakYmt8Z/zKmMBtcnyITRCAQ5FzPRkskctyrG5TkM+dizU9By6jGOrvuQ97209rJfiOUVNIUvxyzfjfoU8wbOc8yzQRSjjKVB/bzwbJCb3OjxMuCtrL8XgprZ9l8jghK1r1NwFS4bCPiLmlsERteOm8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=exactco.de; spf=pass smtp.mailfrom=exactco.de; dkim=pass (2048-bit key) header.d=exactco.de header.i=@exactco.de header.b=ooZEiA+r; arc=none smtp.client-ip=176.9.10.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=exactco.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=exactco.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=exactco.de header.i=@exactco.de header.b="ooZEiA+r" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=exactco.de; s=x; h=Content-Transfer-Encoding:Content-Type:Mime-Version:From:Subject:Cc:To :Message-Id:Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=us4cXwZibrCp/4pn/5nhOL8E5dr825vqUhsBdb3WS3c=; b=o oZEiA+r0njrrmSWyGw+vcoDsO7xAMKBBIB6JYSBezvEWygX54QNEG3AX+lQYduKVDjNhwbFYjFN3K wtCoKc9M5YMdNuKDuFFQelL025SEPPuRlZJF1pOUg+M5FQDC9K8m42f2sU4lcTkorHpC+A32EjKJX nJ2w46gA+G9RHrLVXh0PI2/R2zQ3N+opywG7WmFOF3sgGl+oCXWcTkoED9TIqnQvTzHFjf66DxGHk NYkqPOnt664bFRftGEqalzBMUf/sskmxwnpoUru2+kOhLWpNH0jJzvNKsJFUQfPzQoOotuVNZbqos AIHfK7MQ/mSZ6ReBDD9N4mmDMyveE6Rkw==; Date: Tue, 02 Dec 2025 16:49:52 +0100 (CET) Message-Id: <20251202.164952.2216481867721531616.rene@exactco.de> To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Dmitry Baryshkov , Lyude Paul , Danilo Krummrich Subject: [PATCH RESEND] drm/nouveau: fix circular dep oops from vendored i2c encoder From: =?iso-8859-1?Q?Ren=E9?= Rebe X-Mailer: Mew version 6.10 on Emacs 30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Since a73583107af9 ("drm/nouveau: vendor in drm_encoder_slave API") nouveau appears to be broken for all dispnv04 GPUs (before NV50). Depending on the kernel version, either having no display output and hanging in kernel for a long time, or even oopsing in the cleanup path like: Hardware name: PowerMac11,2 PPC970MP 0x440101 PowerMac ... nouveau 0000:0a:00.0: drm: 0x14C5: Parsing digital output script table BUG: Unable to handle kernel data access on read at 0x00041520 Faulting instruction address: 0xc0003d0001be0844 Oops: Kernel access of bad area, sig: 11 [#1] BE PAGE_SIZE=3D4K MMU=3DHash SMP NR_CPUS=3D8 NUMA PowerMac Modules linked in: windfarm_cpufreq_clamp windfarm_smu_sensors windfarm_smu= _controls windfarm_pm112 snd_aoa_codec_onyx snd_aoa_fabric_layout snd_aoa w= indfarm_pid jo apple_mfi_fastcharge rndis_host cdc_ether usbnet mii snd_aoa_i2sbus snd_ao= a_soundbus snd_pcm snd_timer snd soundcore rack_meter windfarm_smu_sat wind= farm_max6690_s m75_sensor windfarm_core gpu_sched drm_gpuvm drm_exec drm_client_lib drm_tt= m_helper ttm drm_display_helper drm_kms_helper drm drm_panel_orientation_qu= irks syscopyar _sys_fops i2c_algo_bit backlight uio_pdrv_genirq uio uninorth_agp agpgart z= ram dm_mod dax ipv6 nfsv4 dns_resolver nfs lockd grace sunrpc offb cfbfillr= ect cfbimgblt ont input_leds sr_mod cdrom sd_mod uas ata_generic hid_apple hid_generic us= bhid hid usb_storage pata_macio sata_svw libata firewire_ohci scsi_mod fire= wire_core ohci ehci_pci ehci_hcd tg3 ohci_hcd libphy usbcore usb_common nls_base led_class CPU: 0 UID: 0 PID: 245 Comm: (udev-worker) Not tainted 6.14.0-09584-g7d0601= 5d936c #7 PREEMPTLAZY Hardware name: PowerMac11,2 PPC970MP 0x440101 PowerMac NIP: c0003d0001be0844 LR: c0003d0001be0830 CTR: 0000000000000000 REGS: c0000000053f70e0 TRAP: 0300 Not tainted (6.14.0-09584-g7d06015d936= c) MSR: 9000000000009032 CR: 24222220 XER: 00000000 DAR: 0000000000041520 DSISR: 40000000 IRQMASK: 0 \x0aGPR00: c0003d0001be083= 0 c0000000053f7380 c0003d0000911900 c000000007bc6800 \x0aGPR04: 00000000000= 00000 0000000000000000 c000000007bc6e70 0000000000000001 \x0aGPR08: 01f3040= 000000000 0000000000041520 0000000000000000 c0003d0000813958 \x0aGPR12: c00= 0000000071a48 c000000000e28000 0000000000000020 0000000000000000 \x0aGPR16:= 0000000000000000 0000000000f52630 0000000000000000 0000000000000000 \x0aGP= R20: 0000000000000000 0000000000000000 0000000000000001 c0003d0000928528 \x= 0aGPR24: c0003d0000928598 0000000000000000 c000000007025480 c00000000702548= 0 \x0aGPR28: c0000000010b4000 0000000000000000 c000000007bc1800 c000000007b= c6800 NIP [c0003d0001be0844] nv_crtc_destroy+0x44/0xd4 [nouveau] LR [c0003d0001be0830] nv_crtc_destroy+0x30/0xd4 [nouveau] Call Trace: [c0000000053f7380] [c0003d0001be0830] nv_crtc_destroy+0x30/0xd4 [nouveau] (= unreliable) [c0000000053f73c0] [c0003d00007f7bf4] drm_mode_config_cleanup+0x27c/0x30c [= drm] [c0000000053f7490] [c0003d0001bdea50] nouveau_display_create+0x1cc/0x550 [n= ouveau] [c0000000053f7500] [c0003d0001bcc29c] nouveau_drm_device_init+0x1c8/0x844 [= nouveau] [c0000000053f75e0] [c0003d0001bcc9ec] nouveau_drm_probe+0xd4/0x1e0 [nouveau] [c0000000053f7670] [c000000000557d24] local_pci_probe+0x50/0xa8 [c0000000053f76f0] [c000000000557fa8] pci_device_probe+0x22c/0x240 [c0000000053f7760] [c0000000005fff3c] really_probe+0x188/0x31c [c0000000053f77e0] [c000000000600204] __driver_probe_device+0x134/0x13c [c0000000053f7860] [c0000000006002c0] driver_probe_device+0x3c/0xb4 [c0000000053f78a0] [c000000000600534] __driver_attach+0x118/0x128 [c0000000053f78e0] [c0000000005fe038] bus_for_each_dev+0xa8/0xf4 [c0000000053f7950] [c0000000005ff460] driver_attach+0x2c/0x40 [c0000000053f7970] [c0000000005fea68] bus_add_driver+0x130/0x278 [c0000000053f7a00] [c00000000060117c] driver_register+0x9c/0x1a0 [c0000000053f7a80] [c00000000055623c] __pci_register_driver+0x5c/0x70 [c0000000053f7aa0] [c0003d0001c058a0] nouveau_drm_init+0x254/0x278 [nouveau] [c0000000053f7b10] [c00000000000e9bc] do_one_initcall+0x84/0x268 [c0000000053f7bf0] [c0000000001a0ba0] do_init_module+0x70/0x2d8 [c0000000053f7c70] [c0000000001a42bc] init_module_from_file+0xb4/0x108 [c0000000053f7d50] [c0000000001a4504] sys_finit_module+0x1ac/0x478 [c0000000053f7e10] [c000000000023230] system_call_exception+0x1a4/0x20c [c0000000053f7e50] [c00000000000c554] system_call_common+0xf4/0x258 --- interrupt: c00 at 0xfd5f988 NIP: 000000000fd5f988 LR: 000000000ff9b148 CTR: 0000000000000000 REGS: c0000000053f7e80 TRAP: 0c00 Not tainted (6.14.0-09584-g7d06015d936= c) MSR: 100000000000d032 CR: 28222244 XER: 00000000 IRQMASK: 0 \x0aGPR00: 0000000000000161 00000000ffcdc2d0 00000000405db160 00= 00000000000020 \x0aGPR04: 000000000ffa2c9c 0000000000000000 000000000000001= f 0000000000000045 \x0aGPR08: 0000000011a13770 0000000000000000 00000000000= 00000 0000000000000000 \x0aGPR12: 0000000000000000 0000000010249d8c 0000000= 000000020 0000000000000000 \x0aGPR16: 0000000000000000 0000000000f52630 000= 0000000000000 0000000000000000 \x0aGPR20: 0000000000000000 0000000000000000= 0000000000000000 0000000011a11a70 \x0aGPR24: 0000000011a13580 0000000011a1= 1950 0000000011a11a70 0000000000020000 \x0aGPR28: 000000000ffa2c9c 00000000= 00000000 000000000ffafc40 0000000011a11a70 NIP [000000000fd5f988] 0xfd5f988 LR [000000000ff9b148] 0xff9b148 --- interrupt: c00 Code: f821ffc1 418200ac e93f0000 e9290038 e9291468 eba90000 48026c0d e84100= 18 e93f06aa 3d290001 392982a4 79291f24 <7fdd482a> 2c3e0000 41820030 7fc3f378 ---[ end trace 0000000000000000 ]--- This is caused by the i2c encoder modules vendored into nouveau/ now depending on the equally vendored nouveau_i2c_encoder_destroy function. Trying to auto-load this modules hangs on nouveau initialization until timeout, and nouveau continues without i2c video encoders. Fix by avoiding nouveau dependency by __always_inlining that helper functions into those i2c video encoder modules. Fixes: a73583107af9 ("drm/nouveau: vendor in drm_encoder_slave API") Signed-off-by: Ren=C3=A9 Rebe Reviewed-by: Lyude Paul --- Tested on NV43 [GeForce 6600], PPC64 PowerMac11,2 runing T2/Linux=20 --- .../nouveau/dispnv04/nouveau_i2c_encoder.c | 20 ------------------- .../include/dispnv04/i2c/encoder_i2c.h | 19 +++++++++++++++++- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv04/nouveau_i2c_encoder.c b/drive= rs/gpu/drm/nouveau/dispnv04/nouveau_i2c_encoder.c index e2bf99c43336..a60209097a20 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/nouveau_i2c_encoder.c +++ b/drivers/gpu/drm/nouveau/dispnv04/nouveau_i2c_encoder.c @@ -94,26 +94,6 @@ int nouveau_i2c_encoder_init(struct drm_device *dev, return err; } =20 -/** - * nouveau_i2c_encoder_destroy - Unregister the I2C device backing an enco= der - * @drm_encoder: Encoder to be unregistered. - * - * This should be called from the @destroy method of an I2C slave - * encoder driver once I2C access is no longer needed. - */ -void nouveau_i2c_encoder_destroy(struct drm_encoder *drm_encoder) -{ - struct nouveau_i2c_encoder *encoder =3D to_encoder_i2c(drm_encoder); - struct i2c_client *client =3D nouveau_i2c_encoder_get_client(drm_encoder); - struct module *module =3D client->dev.driver->owner; - - i2c_unregister_device(client); - encoder->i2c_client =3D NULL; - - module_put(module); -} -EXPORT_SYMBOL(nouveau_i2c_encoder_destroy); - /* * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs: */ diff --git a/drivers/gpu/drm/nouveau/include/dispnv04/i2c/encoder_i2c.h b/d= rivers/gpu/drm/nouveau/include/dispnv04/i2c/encoder_i2c.h index 31334aa90781..869820701a56 100644 --- a/drivers/gpu/drm/nouveau/include/dispnv04/i2c/encoder_i2c.h +++ b/drivers/gpu/drm/nouveau/include/dispnv04/i2c/encoder_i2c.h @@ -202,7 +202,24 @@ static inline struct i2c_client *nouveau_i2c_encoder_g= et_client(struct drm_encod return to_encoder_i2c(encoder)->i2c_client; } =20 -void nouveau_i2c_encoder_destroy(struct drm_encoder *encoder); +/** + * nouveau_i2c_encoder_destroy - Unregister the I2C device backing an enco= der + * @drm_encoder: Encoder to be unregistered. + * + * This should be called from the @destroy method of an I2C slave + * encoder driver once I2C access is no longer needed. + */ +static __always_inline void nouveau_i2c_encoder_destroy(struct drm_encoder= *drm_encoder) +{ + struct nouveau_i2c_encoder *encoder =3D to_encoder_i2c(drm_encoder); + struct i2c_client *client =3D nouveau_i2c_encoder_get_client(drm_encoder); + struct module *module =3D client->dev.driver->owner; + + i2c_unregister_device(client); + encoder->i2c_client =3D NULL; + + module_put(module); +} =20 /* * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs: --=20 2.46.0 --=20 Ren=C3=A9 Rebe, ExactCODE GmbH, Berlin, Germany https://exactco.de =E2=80=A2 https://t2linux.com =E2=80=A2 https://patreon.= com/renerebe