lkml.org 
[lkml]   [2021]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V1] mmc: sdhci-msm: Add eMMC and SD card err_stat sysfs entry
Date
Hi,

Thank you for suggestion .. will make the changes .

Thanks,
Sajida
-----Original Message-----
From: Ulf Hansson <ulf.hansson@linaro.org>
Sent: Thursday, December 2, 2021 1:35 PM
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Sajida Bhanu (Temp) (QUIC) <quic_c_sbhanu@quicinc.com>; riteshh@codeaurora.org; Asutosh Das (asd) <asutoshd@quicinc.com>; agross@kernel.org; bjorn.andersson@linaro.org; linux-mmc@vger.kernel.org; linux-arm-msm@vger.kernel.org; linux-kernel@vger.kernel.org; stummala@codeaurora.org; vbadigan@codeaurora.org; Ram Prakash Gupta (QUIC) <quic_rampraka@quicinc.com>; Pradeep Pragallapati (QUIC) <quic_pragalla@quicinc.com>; sartgarg@codeaurora.org; nitirawa@codeaurora.org; sayalil@codeaurora.org
Subject: Re: [PATCH V1] mmc: sdhci-msm: Add eMMC and SD card err_stat sysfs entry

On Thu, 2 Dec 2021 at 08:28, Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> On 02/12/2021 08:42, Sajida Bhanu (Temp) (QUIC) wrote:
> > Gentle Reminder.
> >
> > Thanks,
> > Sajida
> > -----Original Message-----
> > From: Sajida Bhanu (Temp) (QUIC) <quic_c_sbhanu@quicinc.com>
> > Sent: Friday, November 26, 2021 10:54 AM
> > To: Ulf Hansson <ulf.hansson@linaro.org>; Sajida Bhanu (Temp) (QUIC)
> > <quic_c_sbhanu@quicinc.com>
> > Cc: adrian.hunter@intel.com; riteshh@codeaurora.org; Asutosh Das
> > (asd) <asutoshd@quicinc.com>; agross@kernel.org;
> > bjorn.andersson@linaro.org; linux-mmc@vger.kernel.org;
> > linux-arm-msm@vger.kernel.org; linux-kernel@vger.kernel.org;
> > stummala@codeaurora.org; vbadigan@codeaurora.org; Ram Prakash Gupta
> > (QUIC) <quic_rampraka@quicinc.com>; Pradeep Pragallapati (QUIC)
> > <quic_pragalla@quicinc.com>; sartgarg@codeaurora.org;
> > nitirawa@codeaurora.org; sayalil@codeaurora.org
> > Subject: RE: [PATCH V1] mmc: sdhci-msm: Add eMMC and SD card
> > err_stat sysfs entry
> >
> >
> >
> > -----Original Message-----
> > From: Ulf Hansson <ulf.hansson@linaro.org>
> > Sent: Thursday, November 25, 2021 5:01 PM
> > To: Sajida Bhanu (Temp) (QUIC) <quic_c_sbhanu@quicinc.com>
> > Cc: adrian.hunter@intel.com; riteshh@codeaurora.org; Asutosh Das
> > (asd) <asutoshd@quicinc.com>; agross@kernel.org;
> > bjorn.andersson@linaro.org; linux-mmc@vger.kernel.org;
> > linux-arm-msm@vger.kernel.org; linux-kernel@vger.kernel.org;
> > stummala@codeaurora.org; vbadigan@codeaurora.org; Ram Prakash Gupta
> > (QUIC) <quic_rampraka@quicinc.com>; Pradeep Pragallapati (QUIC)
> > <quic_pragalla@quicinc.com>; sartgarg@codeaurora.org;
> > nitirawa@codeaurora.org; sayalil@codeaurora.org
> > Subject: Re: [PATCH V1] mmc: sdhci-msm: Add eMMC and SD card
> > err_stat sysfs entry
> >
> > On Wed, 17 Nov 2021 at 07:20, Shaik Sajida Bhanu <quic_c_sbhanu@quicinc.com> wrote:
> >>
> >> Add sysfs entry to query eMMC and SD card errors statistics.
> >> This feature is useful for debug and testing.
> >>
> >> Signed-off-by: Shaik Sajida Bhanu <quic_c_sbhanu@quicinc.com>
> >> ---
> >> drivers/mmc/host/cqhci.h | 1 +
> >> drivers/mmc/host/sdhci-msm.c | 192 +++++++++++++++++++++++++++++++++++++++++++
> >> drivers/mmc/host/sdhci.c | 17 ++++
> >> drivers/mmc/host/sdhci.h | 1 +
> >> include/linux/mmc/host.h | 1 +
> >> 5 files changed, 212 insertions(+)
> >
> > To allow an easier review, I strongly suggest splitting up the changes in smaller pieces. Maybe in three steps: add interfaces, implement them, add sysfs - or something along those lines.
> >
> > I am also trying to understand the benefit of having these stats available. Can you perhaps share a little bit of background on how they are usable for you? Is it for debug purpose or does it have other purposes too?
> >
> > If it turns out that we agree on finding these stats valuable for us, then I am inclined to think that this should be integrated closer with the mmc core.
> >
> > The error codes that are propagated to the core from failed requests are common error codes, so we should be able to use that information from the core itself, I think.
> >
> > Kind regards
> > Uffe
> >
> > Hi Ulf,
> >
> > Thanks for the review
> >
> > I am also trying to understand the benefit of having these stats available. Can you perhaps share a little bit of background on how they are usable for you? Is it for debug purpose or does it have other purposes too?
> >
> >>>>>>>>>>>>> These changes for debug purpose only .. if any errors occurred while testing eMMC and SD card those will be captured in these sysfs entries , we can directly go and check the sysfs entries and get to know what is the error occurred in driver level.
>
> I would suggest using debugfs and adding support in mmc host debugfs
> e.g.
>
> static inline void mmc_debugfs_err_stats_enable(struct mmc_host *mmc)
> {
> mmc->err_stats_enabled = true; }
>
> enum mmc_err_stat {
> MMC_ERR_CMD_TIMEOUT,
> MMC_ERR_CMD_CRC,
> MMC_ERR_DAT_TIMEOUT,
> MMC_ERR_DAT_CRC,
> MMC_ERR_AUTO_CMD,
> MMC_ERR_ADMA,
> MMC_ERR_TUNING,
> MMC_ERR_CMDQ_RED,
> MMC_ERR_CMDQ_GCE,
> MMC_ERR_CMDQ_ICCE,
> MMC_ERR_REQ_TIMEOUT,
> MMC_ERR_CMDQ_REQ_TIMEOUT,
> MMC_ERR_ICE_CFG,
> MMC_ERR_MAX,
> };
>
> static inline void mmc_debugfs_err_stats_inc(struct mmc_host *mmc,
> enum mmc_err_stat stat) {
> mmc->err_stats[stat] += 1;
> }
>
> And amend mmc_add_host_debugfs() to create the err_stats file etc.
>
> sdhci.c could call mmc_debugfs_err_stats_enable() and mmc_debugfs_err_stats_inc() as needed.
> cqhci.c could call mmc_debugfs_err_stats_inc() as needed.
>
> Ulf, does that sound reasonable?

Yes, it does! Thanks for having a closer look!

[...]

Kind regards
Uffe
\
 
 \ /
  Last update: 2021-12-03 09:43    [W:0.080 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site