From: Peter Wang <peter.wang@mediatek.com>
To: Po-Wen Kao <powenkao@google.com>, <linux-scsi@vger.kernel.org>
Cc: Konstantin Vyshetsky <vkon@google.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
Bart Van Assche <bvanassche@acm.org>,
Bean Huo <beanhuo@micron.com>,
Stanley Jhu <stanleyjhu@google.com>,
"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <mkp@kernel.org>,
Can Guo <can.guo@oss.qualcomm.com>,
<linux-kernel@vger.kernel.org>, John Garry <john.garry@linux.dev>,
Li Qiang <liqiang01@kylinos.cn>
Subject: Re: [PATCH v2 2/2] scsi: ufs: core: Add debugfs for PA TFS/FEC error counters
Date: Tue, 24 Nov 2026 14:20:14 +0800 [thread overview]
Message-ID: <25172401d7a116a37df7eaf5c7ba06c10abb89d8.camel@mediatek.com> (raw)
In-Reply-To: <20261124012951.3143833-3-powenkao@google.com>
On Tue, 2026-11-24 at 09:29 +0800, Po-Wen Kao wrote:
> From: Brian Kao <powenkao@google.com>
>
> MIPI UniPro v3.0 introduces the Transport Framing Structure (TFS)
> with
> Reed-Solomon Forward Error Correction (FEC) in the Physical Adapter
> (PA) layer, along with five PA MIB attributes (0x15C3-0x15C7) that
> count TFS frames with uncorrectable FEC errors, TFS CRC errors, TFS
> format errors, and 64-bit corrected FEC symbols. Exposing these
> counters allows observing pre-FEC symbol correction and framing
> errors
> for HS-G6 (1b1b) link-margin diagnostics without dropping the link.
>
> Define the PA_TFS_* attributes in include/ufs/unipro.h and expose
> them
> under debugfs:
>
> /sys/kernel/debug/ufshcd/<dev>/pa_err_stats/{host,device}/
> - fec_err_cnt
> - crc_err_cnt
> - format_err_cnt
> - recovered_fec_symbols
>
> Skip creation entirely on hosts setting UFSHCD_QUIRK_BROKEN_UIC_CMD.
> Otherwise gate each subdirectory independently: host/ is created when
> UFSHCI >= 5.0, and device/ is created when wSpecVersion >= 0x0500
> (the
> pa_err_stats parent directory is omitted if neither is supported).
>
> Each file reads the local (host) or peer (device) PA attribute and
> resets it to 0 when '0' is written. Writing PA_TFS_RecErrorCountL
> clears the full 64-bit PA_TFS_RecErrorCount counter per MIPI UniPro
> v3.0 Section 5.6.7, and reads sample the high/low words with a
> bounded
> hi-lo-hi retry loop to avoid 32-bit rollover tearing. Positive UIC
> command result codes are translated to standard negative errno
> values.
>
> Signed-off-by: Brian Kao <powenkao@google.com>
> ---
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
prev parent reply other threads:[~2026-11-24 6:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 1:29 [PATCH v2 0/2] " Po-Wen Kao
2026-11-24 1:29 ` [PATCH v2 1/2] scsi: ufs: core: Defer debugfs init until after device init Po-Wen Kao
2026-11-24 6:15 ` Peter Wang
2026-11-24 1:29 ` [PATCH v2 2/2] scsi: ufs: core: Add debugfs for PA TFS/FEC error counters Po-Wen Kao
2026-11-24 6:20 ` Peter Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25172401d7a116a37df7eaf5c7ba06c10abb89d8.camel@mediatek.com \
--to=peter.wang@mediatek.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=can.guo@oss.qualcomm.com \
--cc=john.garry@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=liqiang01@kylinos.cn \
--cc=mkp@kernel.org \
--cc=powenkao@google.com \
--cc=stanleyjhu@google.com \
--cc=vkon@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®