Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1143288ybi; Fri, 14 Jun 2019 09:18:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwU6mtAyoYppheWpSZQiOwqspIsjQt4jl7B0zn2sCHdjRAb6TGV/bBmM1O4wSsF2z02jF+p X-Received: by 2002:a17:902:b18f:: with SMTP id s15mr96780305plr.44.1560529109908; Fri, 14 Jun 2019 09:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560529109; cv=none; d=google.com; s=arc-20160816; b=Gqwm0rULtGh+t7EMEnW6txHIEO7jvZrAYRGrKOxYX0x8kJD0bwHp01VPCc20mM+qhS ec4RD48Cn4bc1PUj8QBlCiInYIPFrUwy484K1BwI5P9Y/BxIXaSnhKmnoyc10O3vcTtR IAn8tyKZ6eoDhUisZKgGwD1wBQTf3HJNppWYfzgcc08fos6TqKqFdeygQ0W6zvVLBJZx rxxygiTqdAtyECogTugiabW/0gKvXKN9YlHlDHMfpP5iTnMd0P0JlaFQNxyeQmu5zdH5 MSIIyGJbXDK2rg2oTh7qKqfMy/EN+WPXvbXvsB4Vj9cfQl+5r+jJmi8G/ktdBAzdnGxA gLbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MzSP8jyEG8u6MG6Y0F/p2kf3GqAnZBXD6d8IVDO5Kw8=; b=JEnfdO0Co/ZUW0Fo/pIddDKuhdrI3tBsjsjviGpeJqnD6hj0Uh0LqHXyK/kccUNfF4 lwj2CVdbAQ1pB7OQcggXYWDA18QxnYvhHhlLEFeKctGdg8DtdqV0jYJCl08KSb2YMt0w GTeRduK+Y5WshAtq+D0gCZ4i6JK2KUARdrX4biA4dA4cJj1QqseUZbbrAnp/Hu62Rp12 dBhEo2MYzW6aTr/F3HIgvA6sKkHrg6VUHKONzU2Z+r8mc/+Mr9hzpIXdLgW00KiSK4jB GN5vgKZX6y1dFvH/5uJcWTH440njs4/mLXhX6wWzx2iFCtSmCjaPQzSFghvy9qK5OAvU Cy5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qykwxzgm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si2406551plw.37.2019.06.14.09.18.14; Fri, 14 Jun 2019 09:18:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qykwxzgm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725999AbfFNQQ6 (ORCPT + 99 others); Fri, 14 Jun 2019 12:16:58 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:9440 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbfFNQQ5 (ORCPT ); Fri, 14 Jun 2019 12:16:57 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 14 Jun 2019 09:16:56 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Fri, 14 Jun 2019 09:16:56 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Fri, 14 Jun 2019 09:16:56 -0700 Received: from [10.19.65.14] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 14 Jun 2019 16:16:53 +0000 Subject: Re: [PATCH V1 2/2] mailbox: tegra: avoid resume NULL mailboxes To: Thierry Reding CC: Jassi Brar , Thierry Reding , Jonathan Hunter , , References: <1560515734-2085-1-git-send-email-bbiswas@nvidia.com> <1560515734-2085-2-git-send-email-bbiswas@nvidia.com> <20190614155210.GC26922@ulmo> From: Bitan Biswas Message-ID: Date: Fri, 14 Jun 2019 09:16:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190614155210.GC26922@ulmo> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1560529016; bh=MzSP8jyEG8u6MG6Y0F/p2kf3GqAnZBXD6d8IVDO5Kw8=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=qykwxzgm14bEEejuZ8tyYTB6/NtnSk2VtlxjBY80uDnT45kr5Vz7v+M3vfDS13j/Q PozeTgJA5GJ1gX+ImzWRMjpC/pjclPstUOnRvtuLf6K8Fx2a6qY7tiCAZbLPvRMDmX WTd/MFuuQ8v5K868rZcy3q1XeXPfqQjUBCrOaTM9+DiCMLd/5xzW8UjFC3SK/2YlS+ UCpsFxnskgcPZQqxhiP4LieaJDlqwU4rBa2IGiHCtcuZfZuHzcJMIKKo8ly1OoFjFo 2p5nqrZNxeVsCves92fpg9pouzPS6FFURUmff8RUgT33nBc6cInXc9B0Q1OcZ4L/Fu Z9oK9JeMYuwJg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> --- >> 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