From patchwork Tue Jul 9 14:09:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13728124 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BFA0FC2BD09 for ; Tue, 9 Jul 2024 14:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ZPvKVu9CNdr+J0KVWFipequxEETydACxuUvVRU1Xtpg=; b=lOZFGiPm4kJXESOnb4pqpvq/Hf DbDrh6ATqa/yU9CL9M75sJrWCT/9ra8yEw4YWPUwEz3f9oAkVA6g0DCDlIHk7gDo6uIscdzTh5dtU GaGlCscvmHGof2AMJp94a40nFXMd/FOimDtxyZIdbhdL/1rxJ6EO6q8PqyuL9ZKyv7PKu9M1KzZd+ so5evHd1rgTaLE77GWBrZhLFswvXOLDa+icif4Igic/j2Yq+OwwXE8E+vRQ3mJCSfg+e44wYBHX0X M014jOOnj0NBOHM9yan+8tDWqAtdef/bzBJkEjLGoTzmlJNPz542LHGNXWur7VkuF9cLFFC2ar8j4 Blekj8IQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRBPX-00000007UNl-3rnU; Tue, 09 Jul 2024 14:01:39 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRBPH-00000007UFy-2DQJ for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 14:01:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mowuotEKKfsyrh7f+yMwcks2H/DnqXVVS8o8sshE8SED5KMwJhFwyJqR8Vf0c7bj7vdn5ziIrleb0uDXTper8iyw6ShnUmZHJebqSn2HGzU0TLNwgFnkpBIEsWuGAdl03WmfnEnHDX7B9Wf16Ji91jy6HoTsktwUiZGytNgJzNvWCU4jQkn/hDfGXHc3SaDp7Eu3DUZT4oz+uIdwhJZHQSiIdHiyI2iBHqGczvyGq/jACdRZ5/0JNN4CrWT3ooY8Dg4zFXZpNSIDo+gjip8enkPPMVtgQI5c3IM3Dzh+IzRm9M68QJrrBzSEjydZZ+p2ggSg+9pmVN/aiOutBFzyhg== 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=ZPvKVu9CNdr+J0KVWFipequxEETydACxuUvVRU1Xtpg=; b=Wmemqgu4LQgGQ+XnlMKOdJZ3Ge6G7Uu3lGhI/HJ797ZJNjh83uS3cCDQol8W1KgYxP6PqSrl02xkRE7VKUWmRwPwtKfbJn7EJfdp830TjrorsofNS7q+pmtbSWCSt3Ob0lrUEQYz+03bR+EgZpElxJZcpjAvr5i+lZhvIFK1CcvZfyRX8qxsC+i16y66V3KEgU3utqA9jMEdcEp3vxD4Am7euvS4XtUNYT/KAj8R5gQVN4F8g85oi1Il1tAWG2KRyatpRnIKLKzbm5OF9vjg0CVl9G9TrI0guJVvNnWNPrsJKL2jEJ4khLEcpeZA2eqtezO1RDxM3DDS3AdzMw8oCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZPvKVu9CNdr+J0KVWFipequxEETydACxuUvVRU1Xtpg=; b=WYp6xbcEpLvQyq1kMGmpRts7jmItWPT6mNNRSrIfg+qQFa6YZHk7TU44jHnvZuDAvJxfzvToP5GD3SNiIkqE0SjzzPlHJ1y/Pnk9WzMuSJwnnDlK+l5kx2ScbQrEhxUnOud2R11DjHOY7AZcOjXzzABvozPEJOFFfaMJzqxJRys= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PAXPR04MB8622.eurprd04.prod.outlook.com (2603:10a6:102:219::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Tue, 9 Jul 2024 14:01:08 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%4]) with mapi id 15.20.7741.033; Tue, 9 Jul 2024 14:01:07 +0000 From: "Peng Fan (OSS)" To: sudeep.holla@arm.com, cristian.marussi@arm.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, arm-scmi@vger.kernel.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH V3 1/2] dt-bindings: firmware: arm,scmi: introduce property mbox-rx-timeout-ms Date: Tue, 9 Jul 2024 22:09:56 +0800 Message-Id: <20240709140957.3171255-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SI2P153CA0035.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::14) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PAXPR04MB8622:EE_ X-MS-Office365-Filtering-Correlation-Id: cb448b10-d5ba-4f11-32ae-08dca01f9493 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: ffTR/pBqucByyO6bGtQ0mRVJJywhNfwNitlt64PnwFMZR9CTB2bOJA//08RKFneaeae0N/ix64d88SQRmOgzRQwkvSDUO1e6JlyQ5zGkqRitB2EEuwWjcb+Lw7Ems5C7CdkaAJIaNNaurMq/jPmLgvT8O7mKHTc8FpDtgv+kYkmw2kVMMWQoPvnxZpxKY/j8A20AOE+i7wJ4CVDjPagCtA4GqqGTJ8E/GIRreTRhNWBtGPpRRvgBlGyYP9z0N+ezQK2Lo1WqprzbfL06bQB5mVX1AaiHzEp/mfpXisPS43/pBMx3iJgDHI9urzipBCfqlL7H7JGC9sz/SDuQ597lnoNzfYjOK8q2g18hlyn4S2t+y24s99Si/8uLKnfNEbDr5P8uDLkNtYbnr07RouOh+FGY6fv3+zNAxepDZXWtpSpXzOvLVQXXiEt6LGUpkFtCjfjvrPz+xqFHndtb/YEVWuef/vwQMRLt+2PeuuQnfB1yFAkLQGo1i69t59fwo0YlmZ0XZv/D91FA9+Pu3u1Es6Eh7et5PPSqqWWiUaMnx8uRUxWlSUjXt7ZouUEz38/X1jpevL/Qx3KBju/pcThPtx0arM77R5d0a9z7iDW0lAfkIXEoYGCQBpg9fVKpu/ejNjS6Fpx3AyOsb03WtmpUYMHvQ4WP39Py7wyjknerj56JS5/qVDneC1L+XEOeOXpxN+ofJvL6PPtCFRh/Q+yx2YqWkNECTxtrkY/A9TNHobXszMYnMYlPWXwS3ORACio/MNynsDIsLiQ/blWFyulRb5X7LbPTHGyaYd88w15PnAxTemBLgVzAzBV8UbwRD+XNbTmI7REtGxFSW31+2mSf98eNzc8CNOlllkXlUgh4kgi4yWT+kpo3On0Kq6iveu4lKp73oSfocXnRIQG4e8XZALgUAFujh8vHTV9iLLwrKcVz3GzmqScTlVkNxjOcVe81VyklR76An4ZHkwwn4XRJfLrGYPhNxZxLdmt5tb9/ReHiqwjazbvmOFbRG6pLvT0PyhgL26FFDsRiXMfRM26mfxKM3ZaJCZwn4NEkq0QbtVbG0Mq3OEYo+f3M3JVhALWmI8KvvoQ3VZbh0npK0Pjl95vRIeGgScfKQWLrixN/8QX0SD3DtPEn/dExcUJRcr/9VGpMUMykE3S0jxzMFBq94IGDEg8D/hrUOgXkPC0bPzvUOQM+05xYEwasr8FWJ3GOPlpqwX/eX9bK7MFhWYy05XWXKiIyFyEYT6OVj3yWiXaAetXwlp9vrdWbrfcXSFm6VagGKPiFF4Ud1a+cqrtw6UI9lJc9swFJCLSVmeC3o8ETy7HWELExiKd2CaEtj3VWF6JGi/xn9SwXj/VqCVCqoBmbVZ7Hd44JF+cFRopKiCvTokK4eq2eSTOfqQtsei8RvvcIih7zrggZryWfdeerRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR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QcoJAJbwNyhVH1A4ucmmXZjDfsMD074jIdIoKI4oD5WRr+PCPhxCc3ZpZJtv9HI8IsNkEmGqFDYGvxLwgo8FMGQRZnThplPp6jlv1K2/LydEOQb/nS9095v4p8kyXCi6PnP7FEaqwQvzbke07YQNY+Wulva0+Zt2ru1WQSJGE+5lPu5uA/qwFwMhmu0R0gZmJpuKyu3TzotieAM7Y9J7r6T1/W/0B7R94wuMMpz2PZNPlozChMTriLO5k2kYEuKVlCfL3eMay8axTL4TRrG3rBq0ODsHgX5luEdgnTlUwA8KJJnyV18Ai+6yMd7fxCha9oBP1bHbY55I+2j86uOf1HIUmE8CI+6yr0+vH4XT5fJqNhEjkNESZp4N5fK2g+HMIH45UjgpOhU/zTJ7n7jLgtU9xnCKa7Gy8vi3rK8iwvDKHlMFaJGwcUwGJCCzIgBdKnnvC8sWH5BfQXmVNatWSwf9ejHJGj9hHeCOVSxAP1796XggRRd2sOqrQoPrF17N/Q9IBi1CF8UIQAoqPefBn8FgtaxbSA2k5tbri1AEVXUcVxlu6SunKY2Na9FjtU4qdrLX7A/JReqTmiA X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb448b10-d5ba-4f11-32ae-08dca01f9493 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 14:01:07.9453 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2l72GiM+IZhFYvdIzMwX97ovC7lvI9bWOy6EJyxJ7YgBBoHHCZ1YPbqV5NYHABc8UuX2at/r9hyO60Y8PqB0Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8622 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240709_070123_577943_02528655 X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan System Controller Management Interface(SCMI) firmwares might have different designs by SCMI firmware developers. So the maximum receive channel timeout value might also varies in the various designs. So introduce property mbox-rx-timeout-ms to let each platform could set its own timeout value in device tree. Signed-off-by: Peng Fan Reviewed-by: Rob Herring (Arm) --- V3: Add minimum: 1, because 0 is invalid. maximum is not set, because it is platform specific and unknown. V2: Drop defaults, update description. Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index ebf384e76df1..f84a978a36b2 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -121,6 +121,13 @@ properties: atomic mode of operation, even if requested. default: 0 + max-rx-timeout-ms: + description: + An optional time value, expressed in milliseconds, representing the + mailbox maximum timeout value for receive channel. The value should + be a non-zero value if set. + minimum: 1 + arm,smc-id: $ref: /schemas/types.yaml#/definitions/uint32 description: From patchwork Tue Jul 9 14:09:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13728125 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E015EC3DA41 for ; Tue, 9 Jul 2024 14:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C4upfGYyhv3wfIPAR3t03xft5bnG8ay4hRhDOTNnfuc=; b=vPQ99LDDftV6C85iDhO3fivMI6 +sJgd8zZSglpv0e0GBvhhubfl4EWRQ8DiyJnKZtikX7WLtCi3wccbFp3qWS9aL/l85JvM3gkf2zho /fMMCFCr3WIhhR9Vy4DOS/SoIUdrq8Y5EYBnzuE1+gmqq680CNBu1Ox2pwPI0jPjkw+7wPvlmQbwR d0UNFp/u017yrrlMDloaKv+c+OkmK7Nu3zEIciPuqgwFcYoPDEA+cFbP8sb2HnAUrfiSwz0hbHMQq gwrakskwxMuyVMb90JTMeW7XACeJ9aE75efbz9eczmlZ4C8ReEQCswHtgkX4uXukjfgUjem2UNvnw 7tNUNtvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRBPk-00000007USP-3j2E; Tue, 09 Jul 2024 14:01:52 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRBPJ-00000007UFy-0ajC for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 14:01:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eeMbFGHRalINOSHgFSrKGnDgoR5VVbPbY0Bz6MPMOsZ2A3vWt10IOb23hg+bu8rWWQyCl/y/RlFzmNenJ+T/5yJq80OWSeY8f0ZWc7hze9+5xjXEwc1jzQJiEv24PbjmWdBBXxunuv6FBXpsDq+9DgIERNZCBXmyh6EVodKc9ISdHxdkWTJvOWaeh5OVvxDwxW0TXl13DA/7ZWPLwgnVUSw+HqThrfa/qhea0XWLzSVEBAF9KOjDiaLP2OF3op+U3NBnc7MuLyHfJvRKg04Mr3sanGtkjnyekO/TqXjjg0AEXamk2CY/cLMnUsKpwzTxg1XZKX9QwD+rN7cwtCNEpQ== 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=C4upfGYyhv3wfIPAR3t03xft5bnG8ay4hRhDOTNnfuc=; b=YBlVJlR6Ih5HgzzIMXTWLBe4b3VXupraElIc4bpoFO5nGXb7iG6QKt5zqWcFaYebLQX8FXteFN2TXGQMs/VfH1X5YvYFqAouvuPpUi8RtUJ5zMXUxid8Um+WkUyJ6cCmn/USvhjE47Pq2VrbH7eJMpbnIKZcxGAiPvVO04iknDfZ2MsyhlnB6A9dXDuVlY/b+XZ+cbblVe6Mw3cwcf+u5nXwMCsNp4p3hTSkFNMAdVPE9JltRpBsebnSf5ujv54c9I4p88Oj1uhN0fA3oc8s9dofAZaDk4OT4ebrGqLSRHS3bPZfhR5J3JiAs98JOmDMvYnhsZJF5qWO0ofbKUcgWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C4upfGYyhv3wfIPAR3t03xft5bnG8ay4hRhDOTNnfuc=; b=WsvRIzd8P+toho5JCi30bxqI61unoerVYZBd9g4YUSOfJPfh6HHIKAKIgtEXiMgFgp3PMUMbZdlAqB6x3KdvsKUz+hIdgDtqO6mfHxMphCKwUKuZFprTpDHsDuJSDuOC8k9Y5URO491Lr2GuHlqvuqCnmrCuYzWaJdxGsvC0JFs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PAXPR04MB8622.eurprd04.prod.outlook.com (2603:10a6:102:219::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Tue, 9 Jul 2024 14:01:12 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%4]) with mapi id 15.20.7741.033; Tue, 9 Jul 2024 14:01:12 +0000 From: "Peng Fan (OSS)" To: sudeep.holla@arm.com, cristian.marussi@arm.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, arm-scmi@vger.kernel.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH V3 2/2] firmware: arm_scmi: set mailbox timeout value from device tree Date: Tue, 9 Jul 2024 22:09:57 +0800 Message-Id: <20240709140957.3171255-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240709140957.3171255-1-peng.fan@oss.nxp.com> References: <20240709140957.3171255-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2P153CA0035.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::14) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PAXPR04MB8622:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ed39383-e31b-460f-bc88-08dca01f976e X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: /OSFLw7L0H4FnQ5uP4oRHyHit9TnolWvM8bE9e/LvoSKCO9Bak07HtyBAYDdodEWuH2DpMNHqct5h1yL8AwF9eOTpx5hdxrOSU/H3wb/QZ5ZGQ43Gh/BWIcQFKsi4vE4oh9Ov4kEo/i9zLYGPTFqYBLV+enXgfaJ4X39qW5SLoJQMdyAk7NMk6WvX2W4hC1jUWxdA1QKblklivMnJ1fDbwf8P1i71jD6PqDOoanqc1CKwWSLoAHJm8QfhhVeTG4uzI4M4aDYCH8QnIngKTRY0agt19rKbyEIvqJxbW8EGK5lfwpmfenwlYYSvDvvMyaKppXZ8PuDDa9US//x2KKeU08IsEgxpHubeoXYAkqIQW7Gud/vASXYuiHUk3UrUjN05oKsexG2wghGci5ly0D6RlRe2SSd7YNPdrGX2ccwhwrw/Xi9WUBIw3Up+1abyBagspSbgJJFqzLuPXiHaHmxl97Wt6LuaIPJb6xXbALWkfXZip+Ij48LtT9BE4RN8Cw5csjU+zx9tcxVyHKBzI3+dUFYfr572J7L0fMyXi4Oma3kvG6yik74hocNQFjHz8/eZP5pHqXUT83fdbiNBAw3R/8Fvh3xsj3hBBevEQ4oqHELy/KhqLdue0GCfJLXUfg4YHYtbXT9VXA5yxK1YtjEfZ5/UTrJPleERcgoS8pVJEEmk2yn6AFQtQzXzJtY5KIasMPmIRZH+c2fq0e+We86G+1v32kDp9N5d43fyOPw/cdMuGsHb56JDgyzcCooI9et1iWE3ELlRvJxXIOYXzX4os/sbeSqCzmhMGOutKoYMnQdrFedtu+G3ruqa97U2s33T0UDtU9i8NdIL9BrUzMRVgVTEg4kkveibALhM3CUcJVr8aXg/Pp77EKQXIyCJZ4eL7nKGe3ArICKwXmqExGuJSW5iHP4CA7E8SRZqiHEuyX4oxnGgoEnts1vtRXqga77xtu5J5h/xTPBtpgDsO2JPMvwP/ZWi/WCd9GSaY4ulFyb3SuQ6SRMi1LeWp54JfdRBjN6ra2RTR1Oc+80WRsOuUsXlGaW4I/wnCbcQnj57XSPXEmQwY+ixrBGOjhDb10r0I5qpLoK32n99KWZQ1mWVxa6TMi3aOSNqfD/X++17duCIstpFOaRWIqstJAjY8w0Ms42CiO0TUMQgU9KXNfUXrSbRcTNKNqzTKnmzNB0cUiY1eGpy79LJFYfKr6gq8spdowFnOe59EeLV1iSMz9PQNxih3htfDUL1GsTkOoRpUX3I2Kuy1dR/seBx1KD/xl6ltPykZlteDOUIR6sPjhuYKbpRtYycvCx1k8JmmHPiiD5Ue+CPUhnrtZlE39DwB6W5aH56FFg9O6tra8nRhqo31dI8eTQeBxyDuJ62PlxLz+EyvkmoDY678h7mIhDcSrC6e7FCsoQZO+aJ/c+DN2WZA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oA1LkSZ7J247P3nQtcBvKALon2Bya2bHa99QuSW3UDKWErjMdN9vdAJETLsDmX1HWBGXRBdYACY+b6tE6+issi7KFqqo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Q0wS+GVCk9mWDpaV1EmMt19MHPBmDXuss+YU21eTzQqzOIkbxq9Qqr9L2lr1TYEAr8ARbaKE1++Ba+nhvWmLYfrzeyeW7BXiNisdmNJ7wZDc+xCdzVVDAB/hvauFySCXgVRruw+BrxTITK0q9H0q55ebwyMgy7T0dewhjn2Hxs/08sA6YYRtPlrMyR5Y/e7kfX+jDE0ycoY5/KXtqV37oDaRJJvECXKIw4/19/MhRh+7YJLt4kb5em26vigv41VgvbzWxvZwUIu4iCxgyEWhyH6GqEwcv7N5eGNJSrlPXZNUeg/7be76WbBQdn7j6EvQzwF9pvqQGZn01Gu5hmb/gPJujoYVliwrDiDzLkt0MP7UDQdyY26uEBb9iXpzJbcKV4ZgSA5dYeI2F65+xAVsHgehGqcV+t X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ed39383-e31b-460f-bc88-08dca01f976e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 14:01:12.7778 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zg9Q0dH1MKyNRD8HB+Tv34dOddy6jMyM+Y1k8clY5+Fy59O+EWWy3lRGtqSOsyUzi35B0RT8AG3NNlNQsJY0GQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8622 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240709_070125_271768_46A33653 X-CRM114-Status: GOOD ( 17.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan Each platform might have its own maximum mailbox receive channel timeout value, so get property max-rx-timeout-ms from device tree and use it. If the property does not exist, use mailbox 'scmi_desc' fixed value 30ms as before. Signed-off-by: Peng Fan --- V3: None V2: Fix build error for raw mode. drivers/firmware/arm_scmi/driver.c | 19 ++++++++++++++----- drivers/firmware/arm_scmi/raw_mode.c | 13 +++++++++---- drivers/firmware/arm_scmi/raw_mode.h | 3 ++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 6b6957f4743f..1aa613d4cb43 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -162,6 +162,7 @@ struct scmi_debug_info { * @devreq_mtx: A mutex to serialize device creation for this SCMI instance * @dbg: A pointer to debugfs related data (if any) * @raw: An opaque reference handle used by SCMI Raw mode. + * @max_rx_timeout_ms: the maximum receive channel timeout value */ struct scmi_info { int id; @@ -188,6 +189,7 @@ struct scmi_info { struct mutex devreq_mtx; struct scmi_debug_info *dbg; void *raw; + unsigned int max_rx_timeout_ms; }; #define handle_to_scmi_info(h) container_of(h, struct scmi_info, handle) @@ -1302,11 +1304,11 @@ static int scmi_wait_for_message_response(struct scmi_chan_info *cinfo, trace_scmi_xfer_response_wait(xfer->transfer_id, xfer->hdr.id, xfer->hdr.protocol_id, xfer->hdr.seq, - info->desc->max_rx_timeout_ms, + info->max_rx_timeout_ms, xfer->hdr.poll_completion); return scmi_wait_for_reply(dev, info->desc, cinfo, xfer, - info->desc->max_rx_timeout_ms); + info->max_rx_timeout_ms); } /** @@ -2614,7 +2616,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device_node *of_node, if (!cinfo) return -ENOMEM; - cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms; + cinfo->rx_timeout_ms = info->max_rx_timeout_ms; /* Create a unique name for this transport device */ snprintf(name, 32, "__scmi_transport_device_%s_%02X", @@ -2888,7 +2890,7 @@ static struct scmi_debug_info *scmi_debugfs_common_setup(struct scmi_info *info) debugfs_create_bool("is_atomic", 0400, trans, &dbg->is_atomic); debugfs_create_u32("max_rx_timeout_ms", 0400, trans, - (u32 *)&info->desc->max_rx_timeout_ms); + (u32 *)&info->max_rx_timeout_ms); debugfs_create_u32("max_msg_size", 0400, trans, (u32 *)&info->desc->max_msg_size); @@ -2940,7 +2942,8 @@ static int scmi_debugfs_raw_mode_setup(struct scmi_info *info) info->raw = scmi_raw_mode_init(&info->handle, info->dbg->top_dentry, info->id, channels, num_chans, - info->desc, info->tx_minfo.max_msg); + info->desc, info->tx_minfo.max_msg, + info->max_rx_timeout_ms); if (IS_ERR(info->raw)) { dev_err(info->dev, "Failed to initialize SCMI RAW Mode !\n"); ret = PTR_ERR(info->raw); @@ -2953,6 +2956,7 @@ static int scmi_debugfs_raw_mode_setup(struct scmi_info *info) static int scmi_probe(struct platform_device *pdev) { int ret; + u32 timeout; char *err_str = "probe failure\n"; struct scmi_handle *handle; const struct scmi_desc *desc; @@ -3002,6 +3006,11 @@ static int scmi_probe(struct platform_device *pdev) info->atomic_threshold); handle->is_transport_atomic = scmi_is_transport_atomic; + if (!of_property_read_u32(np, "max-rx-timeout-ms", &timeout)) + info->max_rx_timeout_ms = timeout; + else + info->max_rx_timeout_ms = info->desc->max_rx_timeout_ms; + if (desc->ops->link_supplier) { ret = desc->ops->link_supplier(dev); if (ret) { diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_scmi/raw_mode.c index 130d13e9cd6b..06a764d106f8 100644 --- a/drivers/firmware/arm_scmi/raw_mode.c +++ b/drivers/firmware/arm_scmi/raw_mode.c @@ -165,6 +165,7 @@ struct scmi_raw_queue { * @wait_wq: A workqueue reference to the created workqueue * @dentry: Top debugfs root dentry for SCMI Raw * @gid: A group ID used for devres accounting + * @max_rx_timeout_ms: Max receive channel timeout value * * Note that this descriptor is passed back to the core after SCMI Raw is * initialized as an opaque handle to use by subsequent SCMI Raw call hooks. @@ -187,6 +188,7 @@ struct scmi_raw_mode_info { struct workqueue_struct *wait_wq; struct dentry *dentry; void *gid; + u32 max_rx_timeout_ms; }; /** @@ -379,7 +381,7 @@ static void scmi_xfer_raw_waiter_enqueue(struct scmi_raw_mode_info *raw, trace_scmi_xfer_response_wait(rw->xfer->transfer_id, rw->xfer->hdr.id, rw->xfer->hdr.protocol_id, rw->xfer->hdr.seq, - raw->desc->max_rx_timeout_ms, + raw->max_rx_timeout_ms, rw->xfer->hdr.poll_completion); mutex_lock(&raw->active_mtx); @@ -437,7 +439,7 @@ static void scmi_xfer_raw_worker(struct work_struct *work) raw = container_of(work, struct scmi_raw_mode_info, waiters_work); dev = raw->handle->dev; - max_tmo = msecs_to_jiffies(raw->desc->max_rx_timeout_ms); + max_tmo = msecs_to_jiffies(raw->max_rx_timeout_ms); do { int ret = 0; @@ -574,7 +576,7 @@ static int scmi_xfer_raw_get_init(struct scmi_raw_mode_info *raw, void *buf, dev_dbg(dev, "...retrying[%d] inflight registration\n", retry); - msleep(raw->desc->max_rx_timeout_ms / + msleep(raw->max_rx_timeout_ms / SCMI_XFER_RAW_MAX_RETRIES); } } while (ret && --retry); @@ -1162,6 +1164,7 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_info *raw, * @num_chans: The number of entries in @channels * @desc: Reference to the transport operations * @tx_max_msg: Max number of in-flight messages allowed by the transport + * @max_rx_timeout_ms: Max receive channel timeout value * * This function prepare the SCMI Raw stack and creates the debugfs API. * @@ -1170,7 +1173,8 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_info *raw, void *scmi_raw_mode_init(const struct scmi_handle *handle, struct dentry *top_dentry, int instance_id, u8 *channels, int num_chans, - const struct scmi_desc *desc, int tx_max_msg) + const struct scmi_desc *desc, int tx_max_msg, + u32 max_rx_timeout_ms) { int ret; struct scmi_raw_mode_info *raw; @@ -1188,6 +1192,7 @@ void *scmi_raw_mode_init(const struct scmi_handle *handle, raw->desc = desc; raw->tx_max_msg = tx_max_msg; raw->id = instance_id; + raw->max_rx_timeout_ms = max_rx_timeout_ms; ret = scmi_raw_mode_setup(raw, channels, num_chans); if (ret) { diff --git a/drivers/firmware/arm_scmi/raw_mode.h b/drivers/firmware/arm_scmi/raw_mode.h index 8af756a83fd1..25d4a46261e7 100644 --- a/drivers/firmware/arm_scmi/raw_mode.h +++ b/drivers/firmware/arm_scmi/raw_mode.h @@ -20,7 +20,8 @@ enum { void *scmi_raw_mode_init(const struct scmi_handle *handle, struct dentry *top_dentry, int instance_id, u8 *channels, int num_chans, - const struct scmi_desc *desc, int tx_max_msg); + const struct scmi_desc *desc, int tx_max_msg, + u32 max_rx_timeout_ms); void scmi_raw_mode_cleanup(void *raw); void scmi_raw_message_report(void *raw, struct scmi_xfer *xfer,