[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c774e527-7bd8-d731-6f68-8fdca87d99be@nvidia.com>
Date: Fri, 14 Jun 2019 09:16:50 -0700
From: Bitan Biswas <bbiswas@...dia.com>
To: Thierry Reding <thierry.reding@...il.com>
CC: Jassi Brar <jassisinghbrar@...il.com>,
Thierry Reding <treding@...dia.com>,
Jonathan Hunter <jonathanh@...dia.com>,
<linux-kernel@...r.kernel.org>, <linux-tegra@...r.kernel.org>
Subject: Re: [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes
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@...dia.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
Powered by blists - more mailing lists