From patchwork Thu Aug 22 13:48:49 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: 13773457 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 EC227C52D7C for ; Thu, 22 Aug 2024 13:42:00 +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:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X/4TdqO7xD4oZ98hwQlEfiM3HWZFuD3eY8KClVy6sZ0=; b=HX/AIcfnto9LKrtrE3EXnXt2ML DfnvI8tnHlvUsfgJb1zMsk6CX1I+RVZCTXFxU0dPNWZE4rrnX/yxj07yPwWKf/B5hg7hoW8XrDZ4I lqfqfOeZiQubauyua8T4DIrzrYmCMNlv/BFJ4KWdqYQaEMk9V1gqPzMPxMdJCA0Zr5HdXGmU+zOEC RiFTzFHhyYWd6nXCLVpZkv5qUIqJ2h1oKp22sEejdcjOAXH5Rij/fr7ww+vLw1kgEMirY/19pr8pA 0tHv17PGlN8PHeaT4rM6tlUdqgBVz10xgdotFVTvI1dMEzcQ5nEst5gv0NmFsFjI4Gjc6kgfh8q4N o0ym3f8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh84S-0000000Czap-0Lz5; Thu, 22 Aug 2024 13:41:48 +0000 Received: from mail-db8eur05on20602.outbound.protection.outlook.com ([2a01:111:f400:7e1a::602] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh833-0000000CzJN-0uDW for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 13:40:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o4z5N9eCWWgdq1rON3jmOm1xH7sPCfX/qK0VXXV2xX0Na2Utx6IG3zG/PNSu3WI3HJmOKxfV2eAcJSdDKte9slH09cxFZORbhSGq33akwEqIpJcrCDFQbwmaswlAxXlN8MMuvA4gxm2dO3C+YAzHsXcBmCmqIq/RbBWFHOZ34y3d3pc0PS0Li9J3lki6AKc37lPkeWs3bnwTxI+kwTkpYH/nU7QinjbKhXxcBuK0xSsMcnDUgYSnRu9DnS0OQ7l+G4TuulN+daLe4vKLyekFVp8ifjiwnqO6oX57C7K8rrNLEngjHHZUeLvyr/2/vt2uo26lWCLXdeBKEkOwc2utbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=X/4TdqO7xD4oZ98hwQlEfiM3HWZFuD3eY8KClVy6sZ0=; b=LMYnTu2Vcx90KacGtfn2cZ/ie4baSoQqvp6mANeQwaCoJRsmVB6B5s41k3gY2NOekg0stTpc6v2HVSJ8YeJJAwkEhwcuzfFR2jVuCcmzL1cYNlCNDMTKhqx3nNdLQzhKFddHopUOoTuybyjvm0uEqb5GuBUFm4UBSfuAKMWunyNhwNGpPOGYxbVbLAfQAKJ1aDjQsbkY+eVEYuCzNsUrKuW4LCGbjku9SGzK8dESLlwt74VoObPu21+u0/Kie+9w2+RFXFuyWf8yNLIFyEC2uBVtM3PlaoJ9UAMCksU9m5Lchzt01HuqJ2k7Ll2dNZdNEbsLbmfbfDk79p4MeStx4Q== 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=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X/4TdqO7xD4oZ98hwQlEfiM3HWZFuD3eY8KClVy6sZ0=; b=nMt8JlBFtOW5his0WZvwTRNCO+aOD0nGuQq/Ht3rQW6FJoGza7jGrBGo9TNAHMDtsdE8l4QmQSv7Y9EHvX5mRFqHE9DvR6cHEt/TKjIRGg5IRUnpzO1O5NvlBsPmHY4ccaurjrFgjCFcCFuOQZaio3HDXVcv5Mh6RThLEEqFHg8hGowtO4r0I0Oe7r5KBdQ6xQor3xK5jcou1NSG3+IQs/cYi9HrNrfnFDdvogPMK4Pvt7wXemzfHRpxW64rX7az7IMpEKcbFP4CFzwiM7LnWfr9r6cSs8F580RD/KKT6/GJ3zh0g6q+mtHuOHbEiaIxmZPqY9q8bmxWh9ASQBEIHA== 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 GV1PR04MB10126.eurprd04.prod.outlook.com (2603:10a6:150:1a5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Thu, 22 Aug 2024 13:40:16 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%6]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 13:40:16 +0000 From: "Peng Fan (OSS)" Date: Thu, 22 Aug 2024 21:48:49 +0800 Subject: [PATCH v3 1/2] remoteproc: imx_rproc: Allow setting of the mailbox transmit mode Message-Id: <20240822-imx_rproc-v3-1-6d943723945d@nxp.com> References: <20240822-imx_rproc-v3-0-6d943723945d@nxp.com> In-Reply-To: <20240822-imx_rproc-v3-0-6d943723945d@nxp.com> To: Bjorn Andersson , Mathieu Poirier , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Daniel Baluta , Iuliana Prodan , Marek Vasut Cc: linux-remoteproc@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1724334552; l=2358; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=+g8vBcVQ1XudqDTT7ofwoWn74vmRIC6pTXYhqi5R1K4=; b=Li1vQN6WF44YVokSWNMP5DC0qafyE7fZk0Fy9V/IE8zlbISCYc8Ttn2faz3OmKCGLtfOF+XOq CHuvfo0Xyh3CagD8w7pwOJMrxS0gDaqmR5mzIEuxlCNrSJf+3ZCJK3A X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0051.apcprd02.prod.outlook.com (2603:1096:4:54::15) 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_|GV1PR04MB10126:EE_ X-MS-Office365-Filtering-Correlation-Id: e346a209-f7d7-4ef3-e0de-08dcc2aff4fc 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|52116014|7416014|1800799024|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?SM1TqHF3X3IUuD77OH++2Z7o3nmQE0F?= =?utf-8?q?W/wvcG42F2OuFOpGVQyVeR/9I1Rds0UZ5pK4gecH7/DdoYC0lKPzQLoFjpy7jpwTw?= =?utf-8?q?U/tKvJTV+m4ZtVCTzE/1xXQ5PrlKPnwV0K3/a8kO6jcnk3LGlk2o+Ka0l+iDVks1g?= =?utf-8?q?0pdCgSOCPhmq+Pp8g9XWsRtoH/3oPuihR8aWmBkiFtNMEYubLqmieUk4g6hfTI9cW?= =?utf-8?q?HkSunv9g1vYohG2daq4RGkPHAq7f8v8a+kMjCIIKSOC360ZW/JkP41KGHHbKDfMbd?= =?utf-8?q?8ZUm7ZCcLWEr+F+A+XrLz83hAjo+Ff2/AEhUWI+qyjyfrLpu3F9L4/sG7II2kHxCx?= =?utf-8?q?/xo3TwbzT0zFHvy7auFg3RsxRL8pDUmrWlroLctCmUHExc4TmChi8IqL45kB2IqxH?= =?utf-8?q?4eSdipx9Qo3PAyLH/ZbCwHtcOxzaELC0fHNZ3Z+YvHmdMrIziJhbotN4Y7kR/XxB2?= =?utf-8?q?wXCfZN7oo/UY+5OcnqZ4VQN2d2DKsGzykCxytYH/ux7HIqCIkGAXUjccp37peOmHx?= =?utf-8?q?EPWheh7++Gj6JHY5SC+ZEPmU+jQw0n+kNRavKXKpadq8nI7cxtFjqM967ZXnasH7a?= =?utf-8?q?fOw6du+ElC/iNRmEb0VgTCzKKg3XjrzIFkIwR79MRbKnfqz1SUguWTjNh5UBwZdjJ?= =?utf-8?q?6N8OmvppFnLpAt8FLZ3CKpATmRWCcP/USLidrOGlIT5fGAn0AeISuYpkxR94DKDOH?= =?utf-8?q?DkDBzhl9HwDc92a6NwoEx+UAyQeQbzBZefr9J0DQNwsHZFbXBSFedAEiTst2TrfhB?= =?utf-8?q?8oVkbgbwmYaZ9mdKxzOD03VpNxqKc1V+kpegsyro/eoVVwrcgrWUy/b3MIFH6JiFi?= =?utf-8?q?sOU+lgMDk38C2gQM3ahFz4E2uQTww1tRYAeEq82pKS3g4sH+EA3kwRzBQKzvL6Cr0?= =?utf-8?q?GocjwhKh1allIdyrr5wr0m9El7Ta/ARZOxPLQos5bcG2W/+Yx0oiwrV31mHcQZ3vh?= =?utf-8?q?rBVCsa+7r3xhCrpR/0ltYoM5PiQ1i20oe8pH9Swqj479e+toFQq+Ny0PDrqe+dkCy?= =?utf-8?q?pf/2gu5sI2Bkc5a+XBvXhG86T70x3XPLo7NgfeOyDyCIvJhyBmnLXbEx8prlnmkCb?= =?utf-8?q?vCu3fVQ2ftrl3CdZAS6Z22M9s6INnPU1KJA+hgUqS8KlJMNpYWz/VLTyEgu+tOFCH?= =?utf-8?q?BxlpGSMDAQg0JUFHuROl9RzNUkD9vEEsIp/KtysRkN8cpG9/aoWZwRD1j+DRhnkzm?= =?utf-8?q?73/wE2KBESHgbzeCnubQGSF2+abAkpSsWcwXV+LDkFR7sia2lct3sk1tX+1izbL0r?= =?utf-8?q?XlLeVbkdbKBhVxlZ0RAOiZElFPulXvVXKVWY/VTvZTspGtePomkicN695Uet9nENH?= =?utf-8?q?0Nze1GB5IcO8SvXt7Y0DeOBbgsIZUXsIkw=3D=3D?= 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)(52116014)(7416014)(1800799024)(376014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?xzFvWGiLKdItq997Ezq6UrzisOnz?= =?utf-8?q?EL9zJetN+lqhsLen+qvUifBF/Eqvj4eXwpAa9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eSHzFqYJqJ93MQCQqwVnPEMq5?= =?utf-8?q?op9GzDnEjKfZ/63dZ4iBJojm4qD2m3plDHJewYXQkI52pJNutkyAJjT5kRYhNWfKq?= =?utf-8?q?AMc/0i3GTHJUul140Vt0NRCJHw1L+FdHKCu9ZmF62+5V4rnx2aL2Iu6WqwRQU4JDr?= =?utf-8?q?AKXGq0dGQq8EpikgEmk8JNj0Jp5fQdYfdopMTQRlhC28rfniGQbIWx0ndcYUb1m5T?= =?utf-8?q?GfbI2nNh6d0NJSO0nJvUCwDgbNVI8U0TkSASlepX+Xfsjn4KRqZpvTxPwI6IxttKP?= =?utf-8?q?bL2MjeUPTWaQvnp9VKBiml4lmaq80XiWY+1F19PLA4KmvByhJd2bNZmg7y7rTSzxZ?= =?utf-8?q?y8i/M2a+73murxQ1Ra9ptIdjw5JpH07+HZslzEO0ovcDQwRn/BrfQjHm6nyzN/ymv?= =?utf-8?q?CTywEL51HJzcUayzeqNm4J2ppgpxepNZIo990sm03DuvlEVZiyfFXhnboJKuzdbmA?= =?utf-8?q?jGSDEE0rR6n5GW6SlXrgQjzw5rAjFzk7EcJbBllKwYnKS2IcT7CUxirD5PK4/BM2G?= =?utf-8?q?vKYf5bAxXlWt71EEtTx5Y+apWmsr00uPm39LnuJck2DHg8yA1LF6YqmMd/4mMm55t?= =?utf-8?q?HyM7XSlO1nMS?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e346a209-f7d7-4ef3-e0de-08dcc2aff4fc X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 13:40:16.8789 (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: 4t9oTKWcEC4rJTe0LGygyPqP9g2+pAX4UPL7fi1vGZ8yRIJSEu+DwrZCL41h+SlToW99BjJeY+3mfm3yxCzeFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10126 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240822_064021_303508_2C802015 X-CRM114-Status: GOOD ( 13.46 ) 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 Current mailbox is blocking by default, but there are cases where we don't need to wait for a response. Linux just needs to send data to the remote processor, so let's allow tx_block mode to be set (true/false) depending on usecase. No functional changes. Signed-off-by: Peng Fan Reviewed-by: Daniel Baluta --- drivers/remoteproc/imx_rproc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 9744b004bd77..22677f581067 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -90,7 +90,7 @@ struct imx_rproc_mem { #define ATT_CORE_MASK 0xffff #define ATT_CORE(I) BIT((I)) -static int imx_rproc_xtr_mbox_init(struct rproc *rproc); +static int imx_rproc_xtr_mbox_init(struct rproc *rproc, bool tx_block); static void imx_rproc_free_mbox(struct rproc *rproc); struct imx_rproc { @@ -369,7 +369,7 @@ static int imx_rproc_start(struct rproc *rproc) struct arm_smccc_res res; int ret; - ret = imx_rproc_xtr_mbox_init(rproc); + ret = imx_rproc_xtr_mbox_init(rproc, true); if (ret) return ret; @@ -629,7 +629,7 @@ static void imx_rproc_kick(struct rproc *rproc, int vqid) static int imx_rproc_attach(struct rproc *rproc) { - return imx_rproc_xtr_mbox_init(rproc); + return imx_rproc_xtr_mbox_init(rproc, true); } static int imx_rproc_detach(struct rproc *rproc) @@ -794,7 +794,7 @@ static void imx_rproc_rx_callback(struct mbox_client *cl, void *msg) queue_work(priv->workqueue, &priv->rproc_work); } -static int imx_rproc_xtr_mbox_init(struct rproc *rproc) +static int imx_rproc_xtr_mbox_init(struct rproc *rproc, bool tx_block) { struct imx_rproc *priv = rproc->priv; struct device *dev = priv->dev; @@ -817,7 +817,7 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc) cl = &priv->cl; cl->dev = dev; - cl->tx_block = true; + cl->tx_block = tx_block; cl->tx_tout = 100; cl->knows_txdone = false; cl->rx_callback = imx_rproc_rx_callback; @@ -1083,7 +1083,7 @@ static int imx_rproc_probe(struct platform_device *pdev) INIT_WORK(&priv->rproc_work, imx_rproc_vq_work); - ret = imx_rproc_xtr_mbox_init(rproc); + ret = imx_rproc_xtr_mbox_init(rproc, true); if (ret) goto err_put_wkq;