Re: [CI 11/15] drm/i915/huc: track delayed HuC load with a fence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 11/7/2022 5:41 PM, Brian Norris wrote:
On Mon, Nov 07, 2022 at 10:38:14AM -0800, Ceraolo Spurio, Daniele wrote:
Ok, I think I have an idea of what's happening: if HuC is not enabled, we
skip the call to fence_fini, so we leak the debug object. Can you check if
the below diff fixes the issue for you?
Thanks for checking! This also gives me the hint that I can try out the
HuC firmware to see if that changes anything for me. For reference,
here's the firmware bundled with ChromeOS (and that I'm running):

https://chromium.googlesource.com/chromiumos/third_party/linux-firmware/+/HEAD/i915/

We tend to pull pieces from upstream linux-firwmare.git as needed, and
seemingly ChromeOS folks haven't found HuC necessary for GLK.

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
index fbc8bae14f76..e3bbd174889d 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
@@ -300,13 +300,12 @@ int intel_huc_init(struct intel_huc *huc)

  void intel_huc_fini(struct intel_huc *huc)
  {
-       if (!intel_uc_fw_is_loadable(&huc->fw))
-               return;
-
         delayed_huc_load_complete(huc);

         i915_sw_fence_fini(&huc->delayed_load.fence);
-       intel_uc_fw_fini(&huc->fw);
+
+       if (intel_uc_fw_is_loadable(&huc->fw))
+               intel_uc_fw_fini(&huc->fw);
  }
(NB: you have some very weird whitespace in there. It's neither tabs nor
spaces. This slightly increases the chance that I get your diff wrong,
since the patch doesn't apply directly. But I'm pretty sure I
hand-copied it correctly...)

Unfortunately, I still see the same(?) problem with this patch.

[   85.182000] ------------[ cut here ]------------
[   85.182014] ODEBUG: init destroyed (active state 0) object type: i915_sw_fence hint: sw_fence_dummy_notify+0x0/0x11 [i915]
[   85.182238] WARNING: CPU: 2 PID: 1925 at lib/debugobjects.c:505 debug_print_object+0x6b/0x7e
[   85.182257] Modules linked in: i915(+) cmac algif_hash algif_skcipher af_alg btusb uvcvideo btrtl videobuf2_vmalloc btintel videobuf2_v4l2 btmtk videobuf2_memops videobuf2_common btbcm soundwire_intel soundwire_generic_allocation soundwire_cadence soundwire_bus 8021q bluetooth ecdh_generic ecc rtw88_8822ce rtw88_8822c rtw88_pci rtw88_core mac80211 cfg80211 r8152 mii video wmi backlight drm_buddy intel_gtt drm_display_helper ttm prime_numbers joydev [last unloaded: i915]
[   85.182593] CPU: 2 PID: 1925 Comm: i915_module_loa Not tainted 6.1.0-rc3-01115-ga397a9098fb3-dirty #35 b6325f6cdf3c04a0862a445aa86b1799d3939949
[   85.182607] Hardware name: HP Meep/Meep, BIOS Google_Meep.11297.262.0 03/18/2021
[   85.182619] RIP: 0010:debug_print_object+0x6b/0x7e
[   85.182634] Code: 31 c9 ff c0 89 05 ae a4 67 01 8b 43 10 8b 4b 14 48 8b 14 c5 e0 4a 86 8d 4d 8b 07 48 c7 c7 fe 47 ac 8d 4c 89 f6 e8 ba 53 c2 ff <0f> 0b ff 05 2a 50 11 01 5b 41 5e 41 5f 5d c3 cc cc cc cc 55 48 89
[   85.182646] RSP: 0018:ffffad7280583638 EFLAGS: 00010246
[   85.182661] RAX: 229fb1a4f3034f00 RBX: ffff960980064348 RCX: 0000000000000027
[   85.182672] RDX: 0000000000000027 RSI: 00000000ffffdfff RDI: ffff960af7d1b440
[   85.182683] RBP: ffffad7280583650 R08: 0000000000000000 R09: ffffad7280583490
[   85.182693] R10: 00000000ffffdfff R11: ffffffff8ca46e5b R12: ffff960988382cf8
[   85.182703] R13: ffffffffc08656b0 R14: ffffffff8daffd1f R15: ffffffffc08656b0
[   85.182713] FS:  00007fd5f9306940(0000) GS:ffff960af7d00000(0000) knlGS:0000000000000000
[   85.182725] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   85.182735] CR2: 00007fd5f85ef000 CR3: 00000001061d2000 CR4: 0000000000350ee0
[   85.182746] Call Trace:
[   85.182759]  <TASK>
[   85.182775]  __debug_object_init+0x26c/0x5ea
[   85.182794]  ? intel_huc_init_early+0xa6/0xa6 [i915 30ae04bc806a1fe406030ed4bf98e870eb8aa3bf]
[   85.182996]  ? 0xffffffffc03e6083
[   85.183028]  ? prepare_ftrace_return+0xa2/0xdf
[   85.183059]  ? __init_waitqueue_head+0x5/0x21
[   85.183082]  i915_sw_fence_reinit+0x19/0x3d [i915 30ae04bc806a1fe406030ed4bf98e870eb8aa3bf]
[   85.183310]  intel_huc_init_early+0x72/0xa6 [i915 30ae04bc806a1fe406030ed4bf98e870eb8aa3bf]
[   85.183514]  intel_uc_init_early+0x76/0x25b [i915 30ae04bc806a1fe406030ed4bf98e870eb8aa3bf]
[   85.183697]  intel_gt_common_init_early+0xc3/0xd6 [i915 30ae04bc806a1fe406030ed4bf98e870eb8aa3bf]
[   85.183878]  intel_root_gt_init_early+0x4c/0x5c [i915 30ae04bc806a1fe406030ed4bf98e870eb8aa3bf]
[   85.184055]  i915_driver_probe+0x26b/0xbf9 [i915 30ae04bc806a1fe406030ed4bf98e870eb8aa3bf]
[   85.184233]  ? drm_privacy_screen_put+0x5/0x23
[   85.184260]  i915_pci_probe+0x182/0x266 [i915 30ae04bc806a1fe406030ed4bf98e870eb8aa3bf]
[   85.184468]  pci_device_probe+0x99/0x126
...

That only required:

   pkill frecon
   <rmmod some audio drivers>
   ./i915_module_load --run-subtest reload

Thanks for testing. I'll try to get get my hands on a GLK and repro locally. Even if I can't manage to repro, I should at least be able to confirm if the updated function is being called as I expected.

Daniele

Brian




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux