From patchwork Fri Jan 20 06:26:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ritesh Harjani X-Patchwork-Id: 9527471 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 AC41D60113 for ; Fri, 20 Jan 2017 06:26:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99CC728616 for ; Fri, 20 Jan 2017 06:26:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C0242867E; Fri, 20 Jan 2017 06:26:54 +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 150EA28616 for ; Fri, 20 Jan 2017 06:26:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751268AbdATG0w (ORCPT ); Fri, 20 Jan 2017 01:26:52 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:38060 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751252AbdATG0w (ORCPT ); Fri, 20 Jan 2017 01:26:52 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 587A5609FB; Fri, 20 Jan 2017 06:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1484893611; bh=jt0cgNQwFoPaGmwl4sP0NTasTER1d6O1Md+w7516ws8=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=GBgoDdT4U3eObwIJSWVtwrIUjf0FA7XlZDEDuk4RLTfC5gJDBwT8vcTaUfEej5iPt 3sOKXxUGHb+Ygj1A1+Z4RvZc60KpAL6TPp0LMSLS0GwIMdIbK84exGL1ym/quvy9QN 6f7nu5EgDV6d8ZWcS1NawCfuwPq9/LmceFCNkxYo= Received: from [10.44.20.116] (unknown [202.46.23.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: riteshh@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id AC3106095E; Fri, 20 Jan 2017 06:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1484893610; bh=jt0cgNQwFoPaGmwl4sP0NTasTER1d6O1Md+w7516ws8=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=m1OC9BHdixePPzt/vFUGTZqon5Ta3ECFAk5xquCP36XjsXQT+7O4uE2o0i2kBT2oh jCHgC26TWZf62j8EF0+QXs4jWlj7krlFd4sSi7bBqF2SQ/zLy+aFvh4rvmXDoNLa8T ySflJkuIKLxKxdE74zthy2AFX+1Xrk+YGHHGiX9w= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AC3106095E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=riteshh@codeaurora.org Subject: Re: [RESEND RFC 3/3] mmc: sdhci: Add more debug info in case of data error To: Adrian Hunter References: <1484030515-16722-1-git-send-email-riteshh@codeaurora.org> <1484030515-16722-4-git-send-email-riteshh@codeaurora.org> <74840dea-18b6-3b51-67ae-e1ce3bb7fb58@intel.com> Cc: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, shawn.lin@rock-chips.com, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org, asutoshd@codeaurora.org, stummala@codeaurora.org, venkatg@codeaurora.org, pramod.gurav@linaro.org, jeremymc@redhat.com From: Ritesh Harjani Message-ID: Date: Fri, 20 Jan 2017 11:56:43 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <74840dea-18b6-3b51-67ae-e1ce3bb7fb58@intel.com> 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 Hi Adrian, Thanks for reviewing. On 1/19/2017 5:24 PM, Adrian Hunter wrote: > On 10/01/17 08:41, Ritesh Harjani wrote: >> 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). > > It is a bit ugly and probably only useful during driver development, so I am > not at all enthusiastic about this. Ok, since this patch was anyway for debugging, I will drop this patch for now. I will revisit in case if the need really arises, since this could be useful in debugging data txfr error and avoid re-test cycle to get sdhci register dumps. Also, Do you think we should have this below change added? Could you please give your thoughts on this. Jeremy and I feel that even below info can be helpful along with sdhci_dumpregs - He requested me to take below diff as another patch in my next revision of this series which he has submitted here - https://patchwork.kernel.org/patch/9442449/ { pr_err(DRIVER_NAME ": =========== REGISTER DUMP (%s)===========\n", @@ -100,6 +121,10 @@ static void sdhci_dumpregs(struct sdhci_host *host) readl(host->ioaddr + SDHCI_ADMA_ADDRESS)); } + if (host->ops->dump_vendor_regs) + host->ops->dump_vendor_regs(host); + + sdhci_dump_state(host); pr_err(DRIVER_NAME ": ===========================================\n"); } Regards Ritesh > >> >> Signed-off-by: Ritesh Harjani >> Signed-off-by: Asutosh Das >> --- >> 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); >> >> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 71654b9..5911f98 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -47,6 +47,27 @@ static void sdhci_finish_data(struct sdhci_host *); static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable); +static void sdhci_dump_rpm_info(struct sdhci_host *host) +{ + struct mmc_host *mmc = host->mmc; + + pr_info("%s: rpmstatus[pltfm](runtime-suspend:usage_count:disable_depth)(%d:%d:%d)\n", + mmc_hostname(mmc), mmc->parent->power.runtime_status, + atomic_read(&mmc->parent->power.usage_count), + mmc->parent->power.disable_depth); +} + + +static void sdhci_dump_state(struct sdhci_host *host) +{ + struct mmc_host *mmc = host->mmc; + + pr_info("%s: clk: %d claimer: %s pwr: %d\n", + mmc_hostname(mmc), host->clock, + mmc->claimer->comm, host->pwr); + sdhci_dump_rpm_info(host); +} + static void sdhci_dumpregs(struct sdhci_host *host)