Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CA11C74A44 for ; Tue, 14 Mar 2023 07:27:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbjCNH1L (ORCPT ); Tue, 14 Mar 2023 03:27:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbjCNH1I (ORCPT ); Tue, 14 Mar 2023 03:27:08 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2931A474F0; Tue, 14 Mar 2023 00:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AqF0lnb/J82IpN0AA9R27sIzwfVJ7+IGHcAuK2UzT7IVHYVge1RzJtnbXb5FEEMmibB1dCE4DAzBp5Feu0tUUhNdH1l/bSZZZ1Wh1Zn6MWgjgtHjnKlEy4x6z6lsojoDjHuhCtpfw+GDMnAJE+/yzcVBtanVq7lZarzgixLpBaRnpWy+qu4xNnwsWl9QHcK7o0ttPv4kolz/v2y+4TjJKtLMDhyTz0UcghoU7wYpoM+T5MJgjOgK8S3MjpBhpqhqT+1gwcVqEzQ0MbL06ramFxepkhyjXyA446B+PamAqm7qk9qgJC4S2Sa3oniExKo6DHM9dFh9F6KyoeGt3VKPmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7fApdlMqU9I5ELFHMYBG3OKRnUNh8GdL5CljfvES98g=; b=oQZuBQN1FzXei/VyTvzDQtDC3dxR98BZE98p3YlFxQ01bhw47Y09k9AcW+dMh6it6F0TPLJduS3PkLmWTNBBWfgehXnan26L9Ss3ML3A9WHuzRUbb5NIjvBPlHryAyh6qf+v87/rAOQKTDcaD+IV27Pl/cZ/LDWBcOM+jReivYvo+wCePlnzGIrlR/NZjz01ZdKKL8y4FQJ4TKb+szm3IbD6gAiJJiPUjea8s7hvoM3ly2nOUtGdRWlxPLHUVYeyLFgK8uapJ+VF9m16ouMt0916fZOTnauHTUUf62RjMrEZcBp1wnIzGfj/dTIPgEGP8V1ik/zqirfiHv1bntzumA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7fApdlMqU9I5ELFHMYBG3OKRnUNh8GdL5CljfvES98g=; b=2dSwl4fTVtfHDAqtIEJBSfY9vgoLHYcK1bVkUqR9Oj4MFxhzjU+khBeu7xZmoY9Q1a09x2AEqe3OJkZKVJtacTxUqZv9Bg7mDwNN6ATFezYnIOGz0sRgrRItHkXxt4oxuwKQSc6d/zc1vk70+Cp2dcdARB4XK67t0OvY5BHQnUY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB4758.namprd12.prod.outlook.com (2603:10b6:a03:a5::28) by PH8PR12MB6697.namprd12.prod.outlook.com (2603:10b6:510:1cc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Tue, 14 Mar 2023 07:27:04 +0000 Received: from BYAPR12MB4758.namprd12.prod.outlook.com ([fe80::4d07:7f52:c833:9603]) by BYAPR12MB4758.namprd12.prod.outlook.com ([fe80::4d07:7f52:c833:9603%6]) with mapi id 15.20.6178.026; Tue, 14 Mar 2023 07:27:04 +0000 Message-ID: Date: Tue, 14 Mar 2023 08:26:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v5 1/5] mailbox: zynqmp: fix counts of child nodes Content-Language: en-US To: Mathieu Poirier , Tanmay Shah Cc: andersson@kernel.org, jaswinder.singh@linaro.org, ben.levinsky@amd.com, shubhrajyoti.datta@amd.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org References: <20230311012407.1292118-1-tanmay.shah@amd.com> <20230311012407.1292118-2-tanmay.shah@amd.com> <20230313193844.GA2071975@p14s> From: Michal Simek In-Reply-To: <20230313193844.GA2071975@p14s> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: VI1PR09CA0108.eurprd09.prod.outlook.com (2603:10a6:803:78::31) To BYAPR12MB4758.namprd12.prod.outlook.com (2603:10b6:a03:a5::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB4758:EE_|PH8PR12MB6697:EE_ X-MS-Office365-Filtering-Correlation-Id: 84c5cc84-8125-4629-8426-08db245d826f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rrU61+jQFEAc7iEPxQE5A7R1KDkP2RKTZsoa1CKk922CH0F35vBAuMyF1HFJ6qmLqezVXmQpFJSuwNOt4dO2QEU5WU/DtYWUwD1plUWqt6Iq0Iw+2fCP9LZCQoaYv/IlVELF+CK4+ntU7+p9Ie7uh7TCltyWy22Sia6ZsquKhDm/wPGoeegdNKNkDbVrr/2HixzoNOT2LTBn7/nlP5qBJFkwjD/A9nXC3B9qylm2JDA91wMmOpYieq1mp4yfqwM+n4nOdVgt4trU2jv/IcouFld5MBjHUWYnsQdq4RI/xQxB/nzm5UZSBsMCmVHOcYi7MsJHRbfPmm3mOrB2L8UlR7At4t8C8eJWHGbjsGd6R7aZojOr3DvfZA0wue24M6Zab2VoCOE8Xpf1JV1Hv+qVzo0mTkbXXXnAemMlJzYCBvwA3wwVb6gnac6AkgY3CnCBhjB0d/+oCA3DG1DK1A9GdcPfOIzi75i6FqacweKj/1WJ73g3leI0Fi+fKTYzNu2PiE35jlJMOAGFZGy6MPS/Katr7Tmj9o5uNKoDbDWgsoXY09Nu20e5vHEXah0emmPrYmO3FJ9VrY6Ihe4A5M+i7qV1yP7q6BtOWgYlBArpE5F7rCozpjrvvwHbHouCQ/NY8pc89mnpXi13GEbYw1sitNjVClcvYbdCBd1kq2TUVSpD/e5PJhTDnpMp71X83VaMH+TpBNYPnY5V0Arv6O0Mz/IIQ9apFR7m3DB4pTw9oE8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB4758.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(39860400002)(376002)(366004)(346002)(451199018)(6666004)(83380400001)(66556008)(38100700002)(316002)(36756003)(44832011)(110136005)(478600001)(6636002)(8936002)(6506007)(186003)(31696002)(4326008)(26005)(6512007)(5660300002)(53546011)(66946007)(66476007)(86362001)(2616005)(8676002)(41300700001)(31686004)(2906002)(15650500001)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SnFGUUJWbG9mZHArVm1ac1hqNHJpaUZ2T2dBVzlBOUxsYjVhT3J2SElLaHRp?= =?utf-8?B?Ykl5OXZJZXRkNENGaHRPcy8yUGF0TDRLNUlyUXN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EydDFDKzZLdkJiejZPbk1aWWxXbm5tNGZrSFhLZ3l0T1g5SHFDb3V0ZGMy?= =?utf-8?B?SnlDejRPQWdYRVdXcEFGYVVoN3N1TnBnekdOQzE5eDF1dU5hT2FFdHBDVGlp?= =?utf-8?B?WnVlQmd4b3g4SDROMFNyNDk0cUU5T3FZUDRuR0x2SEVad3RQWmdTMG04bDBT?= =?utf-8?B?RThDU2ZDRmJvRTB4N2pCbXZjbHVyemhhQUZadWJRVStpUDNteGNKSDNDQUFG?= =?utf-8?Q?Pc9gE3nxDYlm+tgoF3LRIhsHK?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84c5cc84-8125-4629-8426-08db245d826f X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB4758.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 07:27:04.5086 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ld/7hC7BSoctPgIPFTe6yxTqqX9kBcU/uMXwhV2jvSHOmCQwn2mZBZSpg57QkjwK X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6697 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/13/23 20:38, Mathieu Poirier wrote: > On Fri, Mar 10, 2023 at 05:24:04PM -0800, Tanmay Shah wrote: >> If child mailbox node status is disabled it causes >> crash in interrupt handler. Fix this by assigning >> only available child node during driver probe. >> >> Fixes: 4981b82ba2ff ("mailbox: ZynqMP IPI mailbox controller") >> Signed-off-by: Tanmay Shah >> --- >> >> Changes in v5: >> - mailbox node count should not be 0 for driver to probe >> >> drivers/mailbox/zynqmp-ipi-mailbox.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c >> index a4c8d23c76e2..ae47fbac38d2 100644 >> --- a/drivers/mailbox/zynqmp-ipi-mailbox.c >> +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c >> @@ -634,7 +634,12 @@ static int zynqmp_ipi_probe(struct platform_device *pdev) >> struct zynqmp_ipi_mbox *mbox; >> int num_mboxes, ret = -EINVAL; >> >> - num_mboxes = of_get_child_count(np); >> + num_mboxes = of_get_available_child_count(np); >> + if (num_mboxes == 0) { >> + dev_err(dev, "mailbox nodes not available\n"); >> + return -EINVAL; >> + } >> + > > This patchset looks good now. I'll queue it once I get an ack from Michal. Patches 1,2,3 are acked by me already. 4,5 are remoteproc one which I am not testing. If 4,5 are fine please queue them. Thanks, Michal