Re: [PATCH v3] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
From: sashiko-bot@kernel.org
Date: 2026-09-08 06:20:38
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: Pre-existing issues: - [High] The ahci_da850 driver hooks into standard ahci_platform_resume, but fails to restore SoC-specific SATA PHY registers after suspend, causing SATA to be uninitialized on resume. -- commit d5b66599e27a81a0e92aca89e46cdd92303b81e7 Author: Li Jun [off-list ref] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS This patch replaces the deprecated SIMPLE_DEV_PM_OPS macro with the recommended DEFINE_SIMPLE_DEV_PM_OPS. It also uses pm_ptr() to complete the API migration and allow the pm_ops structure to be dropped when CONFIG_PM is disabled.
quoted hunk ↗ jump to hunk
diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -227,8 +227,8 @@ static int ahci_da850_probe(struct platform_device *pdev) return rc; } -static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend, + ahci_platform_resume);
[Severity: High] This is a pre-existing issue, but by examining the PM operations being wired here, it appears the driver hooks into the generic ahci_platform_resume without restoring SoC-specific SATA PHY registers. During probe in drivers/ata/ahci_da850.c, ahci_da850_probe() initializes the SATA PHY registers by calling da850_sata_init() with local parameters. However, the resume callback is wired directly to the generic ahci_platform_resume, which only restores standard AHCI state and bulk clocks. It is completely unaware of the custom DA850 PHY initialization. Furthermore, the necessary parameters for PHY initialization (pwrdn_reg and mpy) are local to the ahci_da850_probe() function and not saved for later use. Could a system suspend followed by a resume cycle leave the SATA controller uninitialized, causing connected drives to become inaccessible? -- Sashiko AI review · https://sashiko.dev/#/patchset/20260908061025.3580261-1-lijun01@kylinos.cn?part=1