]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: ufs: amd-versal2: Fix PHY initialization in HCE enable notify
authorAjay Neeli <ajay.neeli@amd.com>
Wed, 24 Dec 2025 05:39:50 +0000 (11:09 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 24 Jan 2026 03:43:44 +0000 (22:43 -0500)
Move the PHY initialization from PRE_CHANGE to POST_CHANGE in the
ufs_versal2_hce_enable_notify() callback. This ensures that the PHY is
initialized after the host controller enable sequence is complete, rather
than before it starts.

The PHY initialization requires the UFS host controller to be in a stable
enabled state to properly configure the MPHY registers. Moving this to
POST_CHANGE aligns with the expected initialization order and prevents
potential timing issues during controller startup.

Fixes: 769b8b2ffded ("scsi: ufs: amd-versal2: Add UFS support for AMD Versal Gen 2 SoC")
Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Link: https://patch.msgid.link/20251224053950.54213-1-ajay.neeli@amd.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/host/ufs-amd-versal2.c

index 40543db621a13622ae9fd60b030271a7b178c6c6..6c454ae8a9c83a60e1171022d2b33f0d9ae45083 100644 (file)
@@ -367,7 +367,7 @@ static int ufs_versal2_hce_enable_notify(struct ufs_hba *hba,
 {
        int ret = 0;
 
-       if (status == PRE_CHANGE) {
+       if (status == POST_CHANGE) {
                ret = ufs_versal2_phy_init(hba);
                if (ret)
                        dev_err(hba->dev, "Phy init failed (%d)\n", ret);