From patchwork Fri Dec 30 11:32:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ritesh Harjani X-Patchwork-Id: 9492011 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6BB3662ABC for ; Fri, 30 Dec 2016 11:33:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 649AD1FF29 for ; Fri, 30 Dec 2016 11:33:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53EDD203C0; Fri, 30 Dec 2016 11:33:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA5D020649 for ; Fri, 30 Dec 2016 11:33:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753943AbcL3Lc5 (ORCPT ); Fri, 30 Dec 2016 06:32:57 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:47408 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753851AbcL3Lc4 (ORCPT ); Fri, 30 Dec 2016 06:32:56 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id F01D9611A4; Fri, 30 Dec 2016 11:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1483097575; bh=Yji2AkDroSMqVDV4NMvTFjx7tkcIhkjeP5DZPZPJRvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SJnSlz64kvb4E2jO9J2fI+QbcpCMl3Tg0Qp8QV5ISeiKP2zxn6r50mROAquOA3gn9 tdtJ7LUcWmuK9b+ugd7t9C8NqLsOmKfBFTrCQwgNBZ8+Ss/CB3udAmfsvIk/F5Mu5f kCFFKMpZN0Tz3eaDElQQEMNS9q1L+kpLunEMNkt0= Received: from rharjani-linux.qualcomm.com (unknown [202.46.23.54]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: riteshh@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id EF788614E4; Fri, 30 Dec 2016 11:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1483097573; bh=Yji2AkDroSMqVDV4NMvTFjx7tkcIhkjeP5DZPZPJRvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RGpQrXosUPFZnugGTnrwSwkTOmT/jQFCohiZKvxQZfH7aAcnMg/YmM0ztzKHVUk8N Y95ZVEPLrMTDWMB2F5//gFv0uwDOd4cbxJltEyX/sdH5vMC7rP69u/919t3F84Gyon vKKkptsVif0cM+KsifCs2x6ZjJ5hDq2UAQ+buon0= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org EF788614E4 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=riteshh@codeaurora.org From: Ritesh Harjani To: ulf.hansson@linaro.org, adrian.hunter@intel.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, shawn.lin@rock-chips.com, stummala@codeaurora.org, georgi.djakov@linaro.org, linux-arm-msm@vger.kernel.org, pramod.gurav@linaro.org, jeremymc@redhat.com, venkatg@codeaurora.org, asutoshd@codeaurora.org, subhashj@codeaurora.org, Ritesh Harjani Subject: [RFC PATCH 3/3] mmc: sdhci: Add more debug info in case of data error Date: Fri, 30 Dec 2016 17:02:11 +0530 Message-Id: <1483097531-9991-4-git-send-email-riteshh@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1483097531-9991-1-git-send-email-riteshh@codeaurora.org> References: <1483097531-9991-1-git-send-email-riteshh@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP print error log message and dump sdhc registers for debugging purpose in case of data errors (except when tuning commands generate CRC/timeout/end bit errors). Signed-off-by: Ritesh Harjani --- drivers/mmc/host/sdhci.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 73a8918..2e51e49 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2616,9 +2616,26 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) host->ops->adma_workaround(host, intmask); } - if (host->data->error) + if (host->data->error) { + bool pr_msg = true; + + if (intmask & (SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | + SDHCI_INT_DATA_END_BIT)) { + command = SDHCI_GET_CMD(sdhci_readw(host, + SDHCI_COMMAND)); + if (command == MMC_SEND_TUNING_BLOCK_HS200 || + command == MMC_SEND_TUNING_BLOCK) + pr_msg = false; + } + if (pr_msg) { + pr_err("%s: data txfr (0x%08x) error: %d\n", + mmc_hostname(host->mmc), intmask, + host->data->error); + sdhci_dumpregs(host); + } + sdhci_finish_data(host); - else { + } else { if (intmask & (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL)) sdhci_transfer_pio(host);