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 790EBC61DA4 for ; Thu, 23 Feb 2023 14:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234614AbjBWOro (ORCPT ); Thu, 23 Feb 2023 09:47:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbjBWOrm (ORCPT ); Thu, 23 Feb 2023 09:47:42 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1D3858B53; Thu, 23 Feb 2023 06:47:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AChyQ6cc6N61jW1jfA+mg0Ig9okBcbwuHd7qsDn/ImMODd4O4GdY7j2E7ZXhOvkpdUQem004rjcEfmfIXB9CRq2UfSNgS6Y1PlHvXek2COMvAdj07tA21T27KouCHRw0CxN1cqV53Gbu/RwSH0VTBST50bklGujwI1RwzYRtsaQisjMDcqpXnsWI7Mui154u4FdaZuQe48LC8in1b2sBAHqY2s/4KvavdmZkpwMCePqS9Ha4jStQEhUUb+FU7873YS2zDLqhvCRGx7HRdgIcqFG5Sgv8p2geDzovcIo7/QlEKHtFpM0mmLlxsymjOu0AnauJF3ptcXuz+KNv7ezQXA== 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=R+pjJW5RP4bluvAlDBcMGDMArZDI28651qX5gCd+4p0=; b=HCehJtRTV/iggSBDtxjPaMez78OVOMO4SxyJCw2FB92gxDwUFS9kqooMM2YepKIXwJLLKQBbI2uC1d1rWtWGzjnpT0HHMuVxgFsbxpOF2+PLUGgAfZNVK1T4w3E3CVGVhlAYG3GzB27bpkStZecBwGOGfBHtK357k4OH/Bi3VyKAU2zL1nOaGhIm5WejrTY6vUB3kM3yUWbZiRRgwkFUjNAC2fqs/0Xd3uyw3mYZzXMf3e23FkRw3DCR26urdkiMSQNw6R3FQVUk5/wqUWxOGSMCHSgh3o6n92Szu7+bRlIf8TXHPd7UaiIxmDew5QmA9RKcB+JP3RJuEWDNSkqUgw== 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=R+pjJW5RP4bluvAlDBcMGDMArZDI28651qX5gCd+4p0=; b=Bmdj3EI/o3Q7jYHkbVfmd3OujXg+xZSqKPqB5glFSDbx0uz7U2ARpQ/DGkOMqERkjL23Iin87LogmSXurZ7bmRQnuVuSOseIICSMWvCsDjrokyteO8SEcbKsW9uQEsEdLhNNC1b5W/8b86kFMh76vwhBLW43paF7ffNWZP95te8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BY5PR12MB3683.namprd12.prod.outlook.com (2603:10b6:a03:1a5::16) by IA0PR12MB8301.namprd12.prod.outlook.com (2603:10b6:208:40b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19; Thu, 23 Feb 2023 14:47:37 +0000 Received: from BY5PR12MB3683.namprd12.prod.outlook.com ([fe80::3ddf:d47:b37a:5a7a]) by BY5PR12MB3683.namprd12.prod.outlook.com ([fe80::3ddf:d47:b37a:5a7a%4]) with mapi id 15.20.6134.021; Thu, 23 Feb 2023 14:47:37 +0000 Message-ID: <130e75d3-034e-67a2-0c27-0599a996b20f@amd.com> Date: Thu, 23 Feb 2023 08:47:35 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:110.0) Gecko/20100101 Thunderbird/110.0 Subject: Re: [PATCH v3 1/3] drivers: mailbox: zynqmp: handle multiple child nodes Content-Language: en-US To: Michal Simek , 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: <20230213211825.3507034-1-tanmay.shah@amd.com> <20230213211825.3507034-2-tanmay.shah@amd.com> <20230222173448.GA909075@p14s> From: Tanmay Shah In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BYAPR05CA0057.namprd05.prod.outlook.com (2603:10b6:a03:74::34) To BY5PR12MB3683.namprd12.prod.outlook.com (2603:10b6:a03:1a5::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB3683:EE_|IA0PR12MB8301:EE_ X-MS-Office365-Filtering-Correlation-Id: a5b62b36-6ebe-434a-4a1e-08db15ace80b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mGbC7Wx3PkIfbW+pe+AW9L1+ghk2yVx+sa/P+quBXCkZ893dZCXHTbU9WSN4pys4WyHjjkJMlo9tLXgo6i8TlyDyLlM/7gP04QRnm+80VVW28PAKSIh6hY0meNKF+Y9StEEcbmQurbvhtlSqnhk5hMxpV5Lyh7vx0TSv4STBZJKbun8Moq7iKbB1ibGuclNnhh/Ff3UgCwqGcciJpE9nXhPo44CYwJplyzSmgP88hUEBtMHJU7+5v58nYrFZ7TsmxPMMkEsiBOeEmMCutzNejx6iY2rRk9t3tBYmuXugdnMEFbK2/kpTpgbRljrCukFitQr9gZfuy7I8VhphZNGysXLmLtpSOxwb8y8lgj8B2LEsgQE/B7SwgJJYxz0J++mECRz/O7H5nUMVp4NIDDeqzWHEvAv99XKUmdCOkphREt2AhpYPz8joovpWspoHOVZrq4hO7iKsx00rgfWBOyrcmoJaAKsMW0+RC/h/ErZZoSCdgqQaBOsKAHvdSEVB95p+Q4BL5XrPAdiGkiXjrIZtA7YehEhsyIppUUnkvQywRlURMTZFVbSQgS6gBHOUA2akccoQISupjWK6UhQxGQm6wJ4Q+hgK6BPjfcpzUW/D04dqwAiV417oo952pOz3vTBpwqqDa1XVI2sifdU7yNJaCj0Um2uWWV1jRd7ibSHcXoOZm/joEE/B5E4aVv6IkKIq+qqxLtxDMK65yuTUbIRtp+3taE8/Q2XuzKNrpAcBJzw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB3683.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(136003)(396003)(366004)(39860400002)(346002)(451199018)(5660300002)(8936002)(41300700001)(31696002)(36756003)(2906002)(15650500001)(38100700002)(2616005)(6486002)(966005)(66476007)(478600001)(6512007)(53546011)(186003)(66556008)(31686004)(66946007)(6506007)(316002)(83380400001)(6636002)(110136005)(4326008)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OVBYbnNHOXRSaUNqK3J6QWJkb2tPb3I4b0I0cjNZT3B6cDZ4TjFjQkpGY1M2?= =?utf-8?B?cnF5YXozWGdXS0NpUzllTk92VW9GcU43Nll3d1hTUDBGMkll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UlBXb0xjc2dCRHR0QmJscEpmNTUwQ2Q2VmROQXhY?= =?utf-8?B?YW5adFdvQzlpU3ozYUViTmw5TU4vNldoNEdtR2xTdHZaQ055KzdiblVjMGty?= =?utf-8?B?cm5VWjdHWlR5UGtXU2plbjUyNGxJbjA2NG8xTHdNMzROangwRTAzMlVyUVl5?= =?utf-8?B?V1dmUklRR3Bvd2NkVHNQNnF1YjJoK3JxaWVsK1ZENzBKck5yVXpzK0cxd050?= =?utf-8?B?NlZiZ2hIbHc4eldpRVpkdjZ0bEJyNDgyUy9qc0ZwVElYVUJYa09xMDJJQmh1?= =?utf-8?Q?gU8s5s6UL4m0aQTNSnrxbVZbksMxuxzh7uqYlfcSV9UN?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5b62b36-6ebe-434a-4a1e-08db15ace80b X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB3683.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2023 14:47:37.6544 (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: JmFrstHgNvodDC7RNDGZpDW0dtl/Tos6C8YjiAdV/OJ8+9reLmLfcZyW4L6K2SiQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8301 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/23/23 1:40 AM, Michal Simek wrote: > > > On 2/22/23 18:34, Mathieu Poirier wrote: >> On Mon, Feb 13, 2023 at 01:18:24PM -0800, Tanmay Shah wrote: >>> As of now only one child node is handled by zynqmp-ipi >>> mailbox driver. Upon introducing remoteproc r5 core mailbox >>> nodes, found few enhancements in Xilinx zynqmp mailbox driver >>> as following: >>> >>> - fix mailbox child node counts >>>    If child mailbox node status is disabled it causes >>>    crash in interrupt handler. Fix this by assigning >>>    only available child node during driver probe. >>> >>> - fix typo in IPI documentation %s/12/32/ >>>    Xilinx IPI message buffers allows 32-byte data transfer. >>>    Fix documentation that says 12 bytes >>> >>> - fix bug in zynqmp-ipi isr handling >>>    Multiple IPI channels are mapped to same interrupt handler. >>>    Current isr implementation handles only one channel per isr. >>>    Fix this behavior by checking isr status bit of all child >>>    mailbox nodes. >>> >>> Fixes: 4981b82ba2ff ("mailbox: ZynqMP IPI mailbox controller") >>> Signed-off-by: Tanmay Shah >>> --- >>> >>> Changelog: >>>    - This is first version of this change, however posting as part >>> of the series >>>      that has version v3. >>> >>> v2: >>> https://lore.kernel.org/all/20230126213154.1707300-1-tanmay.shah@amd.com/ >>> >>>   drivers/mailbox/zynqmp-ipi-mailbox.c       | 8 ++++---- >>>   include/linux/mailbox/zynqmp-ipi-message.h | 2 +- >>>   2 files changed, 5 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c >>> b/drivers/mailbox/zynqmp-ipi-mailbox.c >>> index 12e004ff1a14..b1498f6f06e1 100644 >>> --- a/drivers/mailbox/zynqmp-ipi-mailbox.c >>> +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c >>> @@ -152,7 +152,7 @@ static irqreturn_t zynqmp_ipi_interrupt(int irq, >>> void *data) >>>       struct zynqmp_ipi_message *msg; >>>       u64 arg0, arg3; >>>       struct arm_smccc_res res; >>> -    int ret, i; >>> +    int ret, i, status = IRQ_NONE; >>>         (void)irq; >>>       arg0 = SMC_IPI_MAILBOX_STATUS_ENQUIRY; >>> @@ -170,11 +170,11 @@ static irqreturn_t zynqmp_ipi_interrupt(int >>> irq, void *data) >>>                   memcpy_fromio(msg->data, mchan->req_buf, >>>                             msg->len); >>>                   mbox_chan_received_data(chan, (void *)msg); >>> -                return IRQ_HANDLED; >>> +                status = IRQ_HANDLED; >>>               } >>>           } >>>       } >>> -    return IRQ_NONE; >>> +    return status; >>>   } >>>     /** >>> @@ -634,7 +634,7 @@ 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); >>>       pdata = devm_kzalloc(dev, sizeof(*pdata) + (num_mboxes * >>> sizeof(*mbox)), >>>                    GFP_KERNEL); >>>       if (!pdata) >>> diff --git a/include/linux/mailbox/zynqmp-ipi-message.h >>> b/include/linux/mailbox/zynqmp-ipi-message.h >>> index 35ce84c8ca02..31d8046d945e 100644 >>> --- a/include/linux/mailbox/zynqmp-ipi-message.h >>> +++ b/include/linux/mailbox/zynqmp-ipi-message.h >>> @@ -9,7 +9,7 @@ >>>    * @data: message payload >>>    * >>>    * This is the structure for data used in mbox_send_message >>> - * the maximum length of data buffer is fixed to 12 bytes. >>> + * the maximum length of data buffer is fixed to 32 bytes. >>>    * Client is supposed to be aware of this. >> >> I agree that this should be split in 3 patches but the fixes are so >> small that >> it is hardly required.  I'll leave it up to Michal to decide. > > Generic guidance is saying that you should split that patches. I > personally prefer to have one patch per change. It is useful for > bisecting and faster for reviewing. > I would expect that this patch should go via mailbox tree and the rest > via remoteproc tree. That's why maintainer should say what it is > preferred way. > Thanks Michal for reviews. I will split the patch in three different patches. > In connection mailbox. I recently had some time to look at this driver > and I didn't really get why there are registers listed. Because all > that addresses can be calculated based on soc compatible string and by > xlnx,ipi-id for both sides. Yes the IPI configuration register addresses are retrieved from TF-A in zynqmp-ipi-driver using xlnx,ipi-id property. Other than that there are message buffers provided in hardware for IPI communication. We list those message buffer addresses using reg addresses and they are expected in dts. As per bindings we do not map message buffers to IPI ID. I am not sure which register listing you are referring to ? > > Thanks, > Michal >