accel/amdxdna: use modern PM helpers
PATCH 1/2 accel/amdxdna: use modern PM helpers
From: Arnd Bergmann <[email protected]>
The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause a build warning when CONFIG_PM is disabled:
drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function]
343 | static int amdxdna_pmops_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function]
328 | static int amdxdna_pmops_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~Change these to the modern replacements.
--- drivers/accel/amdxdna/amdxdna_pci_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/accel/amdxdna/amdxdna_pci_drv.c +2 -2
@@ -390,8 +390,8 @@ static int amdxdna_rpmops_resume(struct device *dev) }static const struct dev_pm_ops amdxdna_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(amdxdna_pmops_suspend, amdxdna_pmops_resume) -SET_RUNTIME_PM_OPS (amdxdna_rpmops_suspend, amdxdna_rpmops_resume,NULL ) + SYSTEM_SLEEP_PM_OPS(amdxdna_pmops_suspend, amdxdna_pmops_resume) +RUNTIME_PM_OPS (amdxdna_rpmops_suspend, amdxdna_rpmops_resume,NULL ) };static struct pci_driver amdxdna_pci_driver = {
Signature · 1 line
2.39.5
PATCH 2/2 accel/amdxdna: add missing includes
From: Arnd Bergmann <[email protected]>
This driver fails to build in random configurations:
drivers/accel/amdxdna/amdxdna_mailbox.c:357:8: error: unknown type name 'irqreturn_t'
357 | static irqreturn_t mailbox_irq_handler(int irq, void *p)
| ^~~~~~~~~~~
drivers/accel/amdxdna/amdxdna_mailbox.c: In function 'mailbox_irq_handler':
drivers/accel/amdxdna/amdxdna_mailbox.c:367:16: error: 'IRQ_HANDLED' undeclared (first use in this function)
367 | return IRQ_HANDLED;
| ^~~~~~~~~~~
drivers/accel/amdxdna/amdxdna_mailbox.c:367:16: note: each undeclared identifier is reported only once for each function it appears in
drivers/accel/amdxdna/amdxdna_mailbox.c: In function 'mailbox_rx_worker':
drivers/accel/amdxdna/amdxdna_mailbox.c:395:25: error: implicit declaration of function 'disable_irq'; did you mean 'disable_work'? [-Wimplicit-function-declaration]
395 | disable_irq(mb_chann->msix_irq);
| ^~~~~~~~~~~
drivers/accel/amdxdna/aie2_solver.c: In function 'remove_partition_node':
drivers/accel/amdxdna/aie2_solver.c:121:9: error: implicit declaration of function 'kfree' [-Wimplicit-function-declaration]
121 | kfree(pt_node);
| ^~~~~drivers/accel/amdxdna/aie2_solver.c: In function 'get_free_partition':drivers/accel/amdxdna/aie2_solver.c:153:19: error: implicit declaration of function 'kzalloc' [-Wimplicit-function-declaration]
153 | pt_node = kzalloc(sizeof(*pt_node), GFP_KERNEL);
Include the headers that have the necessary declarations.
amdxdna: includ linux/interrupt.h
--- drivers/accel/amdxdna/aie2_solver.c | 1 + drivers/accel/amdxdna/amdxdna_mailbox.c | 1 + 2 files changed, 2 insertions(+)
drivers/accel/amdxdna/aie2_solver.c +1 -0
@@ -8,6 +8,7 @@#include <drm/drm_print.h> #include <linux/bitops.h> #include <linux/bitmap.h> +#include <linux/slab.h> #include "aie2_solver.h"
drivers/accel/amdxdna/amdxdna_mailbox.c +1 -0
@@ -7,6 +7,7 @@#include <drm/drm_managed.h> #include <linux/bitfield.h> #include <linux/iopoll.h> +#include <linux/interrupt.h> #define CREATE_TRACE_POINTS #include <trace/events/amdxdna.h>
Signature · 1 line
2.39.5
Re: [PATCH 2/2] accel/amdxdna: add missing includes
Quoted 24 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
This driver fails to build in random configurations:
drivers/accel/amdxdna/amdxdna_mailbox.c:357:8: error: unknown type name 'irqreturn_t'
357 | staticirqreturn_tmailbox_irq_handler(int irq, void *p)| ^~~~~~~~~~~ drivers/accel/amdxdna/amdxdna_mailbox.c: In function 'mailbox_irq_handler': drivers/accel/amdxdna/amdxdna_mailbox.c:367:16: error: 'IRQ_HANDLED' undeclared (first use in this function) 367 | return IRQ_HANDLED; | ^~~~~~~~~~~ drivers/accel/amdxdna/amdxdna_mailbox.c:367:16: note: each undeclared identifier is reported only once for each function it appears in drivers/accel/amdxdna/amdxdna_mailbox.c: In function 'mailbox_rx_worker': drivers/accel/amdxdna/amdxdna_mailbox.c:395:25: error: implicit declaration of function 'disable_irq'; did you mean 'disable_work'? [-Wimplicit-function-declaration] 395 | disable_irq(mb_chann->msix_irq); | ^~~~~~~~~~~ drivers/accel/amdxdna/aie2_solver.c: In function 'remove_partition_node': drivers/accel/amdxdna/aie2_solver.c:121:9: error: implicit declaration of function 'kfree' [-Wimplicit-function-declaration] 121 | kfree(pt_node); | ^~~~~
drivers/accel/amdxdna/aie2_solver.c: In function 'get_free_partition':drivers/accel/amdxdna/aie2_solver.c:153:19: error: implicit declaration of function 'kzalloc' [-Wimplicit-function-declaration]
153 |pt_node=kzalloc(sizeof(*pt_node), GFP_KERNEL);
Quoted 8 lines
Include the headers that have the necessary declarations.
Fixes c88d3325ae69 ("accel/amdxdna: Add hardware resource solver")Signed-off-by Arnd Bergmann <[email protected]>amdxdna: includ
linux/interrupt.hSigned-off-by Arnd Bergmann <[email protected]>
The interrupt part of this is now fixed, see "accel/amdxdna: Add include interrupt.h to amdxdna_mailbox.c".
The slab portion looks sane. I'll trim the patch when applying unless you'd prefer something else.
Quoted 7 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The old
SET_SYSTEM_SLEEP_PM_OPSandSET_RUNTIME_PM_OPSmacros cause a build warning whenCONFIG_PMis disabled:
drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function]
343 | static intamdxdna_pmops_resume(struct device *dev)
Quoted 8 lines
| ^~~~~~~~~~~~~~~~~~~~ drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function] 328 | static int amdxdna_pmops_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~Change these to the modern replacements.
Signed-off-by Arnd Bergmann <[email protected]>
Looks sane to me.
Lizhi, can you verify that this works as expected for you? I'd hate to accidentally break something.
-Jeff
Lizhi Hou
maintainerQuoted 13 lines · Jeffrey Hugo
Quoted 12 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The old
SET_SYSTEM_SLEEP_PM_OPSandSET_RUNTIME_PM_OPSmacros cause a build warning whenCONFIG_PMis disabled:
drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function] 343 | static intamdxdna_pmops_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function] 328 | static intamdxdna_pmops_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~
Quoted 7 lines
Quoted 3 lines
Change these to the modern replacements.
Signed-off-by Arnd Bergmann <[email protected]>Looks sane to me.
Lizhi, can you verify that this works as expected for you? I'd hate to accidentally break something.
Verified suspend/resume. It works fine.
Lizhi
Quoted 3 lines
-Jeff
Quoted 17 lines · Lizhi Hou
Quoted 15 lines · Jeffrey Hugo
Quoted 14 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The old
SET_SYSTEM_SLEEP_PM_OPSandSET_RUNTIME_PM_OPSmacros cause a build warning whenCONFIG_PMis disabled:
drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function] 343 | static intamdxdna_pmops_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function] 328 | static intamdxdna_pmops_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~Change these to the modern replacements.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Arnd Bergmann <[email protected]>Looks sane to me.
Lizhi, can you verify that this works as expected for you? I'd hate to accidentally break something.
Verified suspend/resume. It works fine.
Excellent. Would you like to give a reviewed-by and/or a tested-by?
-Jeff
Quoted 20 lines · Jeffrey Hugo
Quoted 19 lines · Lizhi Hou
Quoted 17 lines · Jeffrey Hugo
Quoted 15 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The old
SET_SYSTEM_SLEEP_PM_OPSandSET_RUNTIME_PM_OPSmacros cause a build warning whenCONFIG_PMis disabled:
drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function] 343 | static intamdxdna_pmops_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function] 328 | static intamdxdna_pmops_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~Change these to the modern replacements.
Signed-off-by Arnd Bergmann <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Looks sane to me.
Lizhi, can you verify that this works as expected for you? I'd hate to accidentally break something.
Verified suspend/resume. It works fine.
Excellent. Would you like to give a reviewed-by and/or a tested-by?
Quoted 3 lines
-Jeff
Jeffrey Hugo
AppliedQuoted 26 lines · Lizhi Hou
Quoted 24 lines · Jeffrey Hugo
Quoted 23 lines · Lizhi Hou
Quoted 20 lines · Jeffrey Hugo
Quoted 12 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The old
SET_SYSTEM_SLEEP_PM_OPSandSET_RUNTIME_PM_OPSmacros cause a build warning whenCONFIG_PMis disabled:
drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function] 343 | static intamdxdna_pmops_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function] 328 | static intamdxdna_pmops_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~Quoted 3 lines
Change these to the modern replacements.
Signed-off-by Arnd Bergmann <[email protected]>Looks sane to me.
Lizhi, can you verify that this works as expected for you? I'd hate to accidentally break something.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Verified suspend/resume. It works fine.
Excellent. Would you like to give a reviewed-by and/or a tested-by?
Reviewed-by Lizhi Hou <[email protected]>Tested-by Lizhi Hou <[email protected]>
Thanks!
Pushed to drm-misc-next
-Jeff