Skip to content

Commit

Permalink
media: ipu6-bus: Set pm-domain later
Browse files Browse the repository at this point in the history
Move the dev_pm_domain_set() call to after the auxiliary_device_init()
call so that auxdev->dev.power.lock has been initialized.

This fixes the following lockdep warning / backtrace:

[   61.381538] INFO: trying to register non-static key.
[   61.381540] The code is fine but needs lockdep annotation, or maybe
[   61.381541] you didn't initialize this object before use?
[   61.381542] turning off the locking correctness validator.
[   61.381544] CPU: 8 PID: 1837 Comm: (udev-worker) Tainted: G            E      6.5.0+ linux-sunxi#28
[   61.381547] Hardware name: LENOVO 21HQSIT025/21HQSIT025, BIOS N3XET37W (1.12 ) 04/18/2023
[   61.381548] Call Trace:
[   61.381550]  <TASK>
[   61.381552]  dump_stack_lvl+0x57/0x90
[   61.381558]  register_lock_class+0x480/0x490
[   61.381563]  ? __lock_acquire+0x405/0x2190
[   61.381568]  __lock_acquire+0x76/0x2190
[   61.381572]  lock_acquire+0xc4/0x290
[   61.381575]  ? device_pm_check_callbacks+0x1d/0x100
[   61.381578]  _raw_spin_lock_irqsave+0x47/0x70
[   61.381581]  ? device_pm_check_callbacks+0x1d/0x100
[   61.381582]  device_pm_check_callbacks+0x1d/0x100
[   61.381585]  ipu6_bus_initialize_device+0xfa/0x160 [intel_ipu6]
[   61.381591]  ipu6_configure_spc+0xbe5/0x13a0 [intel_ipu6]
<snip>

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
jwrdegoede committed Sep 2, 2023
1 parent 809b603 commit 80f82bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/pci/intel/ipu6/ipu6-bus.c
Expand Up @@ -110,7 +110,6 @@ ipu6_bus_initialize_device(struct pci_dev *pdev, struct device *parent,
auxdev->dev.dma_mask = &adev->dma_mask;
auxdev->dev.dma_parms = pdev->dev.dma_parms;
auxdev->dev.coherent_dma_mask = adev->dma_mask;
dev_pm_domain_set(&auxdev->dev, &ipu6_bus_pm_domain);

ret = auxiliary_device_init(auxdev);
if (ret < 0) {
Expand All @@ -120,6 +119,8 @@ ipu6_bus_initialize_device(struct pci_dev *pdev, struct device *parent,
return ERR_PTR(ret);
}

dev_pm_domain_set(&auxdev->dev, &ipu6_bus_pm_domain);

pm_runtime_forbid(&adev->auxdev.dev);
pm_runtime_enable(&adev->auxdev.dev);

Expand Down

0 comments on commit 80f82bc

Please sign in to comment.