mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] scsi: ufs: core: Add debugfs for PA TFS/FEC error counters
@ 2026-11-25 11:33 Po-Wen Kao
  2026-11-25 11:33 ` [PATCH v3 1/3] scsi: ufs: core: Remove debugfs before removing SCSI host Po-Wen Kao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Po-Wen Kao @ 2026-11-25 11:33 UTC (permalink / raw)
  To: linux-scsi
  Cc: Konstantin Vyshetsky, Randall Huang, Alim Akhtar,
	Bart Van Assche, Bean Huo, Stanley Jhu, James E . J . Bottomley,
	Martin K . Petersen, Peter Wang, Can Guo, linux-kernel,
	Brian Kao

From: Brian Kao <powenkao@google.com>

This series exposes the MIPI UniPro v3.0 PA layer TFS/FEC error
counters (0x15C3-0x15C7) under debugfs:

  /sys/kernel/debug/ufshcd/<dev>/pa_err_stats/{host,device}/

Patch 1 fixes an existing teardown race by removing debugfs and
disabling debugfs_ee_work before scsi_remove_host() removes the WLUN.
Patch 2 defers debugfs creation until after device init while keeping
debugfs_ee_work initialization before IRQs are enabled. Patch 3 adds
the PA_TFS_* and UniPro 2.0/3.0 definitions and creates
pa_err_stats/{host,device}/ based on PA_LOCALVERINFO / PA_REMOTEVERINFO.

Changes in v3 (suggested by Bart Van Assche):
- Split the ufshcd_remove() teardown fix into patch 1 with Fixes and
  stable tags.
- Patch 2: Initialize debugfs_ee_work and debugfs_ee_rate_limit_ms
  before IRQs are enabled via ufs_debugfs_ee_init(), and document the
  later fault-injection attribute initialization.
- Patch 3: Gate host/ and device/ on UniPro version (PA_LOCALVERINFO /
  PA_REMOTEVERINFO >= UFS_UNIPRO_VER_3_0), merge the duplicated host
  and device attribute arrays into one via debugfs_create_file_aux_num(),
  update the hba_from_file() comment, and clarify the 64-bit read/reset
  comments.

Changes in v2:
- Defer ufs_debugfs_hba_init() until after device init (suggested by
  Peter Wang).
- Create pa_err_stats/host/ and device/ only when supported instead of
  returning -EOPNOTSUPP on read/write.

Link: https://lore.kernel.org/linux-scsi/20261124012951.3143833-1-powenkao@google.com/
Link: https://lore.kernel.org/linux-scsi/20261123025745.1743640-1-powenkao@google.com/

Brian Kao (3):
  scsi: ufs: core: Remove debugfs before removing SCSI host
  scsi: ufs: core: Defer debugfs init until after device init
  scsi: ufs: core: Add debugfs for PA TFS/FEC error counters

 drivers/ufs/core/ufs-debugfs.c | 244 ++++++++++++++++++++++++++++++++-
 drivers/ufs/core/ufs-debugfs.h |   2 +
 drivers/ufs/core/ufshcd.c      |   8 +-
 include/ufs/unipro.h           |   9 +-
 4 files changed, 252 insertions(+), 11 deletions(-)


base-commit: 08fec21faae44fe002467976befd68e6e62969b5
-- 
2.56.1.839.g22a8290db9-goog


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

end of thread, other threads:[~2026-11-25 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 11:33 [PATCH v3 0/3] scsi: ufs: core: Add debugfs for PA TFS/FEC error counters Po-Wen Kao
2026-11-25 11:33 ` [PATCH v3 1/3] scsi: ufs: core: Remove debugfs before removing SCSI host Po-Wen Kao
2026-11-25 11:34 ` [PATCH v3 2/3] scsi: ufs: core: Defer debugfs init until after device init Po-Wen Kao
2026-11-25 11:34 ` [PATCH v3 3/3] scsi: ufs: core: Add debugfs for PA TFS/FEC error counters Po-Wen Kao

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

all inboxes | Powered by JetHome®