From: Adrian Hunter <adrian.hunter@intel.com>
To: Shaik Sajida Bhanu <quic_c_sbhanu@quicinc.com>,
asutoshd@quicinc.com, ulf.hansson@linaro.org, agross@kernel.org,
bjorn.andersson@linaro.org, linux-mmc@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: quic_vbadigan@quicinc.com, quic_rampraka@quicinc.com,
quic_pragalla@quicinc.com, quic_sartgarg@quicinc.com,
quic_nitirawa@quicinc.com, quic_sayalil@quicinc.com,
Sayali Lokhande <sayalil@codeaurora.org>,
"Bao D . Nguyen" <nguyenb@codeaurora.org>
Subject: Re: [PATCH V4 6/7] mmc: sdhci: Set error state for mmc driver
Date: Tue, 8 Mar 2022 12:06:26 +0200 [thread overview]
Message-ID: <01515ee6-b312-7f81-43f0-e72a0d290046@intel.com> (raw)
In-Reply-To: <1646226227-32429-7-git-send-email-quic_c_sbhanu@quicinc.com>
On 2.3.2022 15.03, Shaik Sajida Bhanu wrote:
> Set error state if any errors observed in eMMC and SD card driver level.
>
> Signed-off-by: Liangliang Lu <luliang@codeaurora.org>
> Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
> Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
> Signed-off-by: Shaik Sajida Bhanu <quic_c_sbhanu@quicinc.com>
> ---
> drivers/mmc/host/sdhci.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 741fb06..4ba3797 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -224,6 +224,8 @@ void sdhci_reset(struct sdhci_host *host, u8 mask)
> if (timedout) {
> pr_err("%s: Reset 0x%x never completed.\n",
> mmc_hostname(host->mmc), (int)mask);
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
I really do not understand why this cannot be another err_stats entry
such as MMC_ERR_DRIVER and then as below?
sdhci_err_stats_inc(host, DRIVER);
> sdhci_dumpregs(host);
> return;
> }
> @@ -1716,6 +1718,8 @@ static bool sdhci_send_command_retry(struct sdhci_host *host,
> if (!timeout--) {
> pr_err("%s: Controller never released inhibit bit(s).\n",
> mmc_hostname(host->mmc));
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
> cmd->error = -EIO;
> return false;
> @@ -1965,6 +1969,8 @@ void sdhci_enable_clk(struct sdhci_host *host, u16 clk)
> if (timedout) {
> pr_err("%s: Internal clock never stabilised.\n",
> mmc_hostname(host->mmc));
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
> return;
> }
> @@ -1987,6 +1993,8 @@ void sdhci_enable_clk(struct sdhci_host *host, u16 clk)
> if (timedout) {
> pr_err("%s: PLL clock never stabilised.\n",
> mmc_hostname(host->mmc));
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
> return;
> }
> @@ -3162,6 +3170,8 @@ static void sdhci_timeout_timer(struct timer_list *t)
> mmc_debugfs_err_stats_inc(host->mmc, MMC_ERR_REQ_TIMEOUT);
> pr_err("%s: Timeout waiting for hardware cmd interrupt.\n",
> mmc_hostname(host->mmc));
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
>
> host->cmd->error = -ETIMEDOUT;
> @@ -3185,6 +3195,8 @@ static void sdhci_timeout_data_timer(struct timer_list *t)
> mmc_debugfs_err_stats_inc(host->mmc, MMC_ERR_REQ_TIMEOUT);
> pr_err("%s: Timeout waiting for hardware interrupt.\n",
> mmc_hostname(host->mmc));
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
>
> if (host->data) {
> @@ -3236,6 +3248,8 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *intmask_p)
> return;
> pr_err("%s: Got command interrupt 0x%08x even though no command operation was in progress.\n",
> mmc_hostname(host->mmc), (unsigned)intmask);
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
> return;
> }
> @@ -3289,6 +3303,8 @@ static void sdhci_adma_show_error(struct sdhci_host *host)
> void *desc = host->adma_table;
> dma_addr_t dma = host->adma_addr;
>
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
>
> while (true) {
> @@ -3378,6 +3394,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
>
> pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n",
> mmc_hostname(host->mmc), (unsigned)intmask);
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
>
> return;
> @@ -3599,6 +3617,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
> if (unexpected) {
> pr_err("%s: Unexpected interrupt 0x%08x.\n",
> mmc_hostname(host->mmc), unexpected);
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
> }
>
> @@ -3962,6 +3982,8 @@ bool sdhci_cqe_irq(struct sdhci_host *host, u32 intmask, int *cmd_error,
> sdhci_writel(host, intmask, SDHCI_INT_STATUS);
> pr_err("%s: CQE: Unexpected interrupt 0x%08x.\n",
> mmc_hostname(host->mmc), intmask);
> + if (host->mmc && !host->mmc->err_state)
> + mmc_debugfs_err_stats_enable(host->mmc);
> sdhci_dumpregs(host);
> }
>
next prev parent reply other threads:[~2022-03-08 10:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 13:03 [PATCH V4 0/7] mmc: add error statistics for eMMC and SD card Shaik Sajida Bhanu
2022-03-02 13:03 ` [PATCH V4 1/7] mmc: core: Capture eMMC and SD card errors Shaik Sajida Bhanu
2022-03-08 9:44 ` Adrian Hunter
2022-03-12 17:59 ` Sajida Bhanu (Temp) (QUIC)
2022-03-02 13:03 ` [PATCH V4 2/7] mmc: sdhci: " Shaik Sajida Bhanu
2022-03-08 9:36 ` Adrian Hunter
2022-03-12 17:48 ` Sajida Bhanu (Temp) (QUIC)
2022-03-02 13:03 ` [PATCH V4 3/7] mmc: debugfs: Add debug fs entry for mmc driver Shaik Sajida Bhanu
2022-03-08 9:49 ` Adrian Hunter
2022-03-12 18:05 ` Sajida Bhanu (Temp) (QUIC)
2022-03-02 13:03 ` [PATCH V4 4/7] mmc: debugfs: Add debug fs error state " Shaik Sajida Bhanu
2022-03-02 13:03 ` [PATCH V4 5/7] mmc: core: Set error state " Shaik Sajida Bhanu
2022-03-02 13:03 ` [PATCH V4 6/7] mmc: sdhci: " Shaik Sajida Bhanu
2022-03-08 10:06 ` Adrian Hunter [this message]
2022-03-12 18:15 ` Sajida Bhanu (Temp) (QUIC)
2022-03-16 5:58 ` Adrian Hunter
2022-03-17 4:49 ` Sajida Bhanu (Temp) (QUIC)
2022-03-02 13:03 ` [PATCH V4 7/7] 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=01515ee6-b312-7f81-43f0-e72a0d290046@intel.com \
--to=adrian.hunter@intel.com \
--cc=agross@kernel.org \
--cc=asutoshd@quicinc.com \
--cc=bjorn.andersson@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=nguyenb@codeaurora.org \
--cc=quic_c_sbhanu@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=quic_vbadigan@quicinc.com \
--cc=sayalil@codeaurora.org \
--cc=ulf.hansson@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).