public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Ashish Mhetre <amhetre@nvidia.com>,
	digetx@gmail.com, krzysztof.kozlowski@linaro.org,
	thierry.reding@gmail.com, jonathanh@nvidia.com,
	robh+dt@kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-tegra@vger.kernel.org,
	krzysztof.kozlowski+dt@linaro.org
Cc: vdumpa@nvidia.com, Snikam@nvidia.com
Subject: Re: [Patch v7 2/4] memory: tegra: Add MC error logging on tegra186 onward
Date: Fri, 15 Apr 2022 00:14:47 +0300	[thread overview]
Message-ID: <274d09f6-2d07-920b-661b-95d899262c9b@collabora.com> (raw)
In-Reply-To: <534dbd19-b43b-63e6-69e0-3441dd224ef0@nvidia.com>

On 4/14/22 08:31, Ashish Mhetre wrote:
> 
> 
> On 4/14/2022 2:43 AM, Dmitry Osipenko wrote:
>> External email: Use caution opening links or attachments
>>
>>
>> On 4/13/22 12:40, Ashish Mhetre wrote:
>>> +irqreturn_t tegra30_mc_handle_irq(int irq, void *data)
>>>   {
>>>        struct tegra_mc *mc = data;
>>> +     unsigned int bit, channel;
>>>        unsigned long status;
>>> -     unsigned int bit;
>>>
>>> -     /* mask all interrupts to avoid flooding */
>>> -     status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask;
>>> +     if (mc->soc->num_channels) {
>>> +             u32 global_status;
>>> +             int err;
>>> +
>>> +             global_status = mc_ch_readl(mc, MC_BROADCAST_CHANNEL,
>>> MC_GLOBAL_INTSTATUS);
>>
>> This will crash if mc->bcast_ch_regs = ERR_PTR(-EINVAL) for older dtbs.
> 
> Actually interrupts won't occur till we write MC_INTMASK register from
> broadcast channel with appropriate intmask value. I have added check in
> tegra_mc_probe() while registering irq which will write MC_INTMASK from
> broadcast only when mc->bcast_ch_regs is initialized i.e.
> !IS_ERR(mc->bcast_ch_regs).
> So interrupt handler won't be triggered at all if
> mc->bcast_ch_regs = ERR_PTR(-EINVAL).
> 

Should be cleaner to set mc->bcast_ch_regs to NULL anyways. The ERR_PTR
doesn't add much value and only makes code less readable.

  reply	other threads:[~2022-04-14 21:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13  9:40 [Patch v7 0/4] memory: tegra: Add MC channels and error logging Ashish Mhetre
2022-04-13  9:40 ` [Patch v7 1/4] memory: tegra: Add memory controller channels support Ashish Mhetre
2022-04-13 21:17   ` Dmitry Osipenko
2022-04-14  5:35     ` Ashish Mhetre
2022-04-14 21:11   ` Dmitry Osipenko
2022-04-13  9:40 ` [Patch v7 2/4] memory: tegra: Add MC error logging on tegra186 onward Ashish Mhetre
2022-04-13 21:13   ` Dmitry Osipenko
2022-04-14  5:31     ` Ashish Mhetre
2022-04-14 21:14       ` Dmitry Osipenko [this message]
2022-04-13 21:17   ` Dmitry Osipenko
2022-04-14 20:36   ` Dmitry Osipenko
2022-04-13  9:40 ` [Patch v7 3/4] dt-bindings: memory: Update reg/reg-names validation Ashish Mhetre
2022-04-13 12:26   ` Rob Herring
2022-04-13 13:37   ` Rob Herring
2022-04-13 14:04     ` Dmitry Osipenko
2022-04-13 16:17       ` Ashish Mhetre
2022-04-13 21:09         ` Dmitry Osipenko
2022-04-14  4:07           ` Ashish Mhetre
2022-04-14 20:35             ` Dmitry Osipenko
2022-04-17  9:27     ` Ashish Mhetre
2022-04-24  5:20       ` Ashish Mhetre
2022-04-24 14:34         ` Krzysztof Kozlowski
2022-04-25  4:48           ` Ashish Mhetre
2022-04-13  9:40 ` [Patch v7 4/4] arm64: tegra: Add memory controller channels Ashish Mhetre

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=274d09f6-2d07-920b-661b-95d899262c9b@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=Snikam@nvidia.com \
    --cc=amhetre@nvidia.com \
    --cc=devicetree@vger.kernel.org \
    --cc=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=robh+dt@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