Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] pm: dev_pm_ops and runtime callbacks lack pm_ptr() wrappers
--

commit 43e22dab09d226fdbeb4b68267732652cfce0172
Author: David Zhang <[email protected]>

accel/amdxdna: Implement runtime suspend and resume support

Add runtime suspend/resume for AIE4 driver. This updates amdxdna_pm.c
to implement amdxdna_pm_runtime_suspend() and amdxdna_pm_runtime_resume(),
and acquires an RPM reference across amdxdna_sriov_configure().

> diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c 
> b/drivers/accel/amdxdna/amdxdna_pci_drv.c
> index 1d0b91e732602..4933962844f94 100644
> --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c
> +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c
> @@ -467,18 +467,27 @@ static void amdxdna_remove(struct pci_dev *pdev)
>  
>  static const struct dev_pm_ops amdxdna_pm_ops = {
>       SYSTEM_SLEEP_PM_OPS(amdxdna_pm_suspend, amdxdna_pm_resume)
> -     RUNTIME_PM_OPS(amdxdna_pm_suspend, amdxdna_pm_resume, NULL)
> +     RUNTIME_PM_OPS(amdxdna_pm_runtime_suspend, amdxdna_pm_runtime_resume, 
> NULL)
>  };

[Severity: Low]
Does this code introduce a regression by preventing the dev_pm_ops structure
and its callbacks from being optimized out?

When building with CONFIG_PM=n, assigning the dev_pm_ops structure directly
without the pm_ptr() wrapper in the pci_driver definition:

static struct pci_driver amdxdna_pci_driver = {
        ...
        .driver.pm = &amdxdna_pm_ops,
};

means the amdxdna_pm_ops structure and the newly added callbacks
(amdxdna_pm_runtime_suspend and amdxdna_pm_runtime_resume referenced via
RUNTIME_PM_OPS) will be linked into the kernel as dead code.

Should this assignment be updated to use pm_ptr(&amdxdna_pm_ops) to ensure
the dead code is eliminated when PM support is disabled?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=18

Reply via email to