public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Bitan Biswas <bbiswas@nvidia.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Jassi Brar <jassisinghbrar@gmail.com>,
	Thierry Reding <treding@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes
Date: Fri, 14 Jun 2019 09:16:50 -0700	[thread overview]
Message-ID: <c774e527-7bd8-d731-6f68-8fdca87d99be@nvidia.com> (raw)
In-Reply-To: <20190614155210.GC26922@ulmo>



On 6/14/19 8:52 AM, Thierry Reding wrote:
> On Fri, Jun 14, 2019 at 05:35:34AM -0700, Bitan Biswas wrote:
>> If Tegra hsp device tree does not have 'shared irqs',
> 
> s/hsp/HSP/, otherwise looks good.
Shall correct.

> 
> Thierry
> 
>> mailboxes pointer is NULL. Add non-NULL HSP mailboxes
>> check in resume callback before tegra_hsp_mailbox_startup()
>> call and prevent NULL pointer exception.
>>
>> Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
>> ---
>>   drivers/mailbox/tegra-hsp.c | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c
>> index f147374..a11fb1c 100644
>> --- a/drivers/mailbox/tegra-hsp.c
>> +++ b/drivers/mailbox/tegra-hsp.c
>> @@ -782,11 +782,13 @@ static int __maybe_unused tegra_hsp_noirq_resume(struct device *dev)
>>   			tegra_hsp_doorbell_startup(db->channel.chan);
>>   	}
>>   
>> -	for (i = 0; i < hsp->num_sm; i++) {
>> -		struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>> +	if (hsp->mailboxes) {
>> +		for (i = 0; i < hsp->num_sm; i++) {
>> +			struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
>>   
>> -		if (mb->channel.chan->cl)
>> -			tegra_hsp_mailbox_startup(mb->channel.chan);
>> +			if (mb->channel.chan->cl)
>> +				tegra_hsp_mailbox_startup(mb->channel.chan);
>> +		}
>>   	}
>>   
>>   	return 0;
>> -- 
>> 2.7.4

-Thanks,
  Bitan

  reply	other threads:[~2019-06-14 16:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 12:35 [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume Bitan Biswas
2019-06-14 12:35 ` [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes Bitan Biswas
2019-06-14 15:52   ` Thierry Reding
2019-06-14 16:16     ` Bitan Biswas [this message]
2019-06-14 15:50 ` [PATCH V1 1/2] mailbox: tegra: hsp: add noirq resume Thierry Reding
2019-06-14 16:11   ` Bitan Biswas

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=c774e527-7bd8-d731-6f68-8fdca87d99be@nvidia.com \
    --to=bbiswas@nvidia.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=treding@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