lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d30b5ded-c777-4de1-c48f-e7ac1ac37a3b@intel.com>
Date:   Wed, 16 Mar 2022 07:58:03 +0200
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     "Sajida Bhanu (Temp) (QUIC)" <quic_c_sbhanu@...cinc.com>,
        "Asutosh Das (asd)" <asutoshd@...cinc.com>,
        "ulf.hansson@...aro.org" <ulf.hansson@...aro.org>,
        "agross@...nel.org" <agross@...nel.org>,
        "bjorn.andersson@...aro.org" <bjorn.andersson@...aro.org>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        "linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc:     "Veerabhadrarao Badiganti (QUIC)" <quic_vbadigan@...cinc.com>,
        "Ram Prakash Gupta (QUIC)" <quic_rampraka@...cinc.com>,
        "Pradeep Pragallapati (QUIC)" <quic_pragalla@...cinc.com>,
        "Sarthak Garg (QUIC)" <quic_sartgarg@...cinc.com>,
        "Nitin Rawat (QUIC)" <quic_nitirawa@...cinc.com>,
        "Sayali Lokhande (QUIC)" <quic_sayalil@...cinc.com>,
        Sayali Lokhande <sayalil@...eaurora.org>,
        "Bao D . Nguyen" <nguyenb@...eaurora.org>
Subject: Re: [PATCH V4 6/7] mmc: sdhci: Set error state for mmc driver

On 12/03/2022 20:15, Sajida Bhanu (Temp) (QUIC) wrote:
> Hi,
> 
> Thanks for the review.
> 
> Please find the inline comments.
> 
> Thanks,
> Sajida
>> -----Original Message-----
>> From: Adrian Hunter <adrian.hunter@...el.com>
>> Sent: Tuesday, March 8, 2022 3:36 PM
>> To: Sajida Bhanu (Temp) (QUIC) <quic_c_sbhanu@...cinc.com>; Asutosh
>> Das (asd) <asutoshd@...cinc.com>; ulf.hansson@...aro.org;
>> agross@...nel.org; bjorn.andersson@...aro.org; linux-
>> mmc@...r.kernel.org; linux-arm-msm@...r.kernel.org; linux-
>> kernel@...r.kernel.org
>> Cc: Veerabhadrarao Badiganti (QUIC) <quic_vbadigan@...cinc.com>; Ram
>> Prakash Gupta (QUIC) <quic_rampraka@...cinc.com>; Pradeep Pragallapati
>> (QUIC) <quic_pragalla@...cinc.com>; Sarthak Garg (QUIC)
>> <quic_sartgarg@...cinc.com>; Nitin Rawat (QUIC)
>> <quic_nitirawa@...cinc.com>; Sayali Lokhande (QUIC)
>> <quic_sayalil@...cinc.com>; Sayali Lokhande <sayalil@...eaurora.org>; Bao
>> D . Nguyen <nguyenb@...eaurora.org>
>> Subject: Re: [PATCH V4 6/7] mmc: sdhci: Set error state for mmc driver
>>
>> On 2.3.2022 15.03, Shaik Sajida Bhanu wrote:
>>> Set error state if any errors observed in eMMC and SD card driver level.
>>>
>>> Signed-off-by: Liangliang Lu <luliang@...eaurora.org>
>>> Signed-off-by: Sayali Lokhande <sayalil@...eaurora.org>
>>> Signed-off-by: Bao D. Nguyen <nguyenb@...eaurora.org>
>>> Signed-off-by: Ram Prakash Gupta <quic_rampraka@...cinc.com>
>>> Signed-off-by: Shaik Sajida Bhanu <quic_c_sbhanu@...cinc.com>
>>> ---
>>>  drivers/mmc/host/sdhci.c | 22 ++++++++++++++++++++++
>>>  1 file changed, 22 insertions(+)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
>>> 741fb06..4ba3797 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -224,6 +224,8 @@ void sdhci_reset(struct sdhci_host *host, u8 mask)
>>>  		if (timedout) {
>>>  			pr_err("%s: Reset 0x%x never completed.\n",
>>>  				mmc_hostname(host->mmc), (int)mask);
>>> +			if (host->mmc && !host->mmc->err_state)
>>> +				mmc_debugfs_err_stats_enable(host-
>>> mmc);
>>
>> I really do not understand why this cannot be another err_stats entry such as
>> MMC_ERR_DRIVER and then as below?
>>
>> 			sdhci_err_stats_inc(host, DRIVER);
>>
>>
> Hi,
> 
> err_stats having all the error types.
> err_state is not the error type, if err_state set means some errors occurred in driver and we will go and check err_stats to know exact error.


In sdhci.c use only sdhci_err_stats_inc() adding err_stats entries as needed.
Seems like there are controller timeouts (say MMC_ERR_CTRL_TIMEOUT) and
unexpected interrupts (say MMC_ERR_UNEXPECTED_IRQ)

In drivers/mmc/core/debugfs.c calculate err_state as needed e.g.

static int mmc_err_state_get(void *data, u64 *val)
{
	struct mmc_host *host = data;

	*val = host->err_stats[MMC_ERR_REQ_TIMEOUT] ||
	       host->err_stats[MMC_ERR_CTRL_TIMEOUT] ||
	       host->err_stats[MMC_ERR_UNEXPECTED_IRQ] ||
	       <etc>

	return 0;
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ