Linux ATA/IDE development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Li Jun" <lijun01@kylinos.cn>
Cc: dlemoal@kernel.org, linux-ide@vger.kernel.org, cassel@kernel.org
Subject: Re: [PATCH v3] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
Date: Tue, 08 Sep 2026 06:20:37 +0000	[thread overview]
Message-ID: <20260908062037.D4FCB1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260908061025.3580261-1-lijun01@kylinos.cn>

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 <lijun01@kylinos.cn>

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.

> 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

[ ... ]

> @@ -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

      parent reply	other threads:[~2026-09-08  6:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08  6:10 [PATCH v3] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS Li Jun
2026-09-08  6:13 ` Damien Le Moal
2026-09-08  8:45   ` Niklas Cassel
2026-09-08  9:04     ` Damien Le Moal
2026-09-08  6:20 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260908062037.D4FCB1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=lijun01@kylinos.cn \
    --cc=linux-ide@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox