Skip to contentSkip to conversation

scsi: ufs: amd-versal2: Fix PHY initialization in HCE enable notify

PATCH Applied Ajay Neeli 2 participants 2 messages Dec 24, 2025 – Jan 24

Subsystems (2)
lore
Share & tools
lore

Ajay Neeli

author maintainer
#0 lore raw

PATCH 1/1 scsi: ufs: amd-versal2: Fix PHY initialization in HCE enable notify

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")
---
 drivers/ufs/host/ufs-amd-versal2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ufs/host/ufs-amd-versal2.c +1 -1
index 40543db621a1..6c454ae8a9c8 100644
@@ -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);
Signature · 1 line
2.43.0
#1 lore raw
Quoted 11 lines · Ajay Neeli

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.

[...]

Applied to 6.19/scsi-fixes, thanks!

[1/1] scsi: ufs: amd-versal2: Fix PHY initialization in HCE enable notify

      https://git.kernel.org/mkp/scsi/c/0444568edbf8
Signature · 1 line
Martin K. Petersen