From 80f82bc3b45fc20e152a9a3dceeb08d5773e50ad Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sat, 2 Sep 2023 16:34:09 +0200 Subject: [PATCH] media: ipu6-bus: Set pm-domain later 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+ #28 [ 61.381547] Hardware name: LENOVO 21HQSIT025/21HQSIT025, BIOS N3XET37W (1.12 ) 04/18/2023 [ 61.381548] Call Trace: [ 61.381550] [ 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] Signed-off-by: Hans de Goede --- drivers/media/pci/intel/ipu6/ipu6-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ipu6/ipu6-bus.c b/drivers/media/pci/intel/ipu6/ipu6-bus.c index 0e58accf0654e4..bb9cb2c67a1e25 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-bus.c +++ b/drivers/media/pci/intel/ipu6/ipu6-bus.c @@ -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) { @@ -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);