intel / ipu6-drivers

152 stars 50 forks source link

ipu6: Fix ipu_buttress_exit() not being called on fw load failure #154

Closed jwrdegoede closed 10 months ago

jwrdegoede commented 1 year ago

ipu_pci_probe() did not call ipu_buttress_exit() on fw load errors, causing the following oops when trying to load the module a second time (rmmod + modprobe) after installing the firmware:

[  717.471913] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:05.0/psys_fused_min_freq'
[  717.471917] CPU: 3 PID: 2535 Comm: modprobe Tainted: G           OE      6.4.0-rc6+ #11
[  717.471920] Hardware name: Default string Default string/Default string, BIOS JP2V1.09 07/29/2022
[  717.471923] Call Trace:
[  717.471928]  <TASK>
[  717.471932]  dump_stack_lvl+0x71/0x90
[  717.471941]  sysfs_warn_dup+0x56/0x70
[  717.471948]  sysfs_add_file_mode_ns+0x12d/0x140
[  717.471953]  sysfs_create_file_ns+0x4f/0x70
[  717.471958]  ipu_buttress_init+0x326/0x490 [intel_ipu6]
[  717.471975]  ipu_pci_probe+0x322/0xc60 [intel_ipu6]
...

Properly call ipu_buttress_exit() to fix this.

jwrdegoede commented 10 months ago

Sorry for being a bit slow to reply.

Shall we change it in this way, like upstreaming IPU6 driver?

Yes that is fine with me. I'll push a new version with the suggested changes.

hao-yao commented 10 months ago

Thank you @jwrdegoede , will merge this.