From: Adrian Hunter <adrian.hunter@intel.com>
To: Shaik Sajida Bhanu <quic_c_sbhanu@quicinc.com>,
ulf.hansson@linaro.org, wsa+renesas@sang-engineering.com,
yoshihiro.shimoda.uh@renesas.com, linus.walleij@linaro.org,
digetx@gmail.com, briannorris@chromium.org,
quic_riteshh@quicinc.com
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
quic_asutoshd@quicinc.com, quic_rampraka@quicinc.com,
quic_pragalla@quicinc.com, quic_sartgarg@quicinc.com,
quic_nitirawa@quicinc.com, quic_sayalil@quicinc.com,
Liangliang Lu <quic_luliang@quicinc.com>,
"Bao D . Nguyen" <quic_nguyenb@quicinc.com>
Subject: Re: [PATCH V5 4/5] mmc: debugfs: Add debug fs error state entry for mmc driver
Date: Tue, 26 Apr 2022 10:58:29 +0300 [thread overview]
Message-ID: <3459875e-782d-d2bd-ba1f-c945e22e312e@intel.com> (raw)
In-Reply-To: <ce5582e3-0d8d-f1cf-0d23-8fbf17226775@intel.com>
On 26/04/22 10:54, Adrian Hunter wrote:
> On 25/04/22 19:00, Shaik Sajida Bhanu wrote:
>> Add debug fs entry error state to query eMMC and SD card errors statistics.
>> If any errors occurred in eMMC and SD card driver level then
>> err_state value will be set to 1.
>>
>> Signed-off-by: Liangliang Lu <quic_luliang@quicinc.com>
>> Signed-off-by: Sayali Lokhande <quic_sayalil@quicinc.com>
>> Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
>> Signed-off-by: Shaik Sajida Bhanu <quic_c_sbhanu@quicinc.com>
>> ---
>> drivers/mmc/core/debugfs.c | 25 +++++++++++++++++++++++++
>> 1 file changed, 25 insertions(+)
>>
>> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
>> index 6aa5a60..2f5b63f 100644
>> --- a/drivers/mmc/core/debugfs.c
>> +++ b/drivers/mmc/core/debugfs.c
>> @@ -222,6 +222,29 @@ static int mmc_clock_opt_set(void *data, u64 val)
>>
>> DEFINE_DEBUGFS_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set,
>> "%llu\n");
>
> A blank line would be nice here
>
>> +static int mmc_err_state_get(void *data, u64 *val)
>> +{
>> + struct mmc_host *host = data;
>> +
>> + if (!host)
>> + return -EINVAL;
>> +
>
> I am not sure why you have left out some err_stats[].
> Why not all of them? At least, it needs a comment to explain.
>
>> + *val = host->err_stats[MMC_ERR_REQ_TIMEOUT] ||
>> + host->err_stats[MMC_ERR_ADMA] ||
>> + host->err_stats[MMC_ERR_CTRL_TIMEOUT] ||
>> + host->err_stats[MMC_ERR_UNEXPECTED_IRQ] ||
>> + host->err_stats[MMC_ERR_CMDQ_RED] ||
>> + host->err_stats[MMC_ERR_CMDQ_GCE] ||
>> + host->err_stats[MMC_ERR_CMDQ_ICCE] ||
>> + host->err_stats[MMC_ERR_DAT_TIMEOUT] ||
>> + host->err_stats[MMC_ERR_DAT_CRC] ||
>> + host->err_stats[MMC_ERR_CMD_CRC] ||
>> + host->err_stats[MMC_ERR_CMD_TIMEOUT];
>> +
>> + return 0;
>> +}
>> +
>> +DEFINE_SIMPLE_ATTRIBUTE(mmc_err_state, mmc_err_state_get, NULL, "%llu\n");
Also, if possible, please use DEFINE_DEBUGFS_ATTRIBUTE / debugfs_create_file_unsafe
in this case
>>
>> static int mmc_err_stats_show(struct seq_file *file, void *data)
>> {
>> @@ -289,6 +312,8 @@ void mmc_add_host_debugfs(struct mmc_host *host)
>> debugfs_create_file_unsafe("clock", S_IRUSR | S_IWUSR, root, host,
>> &mmc_clock_fops);
>>
>> + debugfs_create_file("err_state", 0600, root, host,
>> + &mmc_err_state);
>> debugfs_create_file("err_stats", 0600, root, host,
>> &mmc_err_stats_fops);
>>
>
next prev parent reply other threads:[~2022-04-26 7:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 16:00 [PATCH V5 0/5] mmc: add error statistics for eMMC and SD card Shaik Sajida Bhanu
2022-04-25 16:00 ` [PATCH V5 1/5] mmc: core: Capture eMMC and SD card errors Shaik Sajida Bhanu
2022-04-25 16:00 ` [PATCH V5 2/5] mmc: sdhci: " Shaik Sajida Bhanu
2022-04-26 7:51 ` Adrian Hunter
2022-05-09 9:34 ` Sajida Bhanu (Temp)
2022-04-25 16:00 ` [PATCH V5 3/5] mmc: debugfs: Add debug fs entry for mmc driver Shaik Sajida Bhanu
2022-04-25 16:00 ` [PATCH V5 4/5] mmc: debugfs: Add debug fs error state " Shaik Sajida Bhanu
2022-04-26 7:54 ` Adrian Hunter
2022-04-26 7:58 ` Adrian Hunter [this message]
2022-05-09 9:44 ` Sajida Bhanu (Temp)
[not found] ` <5c2a9eae-3ab2-1fa4-c7df-ba7384e07b24@quicinc.com>
2022-05-09 10:03 ` Adrian Hunter
2022-05-09 10:32 ` Sajida Bhanu (Temp)
2022-04-25 16:00 ` [PATCH V5 5/5] mmc: cqhci: Capture eMMC and SD card errors Shaik Sajida Bhanu
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=3459875e-782d-d2bd-ba1f-c945e22e312e@intel.com \
--to=adrian.hunter@intel.com \
--cc=briannorris@chromium.org \
--cc=digetx@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_c_sbhanu@quicinc.com \
--cc=quic_luliang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=quic_nitirawa@quicinc.com \
--cc=quic_pragalla@quicinc.com \
--cc=quic_rampraka@quicinc.com \
--cc=quic_riteshh@quicinc.com \
--cc=quic_sartgarg@quicinc.com \
--cc=quic_sayalil@quicinc.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=yoshihiro.shimoda.uh@renesas.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