Linux MultiMedia Card development
 help / color / mirror / Atom feed
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,
	shawn.lin@rock-chips.com, yoshihiro.shimoda.uh@renesas.com,
	digetx@gmail.com, quic_asutoshd@quicinc.com
Cc: linux-arm-msm@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, 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 V6 4/5] mmc: debugfs: Add debug fs error state entry for mmc driver
Date: Mon, 23 May 2022 10:15:45 +0300	[thread overview]
Message-ID: <79590e32-5505-7a0c-81b4-0efd5c8f156f@intel.com> (raw)
In-Reply-To: <1652857340-6040-5-git-send-email-quic_c_sbhanu@quicinc.com>

On 18/05/22 10:02, 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>

Could use debugfs_create_file_unsafe() (see below)

Otherwise:

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/core/debugfs.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index 6aa5a60..3c7908d 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -223,6 +223,27 @@ 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");
>  
> +static int mmc_err_state_get(void *data, u64 *val)
> +{
> +	struct mmc_host *host = data;
> +	int i;
> +
> +	if (!host)
> +		return -EINVAL;
> +
> +	*val = 0;
> +	for (i = 0; i < MMC_ERR_MAX; i++) {
> +		if (host->err_stats[i]) {
> +			*val = 1;
> +			break;
> +		}
> +	}
> +
> +	return 0;
> +}
> +
> +DEFINE_DEBUGFS_ATTRIBUTE(mmc_err_state, mmc_err_state_get, NULL, "%llu\n");
> +
>  static int mmc_err_stats_show(struct seq_file *file, void *data)
>  {
>  	struct mmc_host *host = (struct mmc_host *)file->private;
> @@ -289,6 +310,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);

This could use debugfs_create_file_unsafe()

>  	debugfs_create_file("err_stats", 0600, root, host,
>  			    &mmc_err_stats_fops);
>  


  reply	other threads:[~2022-05-23  7:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18  7:02 [PATCH V6 0/5] mmc: add error statistics for eMMC and SD card Shaik Sajida Bhanu
2022-05-18  7:02 ` [PATCH V6 1/5] mmc: core: Capture eMMC and SD card errors Shaik Sajida Bhanu
2022-05-23  7:14   ` Adrian Hunter
2022-05-24  5:56     ` Sajida Bhanu (Temp)
2022-05-18  7:02 ` [PATCH V6 2/5] mmc: sdhci: " Shaik Sajida Bhanu
2022-05-23  7:14   ` Adrian Hunter
2022-05-24  5:48     ` Sajida Bhanu (Temp)
2022-05-18  7:02 ` [PATCH V6 3/5] mmc: debugfs: Add debug fs entry for mmc driver Shaik Sajida Bhanu
2022-05-23  7:15   ` Adrian Hunter
2022-05-18  7:02 ` [PATCH V6 4/5] mmc: debugfs: Add debug fs error state " Shaik Sajida Bhanu
2022-05-23  7:15   ` Adrian Hunter [this message]
2022-05-24  5:19     ` Sajida Bhanu (Temp)
2022-05-18  7:02 ` [PATCH V6 5/5] mmc: cqhci: Capture eMMC and SD card errors Shaik Sajida Bhanu
2022-05-23  7:15   ` Adrian Hunter

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=79590e32-5505-7a0c-81b4-0efd5c8f156f@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=digetx@gmail.com \
    --cc=linux-arm-msm@vger.kernel.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_sartgarg@quicinc.com \
    --cc=quic_sayalil@quicinc.com \
    --cc=shawn.lin@rock-chips.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