From patchwork Fri Jul 12 08:34: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: 13731394 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 947FEC3DA50 for ; Fri, 12 Jul 2024 08:28:12 +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=2oWHKCUVfvrNAzxd6DC9qQ+keZBb/vPFAM96MmrhN6M=; b=TxPEx4df7/Z6OOBaYfUUr9yPFz QYk7wWxz916AIt65JqTovze0YIgd6TIV0rgBozAzVm28CgEQRKFkZ0idYvSZzunREK/R2uwFopttW e9KGPs2xnZYaX2hDEIiHZ9nskNYjtymBslRA5jqP4yNf/8vIs6/D/RLBxZc99J0CaOS+TUk8TKJUK n/IHelSOMerkh99li2dA/Al61qYHUFL/lj44gD88IadMJJWOkpiCoSoQyDklVNU3alLfxfTBIi36j yoW997K3o4U1RsYDkAVUOxk0rW7BoGVoDhmdYk9nIcsIpyCxeM/eMifPKJLin9AfGrbKCaQ2F1ZJH j4euHK+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSBdG-0000000GtUv-1uzE; Fri, 12 Jul 2024 08:27:58 +0000 Received: from mail-northeuropeazlp170120003.outbound.protection.outlook.com ([2a01:111:f403:c200::3] helo=DU2PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSBbb-0000000Gsvt-2WTn for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 08:26:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U5HKPn7Lc1PEwsRK0dECs1T0/9qCWQe6SsT1ObyTwE+oHyCGGoAe+wmw2iZY0N/Y1fNFJyTKBiKcmXBnIWuikc1gkX7RwLGP+0ryimtvo2v/4sFMV1ZtSSI8JYsvq0fjIr901NaeWQ7RrCocXWyGzvctMlliJ/22akrrlSAAl5ijc6X/G9fbRQMmTmThEllRYuaO5DN0ifGmuVHIyR5eUWP0IBHZEs54XqpuzF9WsouGFz72Ka5OxjUzZBNPoVtEv0uC8CvpnO2IaMD89MsbpI+L27mLDgiMZdYJ6L6TAEi53M8U+n5wR9OX+WIP7/unLfwlaMgUF5/UONhWhebjAQ== 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=2oWHKCUVfvrNAzxd6DC9qQ+keZBb/vPFAM96MmrhN6M=; b=XaPDaKBrlGhQhZIiOz2sU92hNDaXoKitU4sllqa32fcU/mDro0DWgi2B1M1jweNXZMC6p5NDp92tEtataGYCD4NgeFUhxvaiz/5Uit+i5bJqiOwhdsLuCXtX8eC0EfFOhA+I2nchLapGNhBYkxic1wE190XXV81ZbdHj0Tzb6SPmm7zA0pCcv6gf4hl5UtOGUNcVoSjS338iksebnUTgpvKTWHUEIweLhHXorkDYa+uwzCbf83Dc3W9p9hjo/eB6I2UPxRKpNezISrE4iZAWCr7v7jGdcp60ECkuOLwsFqcudRc3gEbSlQonugDdRlDBztbnTQGlkKId1ASKANWxAA== 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=2oWHKCUVfvrNAzxd6DC9qQ+keZBb/vPFAM96MmrhN6M=; b=gKMpYrBJ8SAWNlUZvNs21utDcOC3eRQ2YwKnAohXI0d+TJvWDhOFJXvWSL1Z3oP/TiSsowX1XRgu6XHP5AvxME0/M67qw191v0hQsFeXdHyz/856h9MO8wE64K8hCuY96eu8BaB3Q6IrxLapEq/NLSz46sj1BpbNBtuDBEVvYrk= 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 DU2PR04MB8709.eurprd04.prod.outlook.com (2603:10a6:10:2dc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.22; Fri, 12 Jul 2024 08:26:09 +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.7762.020; Fri, 12 Jul 2024 08:26:09 +0000 From: "Peng Fan (OSS)" Date: Fri, 12 Jul 2024 16:34:56 +0800 Subject: [PATCH 3/6] remoteproc: imx_rproc: initialize workqueue earlier Message-Id: <20240712-imx_rproc-v1-3-7bcf6732d328@nxp.com> References: <20240712-imx_rproc-v1-0-7bcf6732d328@nxp.com> In-Reply-To: <20240712-imx_rproc-v1-0-7bcf6732d328@nxp.com> To: Bjorn Andersson , Mathieu Poirier , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Richard Zhu 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.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720773307; l=1089; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=30BtbG0V4zrqqgPMiZOOg2E1J67bBTLgehXqosatdF4=; b=sPaOPV7FaSLgnsmRzqAItmpVuWs1UFpyRjcdsJmJqR2xWS3+WdjW02OMOo42y2XHPZ35WUGep UPBQhkoHycUA8tS0Y0yyPKyZSNFqBPrzjrQ8uuZ6/zkFSgoOL36fq9L X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2P153CA0013.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::12) 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_|DU2PR04MB8709:EE_ X-MS-Office365-Filtering-Correlation-Id: c872be37-318a-4c30-84a4-08dca24c4816 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|7416014|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?5WiLC7AXO74F8dnvES7zWPRBNZET3dI?= =?utf-8?q?Av21CdN3f/Q7RdLXnn/1tmuPZ+ZJDi8LMA0/DW7EC6NLeErZ9FF4vKCEMCakBUqDe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f-8?q?UBv4H+jAbZjMTUcy9uPhpZovKzxbbrKy9WN//mFm8PcRXL5Gy8q1IFW/ajJYbQ5fL?= =?utf-8?q?OJLkqwIJ0UwqxBomlh7M7eN9DJB0iwQh2gpMQ8tHbgViK0OxLjTk9azsvEjaBHvmv?= =?utf-8?q?V7HTYS3aiMHh+sLAg50IZj3C4MBS1C3voL2InaBbKqrpXYzVD/Tr/R5ujkXGVQBvy?= =?utf-8?q?MCPFZfoqIjpsjjylrxoS4eGQuQ7XJN6r9dY9qW+u0d4W+HOCXsIoQpDV1UzEbkRI1?= =?utf-8?q?9N6+4tQBfcN+FpfcBdGaOzNPMQiXVxrafMd4yr1TcipVm5Iawwf07bkiEUlCQD/4+?= =?utf-8?q?rBuVoXClLJj3xlw1M93+VX+LeYYsSpwHCFGZOt6UEcEpPg+mcDLVUOh4e1ULYBc8+?= =?utf-8?q?uXGzpHi5EQzKa6RCzo/XRf4TdnYLKZYkfQ=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)(7416014)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?iBwmtSWc8ssVK9UtgJdBovbyHOft?= =?utf-8?q?9aIvS199x81IW/uuKLCK9Vqc3jC0Z2x9+8k9IbyETTEsRuPZgIjusg5llH7mawhx6?= =?utf-8?q?SL8plDbl3gFZue49p1c1M9uRaw/nVIlynQyBXcK9+AM0vxiGJCL4cgQb4IvXBDX7Y?= =?utf-8?q?k0TIBt5WZGF3bFmcnnBvFgYVca8Mk7y5kVMKTR5ulYfskel5NN6dfoCWVJ2HvaD2r?= =?utf-8?q?tFRINcbOzRgQm2nKmPN3Mumb/G6XIpAY9WGU5RL3WEUwZ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y+bNKM3C9xcbPBm96sFRWjqTZyGaOlNuh4Kr?= =?utf-8?q?+SgMG00jOcB5mCOmI9UA3yGrpRjUixxlGNTlH12gMrRp7kqpiZKqzrqjTJVNsBuAg?= =?utf-8?q?vkgmQxVFI33KeNC09QZdxdbT9zy/2ZM2Rd/JtgdVdxxTlFpADJApVoHy5RCm2Lm3+?= =?utf-8?q?r9VK9bRnVP38y8VT18HTuzYk5jEipEoJh0gFjTucEwSTNypGMa8ug0nfxW1K5p8IX?= =?utf-8?q?QCRkRbiucrGg0BFpS3R02xYYCxhWzUromfQYijCJTv4BILDDlAHpisoyPMupJFbDP?= =?utf-8?q?+r3ubve1MXb7Cp9ySFAH/6nSqGXyOaG73fIeQfpkYdk8QnYU/yOzzDqR9eCuS69Sd?= =?utf-8?q?YdFoFYrifA5n+GZZCrs1HwEStQ/vI73QLm3KXHIc/vz9DUdI+jeCpfdr7KBAeibHu?= =?utf-8?q?MNfKySakLXyw?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c872be37-318a-4c30-84a4-08dca24c4816 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 08:26:09.1283 (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: i/3FsvXXlpKiQ/trTpOcFR4nl3xo863+Q3hCN40j8EtqeFZbOykqanksKYZWDsDXTTsSzcC8QYzTeRWJSrSdUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8709 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_012615_705051_90302F29 X-CRM114-Status: GOOD ( 10.76 ) 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 Initialize workqueue before requesting mailbox channel, otherwise if mailbox interrupt comes before workqueue ready, the imx_rproc_rx_callback will trigger issue. Reviewed-by: Richard Zhu Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 48c48b53a3aa..9e99bb27c033 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -1087,6 +1087,8 @@ static int imx_rproc_probe(struct platform_device *pdev) return -ENOMEM; } + INIT_WORK(&priv->rproc_work, imx_rproc_vq_work); + ret = imx_rproc_xtr_mbox_init(rproc); if (ret) goto err_put_wkq; @@ -1105,8 +1107,6 @@ static int imx_rproc_probe(struct platform_device *pdev) if (ret) goto err_put_scu; - INIT_WORK(&priv->rproc_work, imx_rproc_vq_work); - if (rproc->state != RPROC_DETACHED) rproc->auto_boot = of_property_read_bool(np, "fsl,auto-boot");