Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4909376iob; Mon, 9 May 2022 04:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZgeOQIMaSDTdNJ8LBhNCnVZouZe3dJ6LhzM090/60L/CuVBDdMH8htwDzDz3FTIfoIt4r X-Received: by 2002:a63:9d49:0:b0:3c6:4106:8796 with SMTP id i70-20020a639d49000000b003c641068796mr13082010pgd.520.1652096353828; Mon, 09 May 2022 04:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652096353; cv=none; d=google.com; s=arc-20160816; b=YqKehaW+iwoliuSquXgArxgbW5BVyDp8xyYvAaf7k0cevalL4L/t1pBXtSU1uQZIvP MtEdRxuz2MJVB3ioTjAYGMvynOIX5U2RAf47uSkCbxehDP8APLEzIqQbBid9JE4yub3R guEx3Ag3JncexyWWAPiylaE13u0ePvujLYT6RRMTZIiIioo9w0S068pljukTs2kbOSxc FzPla91cvHS2fjwpk7mhxYHDdYLsAOt6zoaLbZgCribgIrrHLq9pBsre4kAdXazJDOuM lF85Lfs+F+0yScNu5QJvi5rKIjanrua2yKyJsJqz840XBkRPT1hhjC3VFrY/sh0EitUD 2GXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=hIsCP4FjDSnGHwqf621W+ZKgvM6jNyMg0I5DcCDJkig=; b=mFI9se8pimC93AUaX0kSGtv+5wRy6dP1b4rNJQi9BF7xdz6zhczZwvmIgpBGDWAfl4 ZOvZusW9HmI5YU9LId5V5JwdJfxNazYCXJOHJ4i+bxZZYGeFWnYYGmoaKrF1Oi67x77U jXMGckR+wB8ifDp6kgwxsOPs5KCkJrLPXDeIhLMh/yIigoInDXjyNHcAT1HZAAIMjTNQ 7NOvdJXFhErcd2Gq97SLtWDRbptN3JYOJgD5jGs3wF303MOBsRsgLqXhwRy+KTT/qsNJ q2cadDJgKaHb9GAZIp4jVBd38Vca0F5GJBB+YWmbZQ4HGKo3f4LA/7Hqf5CIu5KDhxkG 1hlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=fvYulAZ4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p42-20020a056a000a2a00b004fa3a8e0084si16309893pfh.315.2022.05.09.04.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 04:39:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=fvYulAZ4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0A8502D6273; Mon, 9 May 2022 03:42:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231184AbiEIKg7 (ORCPT + 99 others); Mon, 9 May 2022 06:36:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232494AbiEIKg2 (ORCPT ); Mon, 9 May 2022 06:36:28 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEBCB11AFD5; Mon, 9 May 2022 03:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652092354; x=1683628354; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=hIsCP4FjDSnGHwqf621W+ZKgvM6jNyMg0I5DcCDJkig=; b=fvYulAZ4WfiGPJR22mxsfMmX/YpxHSyWmWBP4otz4KmzwswKXYUsIPNH 4JAtALOY4yL1NE+CvxcXFk/7juEY4cS1cH6xKdoGYEqw95Ufn17Qyx9VS oTRY5Ytq1+DTwjs6xDRZIfeyjh5tKybXOXhtciLGCSK2TVt4NG5TpIY1y s=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 09 May 2022 03:32:32 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2022 03:32:32 -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 03:32:31 -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 03:32:25 -0700 Message-ID: Date: Mon, 9 May 2022 16:02:19 +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> <5c2a9eae-3ab2-1fa4-c7df-ba7384e07b24@quicinc.com> <9261a62d-e496-ba2b-74f4-627e0a5e6abe@intel.com> From: "Sajida Bhanu (Temp)" In-Reply-To: <9261a62d-e496-ba2b-74f4-627e0a5e6abe@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/9/2022 3:33 PM, Adrian Hunter wrote: > On 9/05/22 12:42, Sajida Bhanu (Temp) wrote: >> Hi, >> >> Thank you for the review. >> >> Please find the inline comments. >> >> Thanks, >> >> Sajida >> >> On 4/26/2022 1:24 PM, 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 >> Sure >>>> +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. >> MMC_ERR_ICE_CFG --> we don't have ICE config. > So err_stats[MMC_ERR_ICE_CFG] would be zero and make > no difference. > > If you are going to check all then you could loop > through them > > *val = 0; > for (i = 0; i < MMC_ERR_MAX; i++) { > if (host->err_stats[i]) { > *val = 1; > break; > } > } Sure Thanks >> Remaining we need to update, Thank you for pointing. >> >>>> + *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"); >>>> >>>> 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); >>>>