On Mon, 04 Mar 2024, Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> wrote: > panthor_device_resume/suspend() are only compiled when CONFIG_PM is > enabled but panthro_drv.c doesn't use the pm_ptr() macro to conditionally > discard resume/suspend assignments, which causes undefined symbol > errors at link time when !PM. > > We could fix that by using pm_ptr(), but supporting the !PM case makes > little sense (the whole point of these embedded GPUs is to be low power, > so proper PM is a basic requirement in that case). So let's just enforce > the presence of CONFIG_PM with a Kconfig dependency instead. > > If someone needs to relax this dependency, it can be done in a follow-up. This breaks the config for me: SYNC include/config/auto.conf.cmd GEN Makefile drivers/iommu/Kconfig:14:error: recursive dependency detected! drivers/iommu/Kconfig:14: symbol IOMMU_SUPPORT is selected by DRM_PANTHOR drivers/gpu/drm/panthor/Kconfig:3: symbol DRM_PANTHOR depends on PM kernel/power/Kconfig:183: symbol PM is selected by PM_SLEEP kernel/power/Kconfig:117: symbol PM_SLEEP depends on HIBERNATE_CALLBACKS kernel/power/Kconfig:35: symbol HIBERNATE_CALLBACKS is selected by XEN_SAVE_RESTORE arch/x86/xen/Kconfig:67: symbol XEN_SAVE_RESTORE depends on XEN arch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRT arch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERV drivers/hv/Kconfig:5: symbol HYPERV depends on X86_LOCAL_APIC arch/x86/Kconfig:1106: symbol X86_LOCAL_APIC depends on X86_UP_APIC arch/x86/Kconfig:1081: symbol X86_UP_APIC prompt is visible depending on PCI_MSI drivers/pci/Kconfig:39: symbol PCI_MSI is selected by AMD_IOMMU drivers/iommu/amd/Kconfig:3: symbol AMD_IOMMU depends on IOMMU_SUPPORT For a resolution refer to Documentation/kbuild/kconfig-language.rst subsection "Kconfig recursive dependency limitations" BR, Jani. > > Reported-by: kernel test robot <lkp@xxxxxxxxx> > Closes: https://lore.kernel.org/oe-kbuild-all/202403031944.EOimQ8WK-lkp@xxxxxxxxx/ > Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> > --- > drivers/gpu/drm/panthor/Kconfig | 1 + > drivers/gpu/drm/panthor/panthor_device.c | 2 -- > 2 files changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/Kconfig b/drivers/gpu/drm/panthor/Kconfig > index 55b40ad07f3b..fdce7c1b2310 100644 > --- a/drivers/gpu/drm/panthor/Kconfig > +++ b/drivers/gpu/drm/panthor/Kconfig > @@ -6,6 +6,7 @@ config DRM_PANTHOR > depends on ARM || ARM64 || COMPILE_TEST > depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE > depends on MMU > + depends on PM > select DEVFREQ_GOV_SIMPLE_ONDEMAND > select DRM_EXEC > select DRM_GEM_SHMEM_HELPER > diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c > index 68e467ee458a..efea29143a54 100644 > --- a/drivers/gpu/drm/panthor/panthor_device.c > +++ b/drivers/gpu/drm/panthor/panthor_device.c > @@ -403,7 +403,6 @@ int panthor_device_mmap_io(struct panthor_device *ptdev, struct vm_area_struct * > return 0; > } > > -#ifdef CONFIG_PM > int panthor_device_resume(struct device *dev) > { > struct panthor_device *ptdev = dev_get_drvdata(dev); > @@ -548,4 +547,3 @@ int panthor_device_suspend(struct device *dev) > mutex_unlock(&ptdev->pm.mmio_lock); > return ret; > } > -#endif -- Jani Nikula, Intel