Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1289071pxb; Fri, 21 Jan 2022 14:28:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcP/bdNb/qEv2maC3QAG419cLqFYnW7p7PzrsiZSgXLyx46MoQYqeamo/C6tTVHY0P+cxb X-Received: by 2002:a17:902:a516:b0:14b:1d36:7e6b with SMTP id s22-20020a170902a51600b0014b1d367e6bmr4928311plq.124.1642804098781; Fri, 21 Jan 2022 14:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642804098; cv=none; d=google.com; s=arc-20160816; b=QFhfzv1T51KgjttnP/tcxnTQZbhf17Ky95bJ2hZGxXW+5D0qRnSG8BuPQr8J9UA2MT DIh2KHmyIrXNZuDwDWqL1O2/D+mZ51QiEdq3zVChSFGDCzE9L/5qw2jzSOlBNbxsx4Ko 7sNoDnfcLdwt3LoMJOKOh4JKfdxwFr2a9GRKAD7wFUSak1SEh0L5lsPmmDUA8jLsIMrH BhrkYijJL6NezYfAap8mBNF8KKlz33HhwAq69+MDz/FwSVH3+RHm4NYuk1lKuc3iyJmG DShhiiiA0bvjIIc3pXaqQBq5UAwyBQplWRQKZahS8TllvwHp0VwMflyITXSckH55+eOL oqSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=4daRwd6XUkVJ25mEal3fAjXhPYFJ0f4AY8G1bpkWBSM=; b=GU/M3xNY9goAbwl8UYz8YUYjo8fAMsvWyvf1hITvcGk2GC95qg1sKnZaBwQHTIxpj0 xcwdGsj/PIXoi37cPm/SQlnUm9glnoft+jjWSypTKwWi7iRhB2nluLQ00kLZ/+JHGyO4 mynTpDDHshzf5mwhxJWDn6aP0CjsRzCAeMk/HQJ+1Q2v6P8IYgFuUQyzTL561U+eJBoy JBzmtj4q/H7Ij3A/FnP5ALCtvuznQYGN5wwievFBuSK/9ArqaC8PJarvM4tWbAFrSxA3 zWtGY9JbcEtTsYyIul4lVw5yNf+WkVIIdltAO4qgY9783OLCrptVJT3OlboCTaTHvjFw hc3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=KcAeSXfl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si7034423pgh.547.2022.01.21.14.28.06; Fri, 21 Jan 2022 14:28:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=KcAeSXfl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229926AbiATR2S (ORCPT + 99 others); Thu, 20 Jan 2022 12:28:18 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:48739 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231523AbiATR05 (ORCPT ); Thu, 20 Jan 2022 12:26:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1642699617; x=1674235617; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=4daRwd6XUkVJ25mEal3fAjXhPYFJ0f4AY8G1bpkWBSM=; b=KcAeSXflC1LpyjzOcOILgOH6jl0AVU1UBrI5Oo7usXh+XtA4U4MnCD2K njEa1/ApIsoXhvG6dieJ+PRdMZWOPP0HeeVgj5jAjaq/0ZmTMqljvMBVo owdX9jAUC8N2r+OYfdVZ7QTSsT/laF8Ws96f5xZP8CowQxav0TkLhU8Wt I=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 20 Jan 2022 09:26:57 -0800 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 20 Jan 2022 09:26:55 -0800 X-QCInternal: smtphost Received: from c-sbhanu-linux.qualcomm.com ([10.242.50.201]) by ironmsg01-blr.qualcomm.com with ESMTP; 20 Jan 2022 22:56:39 +0530 Received: by c-sbhanu-linux.qualcomm.com (Postfix, from userid 2344807) id A7018538E; Thu, 20 Jan 2022 22:56:37 +0530 (IST) From: Shaik Sajida Bhanu To: adrian.hunter@intel.com, quic_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: stummala@codeaurora.org, vbadigan@codeaurora.org, quic_rampraka@quicinc.com, quic_pragalla@quicinc.com, sartgarg@codeaurora.org, nitirawa@codeaurora.org, sayalil@codeaurora.org, Shaik Sajida Bhanu , Liangliang Lu , "Bao D . Nguyen" Subject: [PATCH V3 3/4] mmc: core: Capture eMMC and SD card errors Date: Thu, 20 Jan 2022 22:56:21 +0530 Message-Id: <1642699582-14785-4-git-send-email-quic_c_sbhanu@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1642699582-14785-1-git-send-email-quic_c_sbhanu@quicinc.com> References: <1642699582-14785-1-git-send-email-quic_c_sbhanu@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add changes to capture eMMC and SD card errors. This is useful for debug and testing. Signed-off-by: Shaik Sajida Bhanu Signed-off-by: Liangliang Lu Signed-off-by: Sayali Lokhande Signed-off-by: Bao D. Nguyen Signed-off-by: Ram Prakash Gupta --- drivers/mmc/core/core.c | 8 ++++++++ drivers/mmc/core/queue.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 368f104..c586d69 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2242,6 +2242,14 @@ void mmc_rescan(struct work_struct *work) if (freqs[i] <= host->f_min) break; } + + /* + * Ignore the command timeout errors observed during + * the card init as those are excepted. + */ + + if (host && host->err_stats_enabled) + host->err_stats[MMC_ERR_CMD_TIMEOUT] = 0; mmc_release_host(host); out: diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index c69b2d9..7dc9dfb 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -100,6 +100,9 @@ static enum blk_eh_timer_return mmc_cqe_timed_out(struct request *req) enum mmc_issue_type issue_type = mmc_issue_type(mq, req); bool recovery_needed = false; + if (host->err_stats_enabled) + mmc_debugfs_err_stats_inc(host, MMC_ERR_CMDQ_REQ_TIMEOUT); + switch (issue_type) { case MMC_ISSUE_ASYNC: case MMC_ISSUE_DCMD: -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation