From patchwork Wed Jul 3 03:17:14 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: 13720891 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 A8E91C30658 for ; Wed, 3 Jul 2024 03:08:58 +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=Anqs+ftUgw12gsXDagwnEZjP9HLqeMgaU5TvwKAKvPM=; b=MwDASdWdVjgJC2r15JU+o/ujjJ sdjW1WD4sTPxHNXJJ2gXr37evu7jWLx+7O1on95+Vz3jnfLwDYfm0oJPyaWBW76DOKIxFY4HlSM/c SZ2YvK2JL1FQIVQjOEgwevIm9mPe+yRFZ1ZV+rqWrFQRgjzaJppDMmWSd9P0nDt3ni3srsoZQ/oug 3Yaz2WUWAodvVXvlciLami75O3RtEvRr0O3zgmUJQK/AwhgUs7KBrwYjejt9PSTJJzhOaWMTtinBo VNEdbSxGx3sruWQx0T+gA6Sb7wZoo2PpWcK9gFsnmM1QK0OSrBk65NgPIDNmwSmflB+4kR3GuDHDT 8/lUx0iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOqMQ-00000008gNT-2yFm; Wed, 03 Jul 2024 03:08:46 +0000 Received: from mail-db5eur02on20600.outbound.protection.outlook.com ([2a01:111:f403:2608::600] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOqMF-00000008gH1-0n7z for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 03:08:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RRglS6bSptGVwhSb4NU7ECl6q2MC48GlNYoyRlQNRe1vSxUHtrnNsdXl6yk2yHpyzxwvhqfMJbAjV7XhPLLTwSMCLUNQyyZ3WqS14LqiZ6sfNH+v6sdMnyV/CoIKRQ/3cp4JZEZ1dYdPxQwgmybzpHC7t10ObgDZkVcklzvUOirY48czK7mnjGFP8a88CFlTaZOhRNpHVuCJE+OmbYzkPUCNBhFssJdhF/qPcPXnihhFZXWrsjjEltJJnEpw9QS3UrW8Q05BarJUSw2C8/X2MhYP0Dbr7M/JzwBQ59Lhsxl9vc3bcqCXDQeA+f8gahgSkmeqdnPJ4gsWdedSAnkWjg== 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=Anqs+ftUgw12gsXDagwnEZjP9HLqeMgaU5TvwKAKvPM=; b=OhRyK8YA0x9LdnNjTvLSVHKefWJlYVDH+HHNY4xCOUnlSqGyvlz0geYQE9WOutGcjyF09KN8us/ot1Ud5jSdgh6VQZQuvu3/PQcP2YfoKoXBGix7/53pjCqXOcv9q7yqD1ohjqZ67AbCnJH11Jo0+1MzEXZEgItYzWUklgi2wi8ZGvfGwYKFweHjLdZzR60rifqy0aUGjAgmoOvBbnZTNv2dHpbFjkF4sOAKrnr21hibejiJO+6yR2gVNlG3BJPzreKaLCiXVxusDx29/T/bPIDoj4uJvmBKmXItW3r0CANeOcYY0QU10fM9HZgkaPVLFUg/4ndfcxPk/2U7OFF47Q== 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=Anqs+ftUgw12gsXDagwnEZjP9HLqeMgaU5TvwKAKvPM=; b=kvELeQrrOqhoFtS6u+DEpf8zUIB08INGhgw4eGtOgpCeIq1hF66KhexZoXWO0wus2cbXtSKrht4rCtnED2M7Ra/YR8E8Be1Jz69z4d9BqKRK+jaJU2CexPDSzZOZowqHV1Rk41H/75mFm/f39OJcDHMAtVymLyD9xe+cCNK8e2U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM6PR04MB5941.eurprd04.prod.outlook.com (2603:10a6:20b:9e::16) by DU0PR04MB9561.eurprd04.prod.outlook.com (2603:10a6:10:312::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Wed, 3 Jul 2024 03:08:22 +0000 Received: from AM6PR04MB5941.eurprd04.prod.outlook.com ([fe80::9f4e:b695:f5f0:5256]) by AM6PR04MB5941.eurprd04.prod.outlook.com ([fe80::9f4e:b695:f5f0:5256%4]) with mapi id 15.20.7741.017; Wed, 3 Jul 2024 03:08:21 +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 V2 1/2] dt-bindings: firmware: arm,scmi: introduce property mbox-rx-timeout-ms Date: Wed, 3 Jul 2024 11:17:14 +0800 Message-Id: <20240703031715.379815-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SG2PR01CA0112.apcprd01.prod.exchangelabs.com (2603:1096:4:40::16) To AM6PR04MB5941.eurprd04.prod.outlook.com (2603:10a6:20b:9e::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB5941:EE_|DU0PR04MB9561:EE_ X-MS-Office365-Filtering-Correlation-Id: c937a819-4b82-4860-b2d4-08dc9b0d64b3 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|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: e2K35wEuMjCEXEx8IMJYzLKJdCW4ZtPEF8H5tq15dPxY8dcaLdEx6CIJPfQuTxCjqijzFXLvFSK62A8YCeLoeNUNfUmIUaZeSE8t5uY2NGXaj8KzNjCIuOZ1OPA3xdSjMutWaxD/grYaYZZ2MtdzjQqJkHivDJMo3wgB0ZGigHzy3Jj+wwSbK7ZY1UfvC5KeTLgWdmZ7iKONdPOkh9kgsae+MHVqmOG6D95rdDw+fJ/p9viAZTap2P9A566e6uOxBNmn93TUZysyoN3+h7hCuhML2lvVQmRNSAUQ6zCQCVaV/b+kl6ZfLWQT7HTspVA2KUZtBre49oQWE4oymOQM9xRrFopO1EMgWrGBbNm/PGlf1hQrjGsnbl9k29alw9deCFpGuOj4GqwKIJZOcD4hIR04NH3rt72qv1qEyFrvjkfkU2snfNkujTCx40aVapEy0prIo+XJt64YHdDOSFisNAjFsqpfZP1hIY5uqd6gKHS2t5tl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366016)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5QfSj6q8HBATY/mQ8F783kfwXQsuXF2ZmNNVKnuNwwF97dijSWGwD8WLf8PIOCAwyIZs6awwkm/LDc9pQOmvGDSLTiKOp5EirBLkAvSWL68Cy8/9nOTDXzWwJNLCAxSg7QUzgE9Cz7R6H040InqZMkSqO0j7isJDV9mQHsoSxbiwTVI93p8RMdH+Af31JFwzieboeXtTgaAfnnZrVZNjxQNd1EErjMaj3w7u+dqk1sBFF/N5wqxtHc+DTKWKF8wgB/fWdDdDZZeihljxjmJ7vcKOiSjR1kENaXBl3lRiLujVjQ/IevNlSu/oTCacybdeih0EkRh9cL/AqsqiVrNwmKQSorpFrl3FVt2ob+Wi9EWZIA5cAYsQxqYyIptRcYeQWoSwC75ERxp4+meWXmWxM8MoNpQQOwKry57jmk2ubFCQfGM+UpaanWWNhd9eiZmhAafQNdMAY0I32iLKHPcKdU8ck2K25Ce6AL+4p9LZVuokZbCTBucWLrDeIeiN8gAmbQj/bbufEHh1w1CIBcrvGNdUoIFx5cFkcNDLSJxjo8CH8GNFf9UCbv7iKKWYr3fpm7DNc01UaSjtCpMf3bJCWhmYvNRQAKjF/241wLiz0h5919OQIwMeTPX8GsxnrPq3+hTi6zJxtM1p3CiVwVO2ioboKMMGUfltdWc3kCntlVo5lCDXS+g8mxlwAmwtR8bJCtr7bEzFTTj/EVn5bY5AzgVSx6xTN42i6yckXIPiiQdJ4r5LJ+GklIp6909nbp9Y/vHQuAl2oAq9WONL4hPgSO4EPkhh/S7k+gKtZZiKAp0LqcdbDNWCmnNGSeO33t0kWPpi47xzJEWPPYUrl48K1pfhNMa8DdosQFv+EbjXXBctaPUHF7KvK+4VuelfcFF/YwtrEINeRPRQyKl/FiWkssBHH3Fp46fz3RVdohxh1DO2iHz5v1nIWZpsuwWjsUHv/MYQaMxC7ZtU0ikk0XOvKaqjIA93VD0pji7/yStHhAk67jx29FVDqq8UZef7n1uAAsLe76D42nEEanFSila8a3JpXU/Hua5Z319NU/qdpO4kUXZRuSqcB+euCCNR3jfjnS00MfYsUzhCB39MdDPlDfnQ0UcqdWrjzdoXLuN1TrfVTc+njqu0G4mzqmR94cn/ja2Gl5l4njzNBwXOG9gSIlQl/4iXnsW3HsReLbKPXCONkF5V53RziSM7lW/LkrKNPwO2VV6mn/2J1aw7lmmThEzgWIBq09p92TPeKFJK24ae53BrzchtoRlBQruNn4HvjzsgwdKguNoTLuVvq2Ff+plTFB6yI+5SCVaE2C5MTqTrNzsFhLnVy0/F8qcNetxTJ+iQhIxtL3OgWp5RuxFNYE/My7BvHk68qYYoeigIRfZIdh4IZVug7pY/aO+GJ68NO7X8H5M/+XppFJKBDmJWaULwJ8TjMUUh+wiBO11PMGy2VlhfdxtdoXMQG6T7H/bv34AEe9/Ky1V0jzw8YQHlovc/8yd+HxpDhg3njoUCKM4+5zidK0HD6ns/seW55q2f4Q6S1RsvHPnidGveAtF16gEGkaDh3/N0vhJn/vryFIsaZucu+P4gXx2sZMMNMTny X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c937a819-4b82-4860-b2d4-08dc9b0d64b3 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5941.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2024 03:08:20.9660 (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: igaueNygnb+/22E80AtMGGeH2kJK0oGXiFfZhd+wWy0ZPt1oTSIZA/FhxN6ewRuYvpqnyHjmXZ1N+ppfHlZqtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9561 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_200835_280808_AD22BC76 X-CRM114-Status: UNSURE ( 8.83 ) 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 --- V2: Drop defaults, update description. Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index ebf384e76df1..dcac0b36c76f 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -121,6 +121,12 @@ 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. + arm,smc-id: $ref: /schemas/types.yaml#/definitions/uint32 description: From patchwork Wed Jul 3 03:17:15 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: 13720892 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 53063C30658 for ; Wed, 3 Jul 2024 03:09:09 +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=MTAKJFwOAaDeAHn7xR+hXAhGCnbdi1gKav6+I2dj84o=; b=p4/TNDwdplIJdehdJkwosbekma LFkQzzu9Ta1jTFDEoLsTgMkNKodjGV948vz6c92PRecW4FupBnV2OR88QoFFEP7O5vE/6T+nUKNWO El1MO+UmGL4yDm1aV0l2CaQH9IYJSS0i5JIxluHb6o+9KY8293don+nSOjii2wI8TBPM4+ZrLr85P VsTxmCGMVe8VJrdRubVX63OT/Ithz9aVddEm5eAbnT2Pqz/BgscqK6WCygNtY4jvqGXxRMUkTBm+T YV/a8JkDFA+ekVP5B0EOiEMQgyk+J6fzp+JbcSFPJ1m8OY1m2n0sff/kZ59mg4nsxROJsVtVBI5i7 ukpIURpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOqMa-00000008gRu-3P5u; Wed, 03 Jul 2024 03:08:56 +0000 Received: from mail-db5eur02on20600.outbound.protection.outlook.com ([2a01:111:f403:2608::600] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOqMG-00000008gH1-3f8b for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 03:08:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DoaUKci7F5MRwnxToZbHFZlMkWIaBLTK2MfUL49Fii/EUXxWq+QxNvRO5sYIvaIY3AEmag4bB6phU+LKJNSq9j4aewb35MmZH4uJfT8Aw/NaVPUInxaYy/Ic4GV+mDYvvD2amdVhgOgoAMoIlX4I6uP5EyKC5SGelX/ghFl/ndjK2Ch+5M5R4uVFM+si0STPlTUrfubB5M2wuSeB8Phgn4xGYBh77AyZ8iphOdkzr4Cf4DzWqrjcMfVP6mWEc0Dw9jocVCgfWIumvP4O1UkPO9udjaqaSYHB6Nm2FDQ5NHRXJ6vgMWvOw1bM7nGfHT866hhDVhz7Ly9DzIQnnZApkQ== 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=MTAKJFwOAaDeAHn7xR+hXAhGCnbdi1gKav6+I2dj84o=; b=niiljXhS9EXyulSLkx2ROOHn1DwskS08DP2rXvT/fGb5gUXk7+umwudX27JUZjdh024ZVWM7nP4EJXY0diMsvHy3BtBl8dStX8IZkfwPNCspyLo/4fl+Kyr4qi98ZXSGA4m0Lyu4gRN8gXdVnB8sLS2P0j9ma8ifgkZmb8e8QlZyFgVNRjncEjbf1yTy/dOh3zG13ujD8gQiNxjG5auSBNBzoovqUqNxOQnStNVZPTY4fmNWrAryWH5ujYLi80d5L936kGnGeSt5WhGTujlZflMZqFC7o8Bvibmx3zHINu6FADhnXQT2Kyz5vu1w7+GXEs5TF1krYvAVevA92/QGNA== 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=MTAKJFwOAaDeAHn7xR+hXAhGCnbdi1gKav6+I2dj84o=; b=dYrlpg/6OC4IQ7XlKC0V9NdpUSuL7tYFObv4IRTQmNsgeL1m1JLZqrAvQkE1DN4TQUTdYp8N9N1MYzsZhBvBluOyzoFPrQRuR2iBz+IXTvnUcjOLKh+sST211ZLrqN/Pq/DjHwu+CtVIpmM2vFW/4XNBMAODEe7XqbrckzsWcl8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM6PR04MB5941.eurprd04.prod.outlook.com (2603:10a6:20b:9e::16) by DU0PR04MB9561.eurprd04.prod.outlook.com (2603:10a6:10:312::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Wed, 3 Jul 2024 03:08:24 +0000 Received: from AM6PR04MB5941.eurprd04.prod.outlook.com ([fe80::9f4e:b695:f5f0:5256]) by AM6PR04MB5941.eurprd04.prod.outlook.com ([fe80::9f4e:b695:f5f0:5256%4]) with mapi id 15.20.7741.017; Wed, 3 Jul 2024 03:08:24 +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 V2 2/2] firmware: arm_scmi: set mailbox timeout value from device tree Date: Wed, 3 Jul 2024 11:17:15 +0800 Message-Id: <20240703031715.379815-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240703031715.379815-1-peng.fan@oss.nxp.com> References: <20240703031715.379815-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0112.apcprd01.prod.exchangelabs.com (2603:1096:4:40::16) To AM6PR04MB5941.eurprd04.prod.outlook.com (2603:10a6:20b:9e::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB5941:EE_|DU0PR04MB9561:EE_ X-MS-Office365-Filtering-Correlation-Id: 0df74ae8-6d7f-4456-2ee9-08dc9b0d66e1 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|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: YzRYSBNLVo0HAMw97z7WNNKJQdiS4r1lPRwHHlJ0LlknBoX3KhBhAPbOMZN2wVir+D+AvH5LPt4Tfh5TCKVPstE0OLrMXBGPd828vPGua64kUro1ErPy46dNaAR9ENuNshUjCTvWRBjWcDvwbStr7XY+sEMWV/LFRKZpPTxRZWruYC9DTxin1YNK6eJNTJ9rhPOt4N92OH5eMijQX0Smc7ToIJYqupCo+YP7Fv3FLMxjqo0TGIzWRgEE/k4stY1d/MFnak7EgqzeWHLCJ3pqBzW9Cw8eMJ+JVBF90TtA51jcndZDt2f6ZNfffIyD5bwksDgO3eGlAslI+Qnom3ExVCQcii5vSXJyKXlJePQ3vAcKoy+mLrGIG3m1MSdBEdOQhxsCQTtdVWolkxesxiIVre8n1Tc8xkUh9LZ8R/iSQAt16VDH4+qvSXGERPjTo97jBcMlBFcdKqEeJGqlFS3G8ZEd4J7LOAZC9uKoZGVbnOS+WDCtbZtfboHQ9IgIHIqqqzScFyysb/j1EGuPh/FGCKWrLjQ7tGiuoN9UhSR5EoVxlbBwg9fUPi58VHRoAywka7fiThZe8ysC16apF3ki1UnsEmfOcMsuUqo9+fcCk2lGiIIbg+scIMcp9Q3F2y0SG8Kow1na5UgemfSVVMRFljTsO6o1VMpqT+KyVFpRCdc/eJ6mA+OkI2M52jHNby7ABIGvnLBVwCPxyV5a4tfVaVdVeZEQyfBgai67RDrh/HNPkJ99S25qfAZ1D+y1j1eVPW4DrzYtXoFTRvHkZQ6q5a4uKIoxmwXAK65175rEuWLeOD1b+jU9aEKS1dPK6QiIBJ35CANehuMHYfbNgjmvRgppZmWBY3RH7w4EWItzN+1mYqgqdQEeqgzpEv5Gkrf+xgqJRfw4FSawMHG75tIcPxDEOr7EpAuBwMsOXHioFQuSywAAb44m0xrtuR1UEaomDT5Cw+RP7jb5x45dp/IgVXfiFrLrKhulzPgHTR/tLBFg/soDkHZMfcduGnhaIln/dfQj6RIsztTZPJXlQR3cO9C2znJ7UfOPLMqrQI4VXDdkGZ8SQdeQjTG3w5yOU4rG2l0Ma6obI634RstDdUD/7Q2/xdW66fa6akDmbNLSkMFtpW9NyfZgNvOKwn4/9fa9LCgfhuN9nLJuYyKQPNi3QGYB+RKI9PVplY4amrhQUU0I3y9O92dBkBZHnS2FhBdHw8injNNj6hG2Q0ob/oB/QYXW/uP1FtLBNe1nhB6zSAdPcTUAaitWe5LKjbGs/R0pCyt3nezBYziky+NUTBcGs48Ud2kUinQFF/mXpMEJ6P4CRHNq9CRyo2e78tAjExR4iqSIw23/lg3KKJRXE/HjwYruqQYnZpUPaZewKFLhrUCArv7bic2afvB99xSdJzLzd38eAqZpEQNW8w0nzHb47Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB5941.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Gu/oRuR9D8OpMLGsDQCcmK0BHM2NMNR5URf0GRzxUj16MmgJhC+AGX2LrEiJHXTVMf1LdoQgqpNgt+QmmErJSSAtClkBL5EutUWVHJN1ng2xNMw/ftljT3td85bzt/CFMw3UcyptkPtGbtV+UrvN+nU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OqW2GU3ykVIS+Hg7xBmki7MO+4HUg+B5O3dk75wFk9ayP/TyKmc15Qh+jir3TD/JIqCPunOF/EipVkgQE7RUgg9Y2sCRonLfcDyNkqfL/Ohi0132RAGXeEQtV8hvDQsJ/cHMeKbU4Wuze6Ao0M5UB5FiyRlAnbVlAWeedK8935NwZaxQNRthP4Qgk4ryXB/5gw3K3kVYfZJ+YOke+mdvvAmSC4WMw2ND6gDP/pYV+FOrhuMDHqJZkB/wVws/iRyTQfcPpBepr6B7PDs2kljqGU4t1VGssPk/q7zQ2KYoCvjpV9rOP4oOX1ZbnUKavWJIEFVrFv0PAB1bN8ykDiQCCQ6JjLmDWuxE4G X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0df74ae8-6d7f-4456-2ee9-08dc9b0d66e1 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5941.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2024 03:08:24.4311 (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: V4+bvHvsSKojWmZHHp0baOXMLO40Fe3eH2IWIJdIdRhMaFdbrFA012cwi5C4T5EfFWAUt06pm/81y4+0187OwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9561 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_200836_953674_CE463315 X-CRM114-Status: GOOD ( 17.58 ) 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 --- 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,