mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Ashish Mhetre <amhetre@nvidia.com>,
	thierry.reding@gmail.com, jonathanh@nvidia.com,
	linux-tegra@vger.kernel.org, krzysztof.kozlowski@canonical.com,
	linux-kernel@vger.kernel.org
Cc: Snikam@nvidia.com, vdumpa@nvidia.com
Subject: Re: [Patch V3] memory: tegra: Add MC error logging on tegra186 onward
Date: Fri, 21 Jan 2022 15:31:06 +0300	[thread overview]
Message-ID: <dc9b0c08-bd2a-6ffa-ad75-47afd036f3ef@gmail.com> (raw)
In-Reply-To: <1642763962-32129-1-git-send-email-amhetre@nvidia.com>

...
> @@ -529,12 +536,44 @@ static irqreturn_t tegra30_mc_handle_irq(int irq, void *data)
>  		u8 id, type;
>  		u32 value;
>  
> -		value = mc_readl(mc, MC_ERR_STATUS);
> +		switch (bit) {

Again, I see that the code wasn't tested :/ Shouldn't be too difficult
to create memory-read errors to check that at least basics work
properly. Please always test your changes next time.

So it must be "switch(BIT(bit))" here, please write it like this:

u32 intmask = BIT(bit);
...
	switch(intmask) {

> +		case MC_INT_DECERR_VPR:
> +			status_reg = MC_ERR_VPR_STATUS;
> +			addr_reg = MC_ERR_VPR_ADR;
> +			break;

Please add newline after every "break;" of every case. This will make
code easier to read a tad.

> +		case MC_INT_SECERR_SEC:
> +			status_reg = MC_ERR_SEC_STATUS;
> +			addr_reg = MC_ERR_SEC_ADR;
> +			break;
> +		case MC_INT_DECERR_MTS:
> +			status_reg = MC_ERR_MTS_STATUS;
> +			addr_reg = MC_ERR_MTS_ADR;
> +			break;
> +		case MC_INT_DECERR_GENERALIZED_CARVEOUT:
> +			status_reg = MC_ERR_GENERALIZED_CARVEOUT_STATUS;
> +			addr_reg = MC_ERR_GENERALIZED_CARVEOUT_ADR;
> +			break;
> +		case MC_INT_DECERR_ROUTE_SANITY:
> +			status_reg = MC_ERR_ROUTE_SANITY_STATUS;
> +			addr_reg = MC_ERR_ROUTE_SANITY_ADR;
> +			break;
> +		default:
> +			status_reg = MC_ERR_STATUS;
> +			addr_reg = MC_ERR_ADR;

Add newline here too.

> +			if (mc->soc->has_addr_hi_reg)
> +				addr_hi_reg = MC_ERR_ADR_HI;
> +			break;
> +		}
...
Note that you could use "git format-patch -v4 ..." instead of manually
changing the [PATCH] prefix.

  reply	other threads:[~2022-01-21 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21 11:19 Ashish Mhetre
2022-01-21 12:31 ` Dmitry Osipenko [this message]
2022-01-21 18:49   ` Krzysztof Kozlowski
2022-01-21 18:51     ` Krzysztof Kozlowski
2022-01-21 18:40 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc9b0c08-bd2a-6ffa-ad75-47afd036f3ef@gmail.com \
    --to=digetx@gmail.com \
    --cc=Snikam@nvidia.com \
    --cc=amhetre@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=vdumpa@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome