Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH v1 0/1] Add code for ufs suspend error.
       [not found] <CGME20251210063900epcas1p2d70b81b127dcf2435d2028fca70ba6af@epcas1p2.samsung.com>
@ 2025-12-10  6:38 ` Seunghwan Baek
  2025-12-10  6:38   ` [PATCH v1 1/1] scsi: ufs : core: Add ufshcd_update_evt_hist " Seunghwan Baek
  0 siblings, 1 reply; 4+ messages in thread
From: Seunghwan Baek @ 2025-12-10  6:38 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, bvanassche, James.Bottomley,
	martin.petersen, peter.wang, beanhuo, adrian.hunter, quic_nguyenb,
	linux-scsi, linux-kernel, sh8267.baek

Add ufshcd_update_evt_hist to record ufs suspend error event history.

Seunghwan Baek (1):
  scsi: ufs : core: Add ufshcd_update_evt_hist for ufs suspend error.

 drivers/ufs/core/ufshcd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/1] scsi: ufs : core: Add ufshcd_update_evt_hist for ufs suspend error.
  2025-12-10  6:38 ` [PATCH v1 0/1] Add code for ufs suspend error Seunghwan Baek
@ 2025-12-10  6:38   ` Seunghwan Baek
  2025-12-10 12:29     ` Peter Wang (王信友)
  2025-12-17  3:40     ` Martin K. Petersen
  0 siblings, 2 replies; 4+ messages in thread
From: Seunghwan Baek @ 2025-12-10  6:38 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, bvanassche, James.Bottomley,
	martin.petersen, peter.wang, beanhuo, adrian.hunter, quic_nguyenb,
	linux-scsi, linux-kernel, sh8267.baek
  Cc: stable

If the ufs resume fails, the event history is updated in ufshcd_resume,
but there is no code anywhere to record ufs suspend. Therefore, add code
to record ufs suspend error event history.

Fixes: dd11376b9f1b ("scsi: ufs: Split the drivers/scsi/ufs directory")
Cc: stable@vger.kernel.org

Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>
---
 drivers/ufs/core/ufshcd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 040a0ceb170a..6bb2781aefc7 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -10337,7 +10337,7 @@ static int ufshcd_suspend(struct ufs_hba *hba)
 	ret = ufshcd_setup_clocks(hba, false);
 	if (ret) {
 		ufshcd_enable_irq(hba);
-		return ret;
+		goto out;
 	}
 	if (ufshcd_is_clkgating_allowed(hba)) {
 		hba->clk_gating.state = CLKS_OFF;
@@ -10349,6 +10349,9 @@ static int ufshcd_suspend(struct ufs_hba *hba)
 	/* Put the host controller in low power mode if possible */
 	ufshcd_hba_vreg_set_lpm(hba);
 	ufshcd_pm_qos_update(hba, false);
+out:
+	if (ret)
+		ufshcd_update_evt_hist(hba, UFS_EVT_SUSPEND_ERR, (u32)ret);
 	return ret;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] scsi: ufs : core: Add ufshcd_update_evt_hist for ufs suspend error.
  2025-12-10  6:38   ` [PATCH v1 1/1] scsi: ufs : core: Add ufshcd_update_evt_hist " Seunghwan Baek
@ 2025-12-10 12:29     ` Peter Wang (王信友)
  2025-12-17  3:40     ` Martin K. Petersen
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Wang (王信友) @ 2025-12-10 12:29 UTC (permalink / raw)
  To: beanhuo@micron.com, avri.altman@wdc.com, quic_nguyenb@quicinc.com,
	linux-scsi@vger.kernel.org, bvanassche@acm.org,
	sh8267.baek@samsung.com, adrian.hunter@intel.com,
	alim.akhtar@samsung.com, linux-kernel@vger.kernel.org,
	martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com
  Cc: stable@vger.kernel.org

On Wed, 2025-12-10 at 15:38 +0900, Seunghwan Baek wrote:
> If the ufs resume fails, the event history is updated in
> ufshcd_resume,
> but there is no code anywhere to record ufs suspend. Therefore, add
> code
> to record ufs suspend error event history.
> 
> Fixes: dd11376b9f1b ("scsi: ufs: Split the drivers/scsi/ufs
> directory")
> Cc: stable@vger.kernel.org
> 
> Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>

Reviewed-by: Peter Wang <peter.wang@mediatek.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] scsi: ufs : core: Add ufshcd_update_evt_hist for ufs suspend error.
  2025-12-10  6:38   ` [PATCH v1 1/1] scsi: ufs : core: Add ufshcd_update_evt_hist " Seunghwan Baek
  2025-12-10 12:29     ` Peter Wang (王信友)
@ 2025-12-17  3:40     ` Martin K. Petersen
  1 sibling, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-12-17  3:40 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, bvanassche, James.Bottomley, peter.wang,
	beanhuo, adrian.hunter, quic_nguyenb, linux-scsi, linux-kernel,
	Seunghwan Baek
  Cc: Martin K . Petersen, stable

On Wed, 10 Dec 2025 15:38:54 +0900, Seunghwan Baek wrote:

> If the ufs resume fails, the event history is updated in ufshcd_resume,
> but there is no code anywhere to record ufs suspend. Therefore, add code
> to record ufs suspend error event history.
> 
> Fixes: dd11376b9f1b ("scsi: ufs: Split the drivers/scsi/ufs directory")
> Cc: stable@vger.kernel.org
> 
> [...]

Applied to 6.19/scsi-fixes, thanks!

[1/1] scsi: ufs : core: Add ufshcd_update_evt_hist for ufs suspend error.
      https://git.kernel.org/mkp/scsi/c/c9f36f04a8a2

-- 
Martin K. Petersen

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-17  3:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20251210063900epcas1p2d70b81b127dcf2435d2028fca70ba6af@epcas1p2.samsung.com>
2025-12-10  6:38 ` [PATCH v1 0/1] Add code for ufs suspend error Seunghwan Baek
2025-12-10  6:38   ` [PATCH v1 1/1] scsi: ufs : core: Add ufshcd_update_evt_hist " Seunghwan Baek
2025-12-10 12:29     ` Peter Wang (王信友)
2025-12-17  3:40     ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox