drm/panthor: Fix 3 issues reported by the kernel test bot
Subsystems (3)
Boris Brezillon
maintainercover drm/panthor: Fix 3 issues reported by the kernel test bot
Hello,
Here are three trivial fixes for bugs reported by the intel kernel test bot.
Regards,
Boris
Boris Brezillon (3):
drm/panthor: Fix panthor_devfreq kerneldoc
drm/panthor: Explicitly include page.h for the {virt,__phys)_to_pfn()
defs
drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
drivers/gpu/drm/panthor/Kconfig | 1 + drivers/gpu/drm/panthor/panthor_devfreq.c | 2 +- drivers/gpu/drm/panthor/panthor_device.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
Boris Brezillon
maintainerPATCH 1/3 drm/panthor: Fix panthor_devfreq kerneldoc
Missing '*' to have a valid kerneldoc prefix.
--- drivers/gpu/drm/panthor/panthor_devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panthor/panthor_devfreq.c +1 -1
@@ -34,7 +34,7 @@ struct panthor_devfreq {/** @last_busy_state: True if the GPU was busy last time we updated the state. */ bool last_busy_state; -/* +/** * @lock: Lock used to protect busy_time, idle_time, time_last_update and * last_busy_state. *
Signature · 1 line
2.43.0
Liviu Dudau
maintainerRe: [PATCH 1/3] drm/panthor: Fix panthor_devfreq kerneldoc
Quoted 5 lines · Boris Brezillon
Missing '*' to have a valid kerneldoc prefix.
LGTM :)
Best regards,
Liviu
Quoted 20 lines
--- drivers/gpu/drm/panthor/panthor_devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panthor/panthor_devfreq.c +1
-1@@ -34,7 +34,7 @@ struct panthor_devfreq {/** @last_busy_state: True if the GPU was busy last time we updated the state. */ bool last_busy_state; -/* +/** * @lock: Lock used to protect busy_time, idle_time, time_last_update and * last_busy_state. * Signature · 1 line
2.43.0
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯Re: [PATCH 1/3] drm/panthor: Fix panthor_devfreq kerneldoc
In reply to Boris BrezillonQuoted 5 lines · Boris Brezillon
Missing '*' to have a valid kerneldoc prefix.
Quoted 17 lines
--- drivers/gpu/drm/panthor/panthor_devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panthor/panthor_devfreq.c +1
-1@@ -34,7 +34,7 @@ struct panthor_devfreq {/** @last_busy_state: True if the GPU was busy last time we updated the state. */ bool last_busy_state; -/* +/** * @lock: Lock used to protect busy_time, idle_time, time_last_update and * last_busy_state. *
Boris Brezillon
maintainerPATCH 2/3 drm/panthor: Explicitly include page.h for the {virt, __phys)_to_pfn() defs
In reply to Boris BrezillonSomething on arm[64] must be including <asm/page.h>, but things fail to compile on sparc64. Make sure this header is included explicitly so this driver can be compile-tested on all supported architectures.
--- drivers/gpu/drm/panthor/panthor_device.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/panthor/panthor_device.c +2 -0
@@ -3,6 +3,8 @@/* Copyright 2019 Linaro, Ltd, Rob Herring <[email protected]> */ /* Copyright 2023 Collabora ltd. */ +#include <asm/page.h> +#include <linux/clk.h> #include <linux/platform_device.h> #include <linux/pm_domain.h>
Signature · 1 line
2.43.0
Re: [PATCH 2/3] drm/panthor: Explicitly include page.h for the {virt,__phys)_to_pfn() defs
Quoted 3 lines · Boris Brezillon
Something on arm[64] must be including <
asm/page.h>, but things fail to compile on sparc64. Make sure this header is included explicitly so this driver can be compile-tested on all supported architectures.
Is compilation on sparc64 possible because of 'depends on COMPILE_TEST'? Otherwise it doesn't make sense to try to build this for any arch other than arm[64].
Regardless, patch looks harmless, so
Best regards,
Liviu
Quoted 24 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Boris Brezillon <[email protected]>--- drivers/gpu/drm/panthor/panthor_device.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/panthor/panthor_device.c +2
-0@@ -3,6 +3,8 @@/* Copyright 2019 Linaro, Ltd, Rob Herring <[email protected]> */ /* Copyright 2023 Collabora ltd. */ +#include <asm/page.h> +#include <linux/clk.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> Signature · 1 line
2.43.0
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯Boris Brezillon
maintainerRe: [PATCH 2/3] drm/panthor: Explicitly include page.h for the {virt,__phys)_to_pfn() defs
Quoted 6 lines · On Mon, 4 Mar 2024 11:16:48 +0000 Liviu Dudau <[email protected]> wrote:
Quoted 3 lines · Boris Brezillon
Something on arm[64] must be including <
asm/page.h>, but things fail to compile on sparc64. Make sure this header is included explicitly so this driver can be compile-tested on all supported architectures.Is compilation on sparc64 possible because of 'depends on
COMPILE_TEST'?
Yes.
Quoted 35 lines
Otherwise it doesn't make sense to try to build this for any arch other than arm[64].
Regardless, patch looks harmless, so
Reviewed-by Liviu Dudau <[email protected]>Best regards,
LiviuQuoted 24 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Boris Brezillon <[email protected]>--- drivers/gpu/drm/panthor/panthor_device.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/panthor/panthor_device.c +2
-0@@ -3,6 +3,8 @@/* Copyright 2019 Linaro, Ltd, Rob Herring <[email protected]> */ /* Copyright 2023 Collabora ltd. */ +#include <asm/page.h> +#include <linux/clk.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> Signature · 1 line
2.43.0
Re: [PATCH 2/3] drm/panthor: Explicitly include page.h for the {virt,__phys)_to_pfn() defs
In reply to Boris BrezillonQuoted 7 lines · Boris Brezillon
Something on arm[64] must be including <
asm/page.h>, but things fail to compile on sparc64. Make sure this header is included explicitly so this driver can be compile-tested on all supported architectures.
Seems reasonable, although I do wonder if it's right to include a "asm" header here or if we should pull in something like "linux/mm.h" which includes asm/page.h. I can find examples of both. Either way:
Quoted 17 lines
--- drivers/gpu/drm/panthor/panthor_device.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/panthor/panthor_device.c +2
-0@@ -3,6 +3,8 @@/* Copyright 2019 Linaro, Ltd, Rob Herring <[email protected]> */ /* Copyright 2023 Collabora ltd. */ +#include <asm/page.h> +#include <linux/clk.h> #include <linux/platform_device.h> #include <linux/pm_domain.h>
Boris Brezillon
maintainerRe: [PATCH 2/3] drm/panthor: Explicitly include page.h for the {virt,__phys)_to_pfn() defs
Quoted 5 lines · On Mon, 4 Mar 2024 12:31:23 +0000 Steven Price <[email protected]> wrote:
Quoted 4 lines · Boris Brezillon
Something on arm[64] must be including <
asm/page.h>, but things fail to compile on sparc64. Make sure this header is included explicitly so this driver can be compile-tested on all supported architectures.
Quoted 7 lines
Quoted 3 lines
Seems reasonable, although I do wonder if it's right to include a "asm" header here or if we should pull in something like "
linux/mm.h" which includesasm/page.h. I can find examples of both. Either way:
Actually, I considered including linux/mm.h too, so I'm happy to go for this option (will fix when applying.
Quoted 21 lines
Reviewed-by Steven Price <[email protected]>Quoted 17 lines
--- drivers/gpu/drm/panthor/panthor_device.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/panthor/panthor_device.c +2
-0@@ -3,6 +3,8 @@/* Copyright 2019 Linaro, Ltd, Rob Herring <[email protected]> */ /* Copyright 2023 Collabora ltd. */ +#include <asm/page.h> +#include <linux/clk.h> #include <linux/platform_device.h> #include <linux/pm_domain.h>
Boris Brezillon
maintainerPATCH 3/3 drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
In reply to Boris Brezillonpanthor_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.
--- drivers/gpu/drm/panthor/Kconfig | 1 + drivers/gpu/drm/panthor/panthor_device.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/panthor/Kconfig +1 -0
@@ -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
drivers/gpu/drm/panthor/panthor_device.c +0 -2
@@ -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
Signature · 1 line
2.43.0
Re: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 10 lines · Boris Brezillon
panthor_device_resume/suspend() are only compiled when
CONFIG_PMis enabled butpanthro_drv.cdoesn't use thepm_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 ofCONFIG_PMwith aKconfigdependency instead.
Quoted 5 lines
If someone needs to relax this dependency, it can be done in a follow-up.
Agree on this, there is no point on running on kernels without CONFIG_PM enabled.
Best regards,
Liviu
Quoted 37 lines
--- drivers/gpu/drm/panthor/Kconfig | 1 + drivers/gpu/drm/panthor/panthor_device.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/panthor/Kconfig +1
-0@@ -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_HELPERdrivers/gpu/drm/panthor/panthor_device.c +0
-2@@ -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 Signature · 1 line
2.43.0
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯Re: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
In reply to Boris BrezillonQuoted 10 lines · Boris Brezillon
panthor_device_resume/suspend() are only compiled when
CONFIG_PMis enabled butpanthro_drv.cdoesn't use thepm_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 ofCONFIG_PMwith aKconfigdependency instead.
Quoted 5 lines
If someone needs to relax this dependency, it can be done in a follow-up.
Seems reasonable, it should be easy to relax the CONFIG_PM condition in the future if anyone has an actual need.
Quoted 34 lines
--- drivers/gpu/drm/panthor/Kconfig | 1 + drivers/gpu/drm/panthor/panthor_device.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/panthor/Kconfig +1
-0@@ -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_HELPERdrivers/gpu/drm/panthor/panthor_device.c +0
-2@@ -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
Re: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
In reply to Boris BrezillonQuoted 11 lines · Boris Brezillon
panthor_device_resume/suspend() are only compiled when
CONFIG_PMis enabled butpanthro_drv.cdoesn't use thepm_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 ofCONFIG_PMwith aKconfigdependency 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_PANTHORdrivers/gpu/drm/panthor/Kconfig:3: symbol DRM_PANTHOR depends on PMkernel/power/Kconfig:183: symbol PM is selected by PM_SLEEPkernel/power/Kconfig:117: symbol PM_SLEEP depends on HIBERNATE_CALLBACKSkernel/power/Kconfig:35: symbol HIBERNATE_CALLBACKS is selected by XEN_SAVE_RESTOREarch/x86/xen/Kconfig:67: symbol XEN_SAVE_RESTORE depends on XENarch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRTarch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERVdrivers/hv/Kconfig:5: symbol HYPERV depends on X86_LOCAL_APICarch/x86/Kconfig:1106: symbol X86_LOCAL_APIC depends on X86_UP_APICarch/x86/Kconfig:1081: symbol X86_UP_APIC prompt is visible depending on PCI_MSIdrivers/pci/Kconfig:39: symbol PCI_MSI is selected by AMD_IOMMUdrivers/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.
Quoted 38 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Boris Brezillon <[email protected]>--- drivers/gpu/drm/panthor/Kconfig | 1 + drivers/gpu/drm/panthor/panthor_device.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/panthor/Kconfig +1
-0@@ -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_HELPERdrivers/gpu/drm/panthor/panthor_device.c +0
-2@@ -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
Signature · 1 line
Jani Nikula, Intel
Boris Brezillon
maintainerRe: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 18 lines · On Mon, 11 Mar 2024 13:05:01 +0200 Jani Nikula <[email protected]>…
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected!drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHORdrivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PMkernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKSkernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTOREarch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends on XENarch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRTarch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERVdrivers/hv/Kconfig:5: symbol HYPERV depends onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APICarch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSIdrivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORT
Uh, I guess we want a "depends on IOMMU_SUPPORT" instead of "select IOMMU_SUPPORT" in panthor then.
Quoted 2 lines
For a resolution refer to
Documentation/kbuild/kconfig-language.rstsubsection "Kconfigrecursive dependency limitations"
Re: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 22 lines · Boris Brezillon
Quoted 18 lines · On Mon, 11 Mar 2024 13:05:01 +0200 Jani Nikula <[email protected]>…
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected!drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHORdrivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PMkernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKSkernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTOREarch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends on XENarch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRTarch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERVdrivers/hv/Kconfig:5: symbol HYPERV depends onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APICarch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSIdrivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORT
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.
That works for me.
Quoted 3 lines
Quoted 3 lines
For a resolution refer to
Documentation/kbuild/kconfig-language.rstsubsection "Kconfigrecursive dependency limitations"
Signature · 1 line
Jani Nikula, Intel
Boris Brezillon
maintainerRe: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 23 lines · On Mon, 11 Mar 2024 13:49:56 +0200 Jani Nikula <[email protected]>…
Quoted 22 lines · Boris Brezillon
Quoted 18 lines · On Mon, 11 Mar 2024 13:05:01 +0200 Jani Nikula <[email protected]>…
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected!drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHORdrivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PMkernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKSkernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTOREarch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends on XENarch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRTarch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERVdrivers/hv/Kconfig:5: symbol HYPERV depends onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APICarch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSIdrivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORT
Quoted 4 lines
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.That works for me.
Let's revert the faulty commit first. We'll see if Steve has a different solution for the original issue.
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
For a resolution refer to
Documentation/kbuild/kconfig-language.rstsubsection "Kconfigrecursive dependency limitations"
Re: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 26 lines · Boris Brezillon
Quoted 23 lines · On Mon, 11 Mar 2024 13:49:56 +0200 Jani Nikula <[email protected]>…
Quoted 22 lines · Boris Brezillon
Quoted 18 lines · On Mon, 11 Mar 2024 13:05:01 +0200 Jani Nikula <[email protected]>…
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected!drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHORdrivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PMkernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKSkernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTOREarch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends on XENarch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRTarch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERVdrivers/hv/Kconfig:5: symbol HYPERV depends onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APICarch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSIdrivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORT
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.That works for me.
Let's revert the faulty commit first. We'll see if Steve has a different solution for the original issue.
FWIW, the reasoning in the offending commit seems incredibly tenuous. There are far more practical reasons for building an arm/arm64 kernel without PM - for debugging or whatever, and where one may even still want a usable GPU, let alone just a non-broken build - than there are for building this driver for x86. Using pm_ptr() is trivial, and if you want to support COMPILE_TEST then there's really no justifiable excuse not to.
Thanks,
Robin.
Boris Brezillon
maintainerRe: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 35 lines · On Mon, 11 Mar 2024 13:11:28 +0000 Robin Murphy <[email protected]> wrote:
Quoted 26 lines · Boris Brezillon
Quoted 23 lines · On Mon, 11 Mar 2024 13:49:56 +0200 Jani Nikula <[email protected]>…
Quoted 22 lines · Boris Brezillon
Quoted 18 lines · On Mon, 11 Mar 2024 13:05:01 +0200 Jani Nikula <[email protected]>…
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected!drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHORdrivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PMkernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKSkernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTOREarch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends on XENarch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRTarch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERVdrivers/hv/Kconfig:5: symbol HYPERV depends onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APICarch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSIdrivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORTQuoted 7 lines
Quoted 4 lines
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.That works for me.
Let's revert the faulty commit first. We'll see if Steve has a different solution for the original issue.
Quoted 7 lines
FWIW, the reasoning in the offending commit seems incredibly tenuous. There are far more practical reasons for building an arm/arm64 kernel without PM - for debugging or whatever, and where one may even still want a usable GPU, let alone just a non-broken build - than there are for building this driver for x86. Using
pm_ptr()is trivial, and if you want to supportCOMPILE_TESTthen there's really no justifiable excuse not to.
The problem is not just about using pm_ptr(), but also making sure panthor_device_resume/suspend() are called called in the init/unplug path when !PM, as I don't think the PM helpers automate that for us. I was just aiming for a simple fix that wouldn't force me to test the !PM case...
Quoted 3 lines
Thanks,
Robin.
Re: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 46 lines · Boris Brezillon
Quoted 35 lines · On Mon, 11 Mar 2024 13:11:28 +0000 Robin Murphy <[email protected]> wrote:
Quoted 26 lines · Boris Brezillon
Quoted 23 lines · On Mon, 11 Mar 2024 13:49:56 +0200 Jani Nikula <[email protected]>…
Quoted 22 lines · Boris Brezillon
Quoted 18 lines · On Mon, 11 Mar 2024 13:05:01 +0200 Jani Nikula <[email protected]>…
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected!drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHORdrivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PMkernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKSkernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTOREarch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends on XENarch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRTarch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERVdrivers/hv/Kconfig:5: symbol HYPERV depends onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APICarch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSIdrivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORTQuoted 7 lines
Quoted 4 lines
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.That works for me.
Let's revert the faulty commit first. We'll see if Steve has a different solution for the original issue.
Quoted 7 lines
FWIW, the reasoning in the offending commit seems incredibly tenuous. There are far more practical reasons for building an arm/arm64 kernel without PM - for debugging or whatever, and where one may even still want a usable GPU, let alone just a non-broken build - than there are for building this driver for x86. Using
pm_ptr()is trivial, and if you want to supportCOMPILE_TESTthen there's really no justifiable excuse not to.
Quoted 5 lines
The problem is not just about using
pm_ptr(), but also making sure panthor_device_resume/suspend() are called called in the init/unplug path when !PM, as I don't think the PM helpers automate that for us. I was just aiming for a simple fix that wouldn't force me to test the !PM case...
Fair enough, at worst we could always have a runtime check and refuse to probe in conditions we don't think are worth the bother of implementing fully-functional support for. However if we want to make an argument for only supporting "realistic" configs at build time then that is an argument for dropping COMPILE_TEST as well.
Thanks,
Robin.
Steven Price
maintainerRe: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 60 lines · Robin Murphy
Quoted 54 lines · Boris Brezillon
Quoted 43 lines · On Mon, 11 Mar 2024 13:11:28 +0000 Robin Murphy <[email protected]> wrote:
Quoted 34 lines · Boris Brezillon
On Mon, 11 Mar 2024 13:49:56 +0200
Jani Nikula <[email protected]> wrote:Quoted 31 lines
Quoted 29 lines · Boris Brezillon
On Mon, 11 Mar 2024 13:05:01 +0200
Jani Nikula <[email protected]> wrote:Quoted 25 lines
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected! drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHOR
drivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PM
kernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKS
kernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTORE
arch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends 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 onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APIC
arch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSI
drivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORTQuoted 7 lines
Quoted 4 lines
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.That works for me.
Let's revert the faulty commit first. We'll see if Steve has a different solution for the original issue.
Quoted 7 lines
FWIW, the reasoning in the offending commit seems incredibly tenuous. There are far more practical reasons for building an arm/arm64 kernel without PM - for debugging or whatever, and where one may even still want a usable GPU, let alone just a non-broken build - than there are for building this driver for x86. Using
pm_ptr()is trivial, and if you want to supportCOMPILE_TESTthen there's really no justifiable excuse not to.Quoted 5 lines
The problem is not just about using
pm_ptr(), but also making sure panthor_device_resume/suspend() are called called in the init/unplug path when !PM, as I don't think the PM helpers automate that for us. I was just aiming for a simple fix that wouldn't force me to test the !PM case...
Quoted 5 lines
Fair enough, at worst we could always have a runtime check and refuse to probe in conditions we don't think are worth the bother of implementing fully-functional support for. However if we want to make an argument for only supporting "realistic" configs at build time then that is an argument for dropping
COMPILE_TESTas well.
Can we just replace the "depends on PM" with "select PM"? In my (admittedly very limited) testing this works. Otherwise I think we need to bite the bullet and support !PM in some way (maybe just as Robin suggests with a runtime bail out).
Steve
Boris Brezillon
maintainerRe: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 67 lines · On Mon, 11 Mar 2024 13:46:23 +0000 Steven Price <[email protected]> wrote:
Quoted 60 lines · Robin Murphy
Quoted 54 lines · Boris Brezillon
Quoted 43 lines · On Mon, 11 Mar 2024 13:11:28 +0000 Robin Murphy <[email protected]> wrote:
Quoted 34 lines · Boris Brezillon
On Mon, 11 Mar 2024 13:49:56 +0200
Jani Nikula <[email protected]> wrote:Quoted 31 lines
Quoted 29 lines · Boris Brezillon
On Mon, 11 Mar 2024 13:05:01 +0200
Jani Nikula <[email protected]> wrote:Quoted 25 lines
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected! drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHOR
drivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PM
kernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKS
kernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTORE
arch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends 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 onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APIC
arch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSI
drivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORTQuoted 7 lines
Quoted 4 lines
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.That works for me.
Let's revert the faulty commit first. We'll see if Steve has a different solution for the original issue.
Quoted 7 lines
FWIW, the reasoning in the offending commit seems incredibly tenuous. There are far more practical reasons for building an arm/arm64 kernel without PM - for debugging or whatever, and where one may even still want a usable GPU, let alone just a non-broken build - than there are for building this driver for x86. Using
pm_ptr()is trivial, and if you want to supportCOMPILE_TESTthen there's really no justifiable excuse not to.Quoted 5 lines
The problem is not just about using
pm_ptr(), but also making sure panthor_device_resume/suspend() are called called in the init/unplug path when !PM, as I don't think the PM helpers automate that for us. I was just aiming for a simple fix that wouldn't force me to test the !PM case...Quoted 5 lines
Fair enough, at worst we could always have a runtime check and refuse to probe in conditions we don't think are worth the bother of implementing fully-functional support for. However if we want to make an argument for only supporting "realistic" configs at build time then that is an argument for dropping
COMPILE_TESTas well.
Quoted 4 lines
Can we just replace the "depends on PM" with "select PM"? In my (admittedly very limited) testing this works. Otherwise I think we need to bite the bullet and support !PM in some way (maybe just as Robin suggests with a runtime bail out).
I won't have time to test it this week, but if someone is interested, here's a diff implementing manual resume/suspend in the init/unplug path:
--->8---
Boris Brezillon
maintainerRe: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 75 lines · On Mon, 11 Mar 2024 14:58:37 +0100 Boris Brezillon…
Quoted 67 lines · On Mon, 11 Mar 2024 13:46:23 +0000 Steven Price <[email protected]> wrote:
Quoted 60 lines · Robin Murphy
Quoted 54 lines · Boris Brezillon
Quoted 43 lines · On Mon, 11 Mar 2024 13:11:28 +0000 Robin Murphy <[email protected]> wrote:
Quoted 34 lines · Boris Brezillon
On Mon, 11 Mar 2024 13:49:56 +0200
Jani Nikula <[email protected]> wrote:Quoted 31 lines
Quoted 29 lines · Boris Brezillon
On Mon, 11 Mar 2024 13:05:01 +0200
Jani Nikula <[email protected]> wrote:Quoted 25 lines
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected! drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHOR
drivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PM
kernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKS
kernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTORE
arch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends 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 onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APIC
arch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSI
drivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORTQuoted 7 lines
Quoted 4 lines
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.That works for me.
Let's revert the faulty commit first. We'll see if Steve has a different solution for the original issue.
Quoted 7 lines
FWIW, the reasoning in the offending commit seems incredibly tenuous. There are far more practical reasons for building an arm/arm64 kernel without PM - for debugging or whatever, and where one may even still want a usable GPU, let alone just a non-broken build - than there are for building this driver for x86. Using
pm_ptr()is trivial, and if you want to supportCOMPILE_TESTthen there's really no justifiable excuse not to.Quoted 5 lines
The problem is not just about using
pm_ptr(), but also making sure panthor_device_resume/suspend() are called called in the init/unplug path when !PM, as I don't think the PM helpers automate that for us. I was just aiming for a simple fix that wouldn't force me to test the !PM case...Quoted 5 lines
Fair enough, at worst we could always have a runtime check and refuse to probe in conditions we don't think are worth the bother of implementing fully-functional support for. However if we want to make an argument for only supporting "realistic" configs at build time then that is an argument for dropping
COMPILE_TESTas well.Quoted 4 lines
Can we just replace the "depends on PM" with "select PM"? In my (admittedly very limited) testing this works. Otherwise I think we need to bite the bullet and support !PM in some way (maybe just as Robin suggests with a runtime bail out).
Quoted 5 lines
I won't have time to test it this week, but if someone is interested, here's a diff implementing manual resume/suspend in the init/unplug path:
--->8---
This time with the diff :-)
--->8---
drivers/gpu/drm/panthor/panthor_device.c +11 -0
@@ -87,6 +87,10 @@ void panthor_device_unplug(struct panthor_device *ptdev)pm_runtime_dont_use_autosuspend (ptdev->base.dev);pm_runtime_put_sync_suspend (ptdev->base.dev); +/* If PM is disabled, we need to call the suspend handler manually. */ +if (!IS_ENABLED (CONFIG_PM )) +panthor_device_suspend (ptdev->base.dev); +/* Report the unplug operation as done to unblock concurrent * panthor_device_unplug() callers. */
@@ -218,6 +222,13 @@ int panthor_device_init(struct panthor_device *ptdev)if (ret)return ret; +/* If PM is disabled, we need to call panthor_device_resume() manually. */ +if (!IS_ENABLED (CONFIG_PM )) { + ret =panthor_device_resume (ptdev->base.dev); +if (ret) +return ret; + } + ret =panthor_gpu_init (ptdev);if (ret) goto err_rpm_put;
drivers/gpu/drm/panthor/panthor_drv.c +3 -1
@@ -1407,17 +1407,19 @@ static const struct of_device_id dt_match[] = { };MODULE_DEVICE_TABLE (of, dt_match); +#ifdef CONFIG_PM static DEFINE_RUNTIME_DEV_PM_OPS(panthor_pm_ops, panthor_device_suspend, panthor_device_resume, NULL); +#endif static struct platform_driver panthor_driver = { .probe = panthor_probe, .remove_new = panthor_remove, .driver = { .name ="panthor" , - .pm = &panthor_pm_ops, + .pm =pm_ptr (&panthor_pm_ops), .of_match_table = dt_match, }, };
Boris Brezillon
maintainerRe: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Quoted 106 lines · On Mon, 11 Mar 2024 14:59:39 +0100 Boris Brezillon…
Quoted 75 lines · On Mon, 11 Mar 2024 14:58:37 +0100 Boris Brezillon…
Quoted 67 lines · On Mon, 11 Mar 2024 13:46:23 +0000 Steven Price <[email protected]> wrote:
Quoted 60 lines · Robin Murphy
Quoted 54 lines · Boris Brezillon
Quoted 43 lines · On Mon, 11 Mar 2024 13:11:28 +0000 Robin Murphy <[email protected]> wrote:
Quoted 34 lines · Boris Brezillon
On Mon, 11 Mar 2024 13:49:56 +0200
Jani Nikula <[email protected]> wrote:Quoted 31 lines
Quoted 29 lines · Boris Brezillon
On Mon, 11 Mar 2024 13:05:01 +0200
Jani Nikula <[email protected]> wrote:Quoted 25 lines
This breaks the config for me:
SYNC
include/config/auto.conf.cmd
GENMakefile
drivers/iommu/Kconfig:14:error: recursive dependency detected! drivers/iommu/Kconfig:14: symbolIOMMU_SUPPORTis selected byDRM_PANTHOR
drivers/gpu/drm/panthor/Kconfig:3: symbolDRM_PANTHORdepends on PM
kernel/power/Kconfig:183: symbol PM is selected byPM_SLEEPkernel/power/Kconfig:117: symbolPM_SLEEPdepends onHIBERNATE_CALLBACKS
kernel/power/Kconfig:35: symbolHIBERNATE_CALLBACKSis selected byXEN_SAVE_RESTORE
arch/x86/xen/Kconfig:67: symbolXEN_SAVE_RESTOREdepends 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 onX86_LOCAL_APICarch/x86/Kconfig:1106: symbolX86_LOCAL_APICdepends onX86_UP_APIC
arch/x86/Kconfig:1081: symbolX86_UP_APICprompt is visible depending onPCI_MSI
drivers/pci/Kconfig:39: symbolPCI_MSIis selected byAMD_IOMMUdrivers/iommu/amd/Kconfig:3: symbolAMD_IOMMUdepends onIOMMU_SUPPORTQuoted 7 lines
Quoted 4 lines
Quoted 2 lines
Uh, I guess we want a "depends on
IOMMU_SUPPORT" instead of "selectIOMMU_SUPPORT" in panthor then.That works for me.
Let's revert the faulty commit first. We'll see if Steve has a different solution for the original issue.
Quoted 7 lines
FWIW, the reasoning in the offending commit seems incredibly tenuous. There are far more practical reasons for building an arm/arm64 kernel without PM - for debugging or whatever, and where one may even still want a usable GPU, let alone just a non-broken build - than there are for building this driver for x86. Using
pm_ptr()is trivial, and if you want to supportCOMPILE_TESTthen there's really no justifiable excuse not to.Quoted 5 lines
The problem is not just about using
pm_ptr(), but also making sure panthor_device_resume/suspend() are called called in the init/unplug path when !PM, as I don't think the PM helpers automate that for us. I was just aiming for a simple fix that wouldn't force me to test the !PM case...Quoted 5 lines
Fair enough, at worst we could always have a runtime check and refuse to probe in conditions we don't think are worth the bother of implementing fully-functional support for. However if we want to make an argument for only supporting "realistic" configs at build time then that is an argument for dropping
COMPILE_TESTas well.Quoted 4 lines
Can we just replace the "depends on PM" with "select PM"? In my (admittedly very limited) testing this works. Otherwise I think we need to bite the bullet and support !PM in some way (maybe just as Robin suggests with a runtime bail out).
Quoted 5 lines
I won't have time to test it this week, but if someone is interested, here's a diff implementing manual resume/suspend in the init/unplug path:
--->8---
This time with the diff :-)
--->8---
drivers/gpu/drm/panthor/panthor_device.c +4
-0@@ -87,6 +87,10 @@ void panthor_device_unplug(struct panthor_device *ptdev)pm_runtime_dont_use_autosuspend (ptdev->base.dev);pm_runtime_put_sync_suspend (ptdev->base.dev); +/* If PM is disabled, we need to call the suspend handler manually. */ +if (!IS_ENABLED (CONFIG_PM )) +panthor_device_suspend (ptdev->base.dev); +/* Report the unplug operation as done to unblock concurrent * panthor_device_unplug() callers. */ @@ -218,6 +222,13 @@ int panthor_device_init(struct panthor_device *ptdev)if (ret)return ret;
drivers/gpu/drm/panthor/panthor_device.c int panthor_device_init(struct panthor_device *ptdev) · line 234
Quoted 10 lines
drivers/gpu/drm/panthor/panthor_device.c +7
-0+/* If PM is disabled, we need to call panthor_device_resume() manually. */ +if (!IS_ENABLED (CONFIG_PM )) { + ret =panthor_device_resume (ptdev->base.dev); +if (ret) +return ret; + } + ret =panthor_gpu_init (ptdev);if (ret) goto err_rpm_put;
And I forgot to remove the #ifdef CONFIG_PM in panthor_device.c.
Quoted 25 lines
drivers/gpu/drm/panthor/panthor_drv.c +3
-1@@ -1407,17 +1407,19 @@ static const struct of_device_id dt_match[] = { };MODULE_DEVICE_TABLE (of, dt_match); +#ifdef CONFIG_PM static DEFINE_RUNTIME_DEV_PM_OPS(panthor_pm_ops, panthor_device_suspend, panthor_device_resume, NULL); +#endif static struct platform_driver panthor_driver = { .probe = panthor_probe, .remove_new = panthor_remove, .driver = { .name ="panthor" , - .pm = &panthor_pm_ops, + .pm =pm_ptr (&panthor_pm_ops), .of_match_table = dt_match, }, };
Quoted 7 lines · On Mon, 4 Mar 2024 10:08:09 +0100 Boris Brezillon…
Hello,
Here are three trivial fixes for bugs reported by the intel kernel test bot.
Regards,
Quoted 7 lines
Boris
Boris Brezillon (3):
drm/panthor: Fixpanthor_devfreqkerneldoc
drm/panthor: Explicitly includepage.hfor the {virt,__phys)_to_pfn()
defs
drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue
Queued to drm-misc-next.
Quoted 6 lines
drivers/gpu/drm/panthor/Kconfig | 1 + drivers/gpu/drm/panthor/panthor_devfreq.c | 2 +- drivers/gpu/drm/panthor/panthor_device.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-)