Skip to contentSkip to conversation

FAILED: patch "[PATCH] scsi: ufs: ufs-pci: Fix default runtime and system PM levels" failed to apply to 5.15-stable tree

PATCH [email protected] 2 participants 3 messages Aug 21, 2025 – Aug 22, 2025

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 6de7435e6b81fe52c0ab4c7e181f6b5decd18eb1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025082102-levitate-simple-9760@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 6de7435e6b81fe52c0ab4c7e181f6b5decd18eb1 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <[email protected]>
Date: Wed, 23 Jul 2025 19:58:50 +0300
Subject: [PATCH] scsi: ufs: ufs-pci: Fix default runtime and system PM levels

Intel MTL-like host controllers support auto-hibernate. Using auto-hibernate with manual (driver initiated) hibernate produces more complex operation. For example, the host controller will have to exit auto-hibernate simply to allow the driver to enter hibernate state manually. That is not recommended.

The default rpm_lvl and spm_lvl is 3, which includes manual hibernate.

Change the default values to 2, which does not.

Note, to be simpler to backport to stable kernels, utilize the UFS PCI driver's ->late_init() call back. Recent commits have made it possible to set up a controller-specific default in the regular ->init() call back, but not all stable kernels have those changes.

drivers/ufs/host/ufshcd-pci.c +14 -1
index af1c272eef1c..8aff32d7057d 100644
@@ -468,10 +468,23 @@ static int ufs_intel_adl_init(struct ufs_hba *hba)
 	return ufs_intel_common_init(hba);
 }
 
+static void ufs_intel_mtl_late_init(struct ufs_hba *hba)
+{
+	hba->rpm_lvl = UFS_PM_LVL_2;
+	hba->spm_lvl = UFS_PM_LVL_2;
+}
+
 static int ufs_intel_mtl_init(struct ufs_hba *hba)
 {
+	struct ufs_host *ufs_host;
+	int err;
+
 	hba->caps |= UFSHCD_CAP_CRYPTO | UFSHCD_CAP_WB_EN;
-	return ufs_intel_common_init(hba);
+	err = ufs_intel_common_init(hba);
+	/* Get variant after it is set in ufs_intel_common_init() */
+	ufs_host = ufshcd_get_variant(hba);
+	ufs_host->late_init = ufs_intel_mtl_late_init;
+	return err;
 }
 
 static int ufs_qemu_get_hba_mac(struct ufs_hba *hba)
#1 lore raw
Quoted 11 lines · On 21/08/2025 16:09, [email protected] wrote:

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD
git cherry-pick -x 6de7435e6b81fe52c0ab4c7e181f6b5decd18eb1

This works for me even though ufshcd-pci.c has moved since then from drivers/scsi/ufs/ to drivers/ufs/host/

  $ git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
  From https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux
   * branch                      linux-5.15.y -> FETCH_HEAD
  $ git checkout FETCH_HEAD
  HEAD is now at c79648372d02 Linux 5.15.189
  $ git show --stat 6de7435e6b81fe52c0ab4c7e181f6b5decd18eb1 | grep ufshcd-pci.c
   drivers/ufs/host/ufshcd-pci.c | 15 ++++++++++++++-
  $ git cherry-pick -x 6de7435e6b81fe52c0ab4c7e181f6b5decd18eb1
  Auto-merging drivers/scsi/ufs/ufshcd-pci.c
  [detached HEAD 15aa885c945e] scsi: ufs: ufs-pci: Fix default runtime and system PM levels
   Date: Wed Jul 23 19:58:50 2025 +0300
   1 file changed, 14 insertions(+), 1 deletion(-)
  $ git show --stat HEAD | grep ufshcd-pci.c
   drivers/scsi/ufs/ufshcd-pci.c | 15 ++++++++++++++-

Please note 4428ddea832cfdb63e476eb2e5c8feb5d36057fe works too:

  $ git cherry-pick -x 4428ddea832cfdb63e476eb2e5c8feb5d36057fe
  Auto-merging drivers/scsi/ufs/ufshcd-pci.c
  [detached HEAD 9b324ade6f64] scsi: ufs: ufs-pci: Fix hibernate state transition for Intel MTL-like host controllers
   Author: Archana Patni <[email protected]>
   Date: Wed Jul 23 19:58:49 2025 +0300
   1 file changed, 27 insertions(+)
author maintainer
#2 lore raw
Quoted 31 lines · Adrian Hunter
Quoted 11 lines · On 21/08/2025 16:09, [email protected] wrote:

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD
git cherry-pick -x 6de7435e6b81fe52c0ab4c7e181f6b5decd18eb1

This works for me even though ufshcd-pci.c has moved since then from drivers/scsi/ufs/ to drivers/ufs/host/

  $ git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
  From https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux
   * branch                      linux-5.15.y -> FETCH_HEAD
  $ git checkout FETCH_HEAD
  HEAD is now at c79648372d02 Linux 5.15.189
  $ git show --stat 6de7435e6b81fe52c0ab4c7e181f6b5decd18eb1 | grep ufshcd-pci.c
   drivers/ufs/host/ufshcd-pci.c | 15 ++++++++++++++-
  $ git cherry-pick -x 6de7435e6b81fe52c0ab4c7e181f6b5decd18eb1
  Auto-merging drivers/scsi/ufs/ufshcd-pci.c
  [detached HEAD 15aa885c945e] scsi: ufs: ufs-pci: Fix default runtime and system PM levels
   Date: Wed Jul 23 19:58:50 2025 +0300
   1 file changed, 14 insertions(+), 1 deletion(-)
  $ git show --stat HEAD | grep ufshcd-pci.c
   drivers/scsi/ufs/ufshcd-pci.c | 15 ++++++++++++++-
Quoted 8 lines

Please note 4428ddea832cfdb63e476eb2e5c8feb5d36057fe works too:

  $ git cherry-pick -x 4428ddea832cfdb63e476eb2e5c8feb5d36057fe
  Auto-merging drivers/scsi/ufs/ufshcd-pci.c
  [detached HEAD 9b324ade6f64] scsi: ufs: ufs-pci: Fix hibernate state transition for Intel MTL-like host controllers
   Author: Archana Patni <[email protected]>
   Date: Wed Jul 23 19:58:49 2025 +0300
   1 file changed, 27 insertions(+)

I don't use cherry-pick, so if a file moves it's hard to detect at times. Can you send me the patch that you have properly generated (and built-tested)?

thanks,

greg k-h