From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6608EC433EF for ; Mon, 9 May 2022 09:50:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232686AbiEIJyO (ORCPT ); Mon, 9 May 2022 05:54:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240057AbiEIJsL (ORCPT ); Mon, 9 May 2022 05:48:11 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28566AE266; Mon, 9 May 2022 02:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652089458; x=1683625458; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=LHL52xpf9fNO2i40bs+m4ylQ6avZ700ivayzAClrluA=; b=VvCFg2x9v6WXDtpufiSDRZuNY8tEyjYs0OcQRgZ/6he9iDei/m3sdcrX wXvhbc6RSYaf8L183YLR6TzIcck6eyxj9ekI1VlRci2RftOjLvo72LX3B UWPirkn3GdXis3fRexhKH9hTXoRR7nyLV0iO7ZKh8Y1kWvtB9JIvRiz+U 4=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 09 May 2022 02:44:18 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2022 02:44:17 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 9 May 2022 02:44:16 -0700 Received: from [10.216.5.153] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 9 May 2022 02:44:11 -0700 Message-ID: <42d7cbc9-06ec-20c3-71fb-23edb451ff9c@quicinc.com> Date: Mon, 9 May 2022 15:14:08 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH V5 4/5] mmc: debugfs: Add debug fs error state entry for mmc driver Content-Language: en-US To: Adrian Hunter , , , , , , , CC: , , , , , , , , Liangliang Lu , "Bao D . Nguyen" References: <1650902443-26357-1-git-send-email-quic_c_sbhanu@quicinc.com> <1650902443-26357-5-git-send-email-quic_c_sbhanu@quicinc.com> <3459875e-782d-d2bd-ba1f-c945e22e312e@intel.com> From: "Sajida Bhanu (Temp)" In-Reply-To: <3459875e-782d-d2bd-ba1f-c945e22e312e@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thank you for review. Please find the inline comments. Thanks, Sajida On 4/26/2022 1:28 PM, Adrian Hunter wrote: > On 26/04/22 10:54, Adrian Hunter wrote: >> On 25/04/22 19:00, Shaik Sajida Bhanu wrote: >>> Add debug fs entry error state to query eMMC and SD card errors statistics. >>> If any errors occurred in eMMC and SD card driver level then >>> err_state value will be set to 1. >>> >>> Signed-off-by: Liangliang Lu >>> Signed-off-by: Sayali Lokhande >>> Signed-off-by: Bao D. Nguyen >>> Signed-off-by: Shaik Sajida Bhanu >>> --- >>> drivers/mmc/core/debugfs.c | 25 +++++++++++++++++++++++++ >>> 1 file changed, 25 insertions(+) >>> >>> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c >>> index 6aa5a60..2f5b63f 100644 >>> --- a/drivers/mmc/core/debugfs.c >>> +++ b/drivers/mmc/core/debugfs.c >>> @@ -222,6 +222,29 @@ static int mmc_clock_opt_set(void *data, u64 val) >>> >>> DEFINE_DEBUGFS_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set, >>> "%llu\n"); >> A blank line would be nice here >> >>> +static int mmc_err_state_get(void *data, u64 *val) >>> +{ >>> + struct mmc_host *host = data; >>> + >>> + if (!host) >>> + return -EINVAL; >>> + >> I am not sure why you have left out some err_stats[]. >> Why not all of them? At least, it needs a comment to explain. >> >>> + *val = host->err_stats[MMC_ERR_REQ_TIMEOUT] || >>> + host->err_stats[MMC_ERR_ADMA] || >>> + host->err_stats[MMC_ERR_CTRL_TIMEOUT] || >>> + host->err_stats[MMC_ERR_UNEXPECTED_IRQ] || >>> + host->err_stats[MMC_ERR_CMDQ_RED] || >>> + host->err_stats[MMC_ERR_CMDQ_GCE] || >>> + host->err_stats[MMC_ERR_CMDQ_ICCE] || >>> + host->err_stats[MMC_ERR_DAT_TIMEOUT] || >>> + host->err_stats[MMC_ERR_DAT_CRC] || >>> + host->err_stats[MMC_ERR_CMD_CRC] || >>> + host->err_stats[MMC_ERR_CMD_TIMEOUT]; >>> + >>> + return 0; >>> +} >>> + >>> +DEFINE_SIMPLE_ATTRIBUTE(mmc_err_state, mmc_err_state_get, NULL, "%llu\n"); > Also, if possible, please use DEFINE_DEBUGFS_ATTRIBUTE / debugfs_create_file_unsafe > in this case Sure.. will useĀ  DEFINE_DEBUGFS_ATTRIBUTE > >>> >>> static int mmc_err_stats_show(struct seq_file *file, void *data) >>> { >>> @@ -289,6 +312,8 @@ void mmc_add_host_debugfs(struct mmc_host *host) >>> debugfs_create_file_unsafe("clock", S_IRUSR | S_IWUSR, root, host, >>> &mmc_clock_fops); >>> >>> + debugfs_create_file("err_state", 0600, root, host, >>> + &mmc_err_state); >>> debugfs_create_file("err_stats", 0600, root, host, >>> &mmc_err_stats_fops); >>>