From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=148.163.154.28 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796325752; b=DYImsTSMGmsSTQSEQn9NKXA8pS4Nr3cZdtPBD3AkBu9m/ngfFo23NjuUIOl/mmme8B2R MvafLjTmDMNUjjeib5AzD2lUBOmAgXT3BpcvUEDkth8a+n6Mks5DRZMbiW757v/Dfd/5s 67yfEhZgpU9q9HTkAZGBcTGIj4ZLh4CnQKvorFLTda1URljbuUJ1sjbNJvdS2KQWtdA8+ /3K2mAnXsySZR2a9Ee3bfucrGgE4lmc0rBOfukOqou5fxrxfoULi3u6PMcuIGP3eDanTt FxIX9JLRiLEe7WWU4Nbo281P+w8BXEKCQs4vdHPIZqQ28f+rpSG1hD5axegkjpxg5Gw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796325752; h=DMARC-Filter:Received:DKIM-Signature:Received:DKIM-Signature: Received:Received:X-MS-Exchange-Authentication-Results:Received-SPF: Received:Received:Received:Received:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:CC:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding: X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-OriginatorOrg:X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped: X-Proofpoint-Spam-Details-Enc:X-Authority-Analysis:X-Proofpoint-GUID: X-Proofpoint-Spam-Info:X-Proofpoint-ORIG-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=RJk+NJtkx1gY67xgdGZ7ADRj6TyHecRuCAm9stjKajk=; b=VWglFP+87wR2WPOBTxiUdzVTcCOkGcn46It2FbNJWdIDLqt2eVjsqMDIH8zfHvp0BnDt kFcxg8GMOpo7Bw5+Fx/QgKaV0qx37nFdKwwWRPY5lQV1yYtBz5O+c9Di+UrswSElHjZXK ibPhuvMC73nE4cbNJJWNwbu7KGytTaMa3WW3woirqCMzuxfkq3OBkzpn98qAPd8k4OD8m b7Gps4G7wlKbvO5spAUylr7BUObEa2khh/eEgEMG0Wh0AOOcjoNYIO03YdBIA/PXkDKD7 IGiTIFQ0XDB5MPqiPYJ707fKdD57dXzcdjZbIDrJvhEbcvwfsHuo3OKEYzHjoRKuP/w== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=proofpoint-05-2026 header.b=K7gTuZkT; dkim=pass header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-ticloud-onmicrosoft-com header.b=Ix33l41j; arc=pass header.oldest-pass=0 smtp.remote-ip=148.163.154.28 Received: from mx0b-0002e601.pphosted.com (mx0b-0002e601.pphosted.com [148.163.154.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D2E9606A682; Thu, 3 Dec 2026 19:22:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2D2E9606A682 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=proofpoint-05-2026 header.b=K7gTuZkT; dkim=pass (1024-bit key) header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-ticloud-onmicrosoft-com header.b=Ix33l41j Received: from pps.filterd (m0374955.ppops.net [127.0.0.1]) by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3JKG8v2917388; Thu, 3 Dec 2026 13:22:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= proofpoint-05-2026; bh=RJk+NJtkx1gY67xgdGZ7ADRj6TyHecRuCAm9stjKa jk=; b=K7gTuZkTwR6swfNzDqZmHnaI6VDzxyMS/XvN8ApaCeKWJWNk0giP1/W47 hJxhQeGzqVtOwGQxhitZ4m7S6eq3Q6KykRimaxFyiD9WvLM5o6P7wZZpL8R2/N0h Tu+O5N1iM1cM1dpzn0BrbaWgFLunvJ3uPdcz4Ghq5CYP/tci2ko8Rj9nApXktmqo T4zb6gZDFnTPw7ndQ/9CjAVO7Dv3O2L1qFprP6GUVWcc3KwzlQfZPf2C1XDWDzPu 4DappBMWpobKJI7sbCEFyYY1mlADCd8HY0B0K5x2hXPB8Bd8H0dzmnBmChaz82Yu Yghc/7Dzi9W1q04oG+Zf/lMC3gdhg== Received: from sn4pr2101cu001.outbound.protection.outlook.com (mail-southcentralusazon11012055.outbound.protection.outlook.com [40.93.195.55]) by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4jb6c2311h-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 13:22:03 -0600 (CST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z2sv9rckS989byAkRvTc0jP6pdhG7adImNQHpudbrdmnPFRC1vjdaGdZwYjYVS0+h7Gcp0R9UD3nW+TIPR+3j2P1jTX8EesDezZaSDIAhYoqRtUQP3qXcS+YCeP5Ohd/C7E2UdId8lEgoiDCAqVD/DUxc96RbO64wcSQSx29Dthnen8hPn6sG0DI4mhaSUzUIZnD1rSjleNhW1uD+7e19Eli7bsXM4oG9CigZnMerozFAs29CQ+pOFBMdva2I7CbovP4ujvbaZKSKOmOWGcoCX69ZlAQeq0CqRNeLlnqrb6KOxjvmHTDtrqIaxnJFBBxfai9qkVWKnbXsQwkepK/Mg== 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=RJk+NJtkx1gY67xgdGZ7ADRj6TyHecRuCAm9stjKajk=; b=hvI7m9RLBoh218HV73bbU1RgW0YcjBs8PoC4BiJ/EQs75iucF8D4aa6v/cNSuy35v6ZL3da4qZOAvurxW/aEAd/n4TsiHaerJOeRVAY/S5BUGPik8Q+ZVsQfPJ2Qw3BRikdfLNAoy3EXQNNpbXoPuK1BInngN1eXtYUiI0M+UL0g3tawcs2f2iyFgzwoF1NJkeT8Dot+MQykuGo4mhdwe/P87fv+e2YW4plllgpfPNyOD2wCI6HvQlInJSHJW27VU0DbTZ2gfrUQquztzFfmjlcatLWkEcbjK6TFPxTpxtfhTSKtNaqhq084UOIsn4tVIJZzMiRPcJbuNXTym1Bydg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ticloud.onmicrosoft.com; s=selector1-ticloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RJk+NJtkx1gY67xgdGZ7ADRj6TyHecRuCAm9stjKajk=; b=Ix33l41jr2wABbqFof0tvE6eDcXFccqqpayUOZCN+IYqyYPx5NE0atSd3ehRYj0qlB7DbhryAyQpqhpMca60Sb6UgWIGRJZfOfCfxjajD4PPPmPa0ynoaYFdyNqc8mP1IO0wpwXSXsvnNrL5zZ15NCVFgXVt5MEw8Wbh2zwxgQ0= Received: from BN0PR04CA0040.namprd04.prod.outlook.com (2603:10b6:408:e8::15) by LY0PR10MB413736.namprd10.prod.outlook.com (2603:10b6:404:207::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.12; Thu, 3 Dec 2026 19:22:00 +0000 Received: from BN7PEPF000000A2.namprd04.prod.outlook.com (2603:10b6:408:e8:cafe::24) by BN0PR04CA0040.outlook.office365.com (2603:10b6:408:e8::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.12 via Frontend Transport; Thu, 3 Dec 2026 19:22:00 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by BN7PEPF000000A2.mail.protection.outlook.com (10.167.248.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.709.6 via Frontend Transport; Thu, 3 Dec 2026 19:21:59 +0000 Received: from DFLE210.ent.ti.com (10.64.6.68) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Thu, 3 Dec 2026 13:21:05 -0600 Received: from DFLE204.ent.ti.com (10.64.6.62) by DFLE210.ent.ti.com (10.64.6.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Thu, 3 Dec 2026 13:21:05 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE204.ent.ti.com (10.64.6.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45 via Frontend Transport; Thu, 3 Dec 2026 13:21:05 -0600 Received: from [10.249.32.128] ([10.249.32.128]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 6B3JL4mx4170659; Thu, 3 Dec 2026 13:21:04 -0600 Message-ID: <9cded3ed-64a2-4b7a-afd4-8866fa66d1a2@ti.com> Date: Thu, 3 Dec 2026 13:21:04 -0600 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] soc: ti: wkup_m3_ipc: Use the device's own state in remove() To: Nhat Tran CC: , , , , , References: <20261203175232.57338-1-nhat.tranminhk2@gmail.com> Content-Language: en-US From: Andrew Davis In-Reply-To: <20261203175232.57338-1-nhat.tranminhk2@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN7PEPF000000A2:EE_|LY0PR10MB413736:EE_ X-MS-Office365-Filtering-Correlation-Id: d8de7338-3211-4052-e734-08df5172b3c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700016|82310400026|376014|23010399003|22082099003|18002099003|10067099003|56012099006|261028144727099003|261102123227099003|261022075727099003|261022105027099003|261021121427099003|261026140227099003|261009223027099003|4143699003|6133799003|13003099007; X-Microsoft-Antispam-Message-Info: ARNg7AHHiKhviHnJUss0dqBPdVVbq2mhuYp/LTa0evwBmGSmcUPgN9bPiDMvz6fVNMqz4omP4RO/DkXwtJ2+26ng6dHaAKOoS+QNPsL3ilPFFsoTXAU5b8qAIX+0goV3ePi6kHjupV2GDEbFyjUkmS4SUGynnRIsGERpAMx4qTesfXfcWpXi0zKpp24tSMnJEfxjYXGN5az96xqfLoDA7Dq0d0rmatO3UOFnU5ag88iUjC2C1/nU3wXWH2DJghS8Z6v861zV8Dl79aqb/gxTY6SPSWEQ5/nY2iRPklYvnL+aQxtbUltc4P/d47UE2coixTOS+lUh0uEclv2umaxyoJITZp1DgmnTFM7RFa0sNq6+dOI0VImF3ilEKLE3YUC2DKySlp9FM2me1JYnvhIoU0iEA0sN9JsmNSzMqau6GhH4JAZvyJ4hdj116kI7LnQHT0V8uDSmGkJJjkQWjSKEEy1A8l8Vwnct81nBSoITAnX6/Gmo9FQLJkIQQ4uILU6nTWixl5++/ALn8iXyjWiByEXPLgwbIIUpqL1F7ApecNfFh17mM5PwYt/LSw2WB2N4McVta1GeeqREQqzqsePShYg7InpIDXvYtyuyho6dpaKNLcAps2iBok2mKOzKFMI3H6B/3fUDNSfu6dYP1o2X1MA6js7wkE7K4mo5oeHCmh4= X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(1800799024)(36860700016)(82310400026)(376014)(23010399003)(22082099003)(18002099003)(10067099003)(56012099006)(261028144727099003)(261102123227099003)(261022075727099003)(261022105027099003)(261021121427099003)(261026140227099003)(261009223027099003)(4143699003)(6133799003)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MWGly1sXHzeExdYouz8xh+7MBfmpC903pzxtS4KkFZBj2SAZAsaLnXQfd0nkym3bvnHkb/eCzPkdASovLTsRUhXDMBocGq6H3fL43kkfVF9mcfil18oS7vl6XCNMJlCABmXQ+N7tdT+LnUmyp9I8XYJE8CYYqw9A1CcStB4Z8O/TJ7lvPTqKLZncfwSaa/qN1TXt25kK/nQxmMM5IyJBvAH7iHYfhrdCD87v/0OxKR+5zNcCyJWTsB3MEsQxLsJp69fcvfHlvp2xjsWkMKECPLg5dSUibe9igN53jOzgt0ETUCMegex2AfwXKqUQ/2Q9+3noq4vH3XNLUTDEikAqUOfl92gIhA1idJSj8/2SOrkqAffnGRy5RvNLJuhdHSZXeXh7wQlCjshi0G7kykWKPQI2RphPBP9mfmMAhZ/R5Dr3IzBOhF8n7UOtIWMWT7l+ X-Exchange-RoutingPolicyChecked: l09DwqbLWmpkMT8qxPmTHwy2JKfs8g3l34vH/UktjpaS79tld/t6cxLXjLflsbXntAR2pv8FfL+HQEINQgj9vTPT5YfZZEALufzEouyrYPE2Wxf3NN9yPUa/WDR28/x9NwOFXoKTX+dRa1yQGkvFn80x6r3o8zA2PXs2PslMhcaWrk0LYqoRe2sjSEhDgivTGcN7nLyLzeFP1YsC1SFkIkXISNCrHx1ZVivJjPd1n1rmS/ST4//PaHR3XP//l0KyqWMZRKFeL2U8I6CWnr4ChiVtzpg4QjMLz6b1SWW5YvXRl5G+npwG+IyscudoPlgPO0wPisHtAGLbDImYdoAZVQ== X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 19:21:59.2536 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8de7338-3211-4052-e734-08df5172b3c1 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BN7PEPF000000A2.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LY0PR10MB413736 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDA3NyBTYWx0ZWRfX2hCnM7Fzo8Ut O4mIWyg9impbEdRvRC1iwKw8pFYe8D0K82r9t24EFn7HC9uOfE0tlUnoo6wtGunVcMvyJKRIyIR zXPd5Kr88d0TSEGLwNs9VPx9Ze1yBllb+X3ImbIoJF4JdedEOnd23V5mYK2UJQcKMW17jkw4JqU jPm8lkAgvHtzO0UnTNgBlLlzFzh4/FgopnsMSGTxqHH6JzQoaHIkt/GHQU+gDj6PibjTvShi7cR xGdOpzC18m4eAu2RwFSblxQ3TSB00a7obs91i4KW3qDUpjAzS/bFvST5QMlYXrG838zEfW+gIuV SQL0KIF+508Flz/mhZu/U2kw2/fA5fM740uTQ0QlSAQS4kJ1oE7VrfLPfOnUWkkIx88ugMtIxl1 b0zhpkyoEr7JnKQdHobVrj7cC1PgHwuA+g0RG0WOqyYrl7G9y6EyKofRMo4PS9kStObBIzrYFG6 J5xQ2ow/zFip3HvZ3BQ== X-Authority-Analysis: v=2.4 cv=eLOGH3p1 c=1 sm=1 tr=0 ts=6b11c15b cx=c_pps a=QXY2dPTpL+Q+r2h5MCHSUA==:117 a=iwqwCZQqcuTv3JOpYdM7/Q==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=AlMIdn_sM9wA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z8NIEmU8O1QQgoT56wFK:22 a=fPAWb5peG099m5CrUpKH:22 a=VwQbUJbxAAAA:8 a=pGLkceISAAAA:8 a=G_IgGZottqVvb25WiEQA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: jRbZVLLVvk99XhuA1iyqBaR2jxnTdIqj X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDA3NyBTYWx0ZWRfX6XtaIvhTY5e3 1e+7Vz/s2s1nLs3X9MvpyavkYNsYz2Gd5aYHG8nFHueUoHrKPnUeI2lsy+q0QzSsOFco8RCcLbB fG//nFZjCZimmBkd3MfhRA9iVSuvxy0= X-Proofpoint-ORIG-GUID: jRbZVLLVvk99XhuA1iyqBaR2jxnTdIqj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-03_05,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030077 On 12/3/26 11:52 AM, Nhat Tran wrote: > Dear Andrew, > >> Good find, but this fix is incomplete. You'll end up with the same NULL >> dereference in `wkup_m3_ipc_resume()` should we go into suspend before >> firmware is loaded, same for debugfs access before firmware. > > Thanks, you're right. I tested it on v1 and resume crashes too when > the firmware is missing. > >> The core issue is that `m3_ipc_state` being set is used both to signal >> the core is available, and access the device structure in functions that >> can't get it through other means. It would be betterto split these two >> which also solves the issue here. > > I sent v2 with this approach: > https://lore.kernel.org/r/20261203174139.55646-1-nhat.tranminhk2@gmail.com > > I changed a few small things from your diff: > >>> struct wkup_m3_ipc *wkup_m3_ipc_get(void) >>> { >>> - if (m3_ipc_state) >>> + if (m3_ipc_state->available) >>> get_device(m3_ipc_state->dev); > > m3_ipc_state can still be NULL here, e.g. if pm33xx probes before > wkup_m3_ipc. So I kept the NULL check: > > if (m3_ipc_state && m3_ipc_state->available) > >>> void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc) >>> { >>> - if (m3_ipc_state) >>> + if (m3_ipc_state->available) >>> put_device(m3_ipc_state->dev); >>> } > > I left put() as it was. It should drop the reference even if the M3 is > no longer available. Also m3_ipc_state is NULL again after remove(), so > this would crash if pm33xx is removed after wkup_m3_ipc. > >>> @@ -601,7 +601,7 @@ static int wkup_m3_rproc_boot_thread(void *arg) >>> if (ret) >>> dev_err(dev, "rproc_boot failed\n"); >>> else >>> - m3_ipc_state = m3_ipc; >>> + m3_ipc_state->available = true; > > The thread starts before probe sets m3_ipc_state, so I used > m3_ipc->available here instead. > Another option would have been to set m3_ipc_state = m3_ipc; earlier in probe() so that it would be available before this thread could be scheduled. But your v2 using m3_ipc looks fine also. Andrew > Best Regards, > Nhat Tran