From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796204104; b=qzphyGPE5oWHvT4krumFXmVGAhndkTS3udEBpuUTVhe0ylsO/kH0Lpx1ZmzwbrCmLELF tJYaBFy61H2IQcOylNZvMDn0T7ro1HrKVP99u8tAhizTePIEf7nuancS01t5SmXmjU6Cu A9/qCB3ygcu0Xd8bc7vtKMnPL28yCYT0cnPUQr8uVn+dR5U8/NQMEg7YWv1mKg0QnwPka /QfeWeEF1q4ogz49o8LVje5Bqi1PyexSn+BWbRGpcFq+2nr5I0aSr6D82P2yEZPaUzrqm /uel18LoZbcDGVa6tF49/T/uujXB0xbqByYy/PCAhb1CXQkRIL7Qn6TXILReRbaqM9A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796204104; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=NCLiS9LgUVdG9FAruWxYKr9aVsT1S5OhT1sg7IP05kQ=; b=giWhsl+aQhkbx4qJBmui6u2HSKc/KcyOoaI5V2Y91ffbDnXG9P8VbfXVLMY3UxMoXLr3 u19Ux0LmJDowU6aybN5LLh877QaMMfm13EOQfL/dE/EW4osNHbjzCMvPIRwjuaYNdghS9 bKy+BBqlQmeCOfWkBNWFhwMirk02kgtVopCLeJH6exNLudmYei5wStE0eBiz3ZHXCZ0H5 hFhUuNECocHRbo9NtHkGaZwIQsyDvZ6l49mMpuMBO034Xo6UPoWgldvALJVCqGdbPfTBD vmCj8Ahl9H+QlQhZ0nsmVbPeYac6R2zjfKpK/XLvdP96kpC+ULm8n11p99I41wYpaLQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="KoTdGgF/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3DA0606A334; Wed, 2 Dec 2026 09:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KoTdGgF/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4C8E1F000C1; Wed, 2 Dec 2026 09:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796204103; bh=NCLiS9LgUVdG9FAruWxYKr9aVsT1S5OhT1sg7IP05kQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KoTdGgF//kUIgCr+R9C3ri7blQvU/2ek9nCSBz2MXoGuYckJarnrQnDXXBitjP0PV dSVD7zGlO9787VCCMRsqWfaHOGbEduvl6zvz95A3vpEfz3J+cM3hTILQuG2aDDjOaS XPfJ3xdXgA0mvdoRmxyfOjtJMR62C9O7+z8WN34huAcdLDZCXo9DAKJ/Tgv5wt+KGE S52BX/nU+K1yVUZIuO0gFt2ZTRmigfPPRWiyZR1qAYyCo2pKdRCk8UUotkdQmT+twb jUGOtm7Ow/s724Oga/15ITpOyEcvDpyxLMO4UrxE7HdJq8R5P6gCPXPxwQyLAYXweT 91574pVXQ2D9Q== From: Lee Jones To: lee@kernel.org, Patrice Chotard , Krzysztof Kozlowski , Maxime Coquelin , Alexandre Torgue , Christophe Kerello , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Cc: stable@vger.kernel.org Subject: [PATCH 3/8] memory: stm32_omm: Depopulate child devices before disabling clocks Date: Wed, 2 Dec 2026 09:33:50 +0000 Message-ID: X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog In-Reply-To: References: 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 Content-Transfer-Encoding: 8bit stm32_omm_probe() registers child OSPI devices via devm_of_platform_populate(), whose devres cleanup runs after stm32_omm_remove() returns. When CR_MUXEN is set, stm32_omm_remove() disables the OSPI child clocks while the child drivers are still bound and may access their hardware during removal. Populate child devices with of_platform_populate() and explicitly call of_platform_depopulate() on partial population failure and at the start of stm32_omm_remove() before disabling the child clocks. Fixes: 8181d061dcff ("memory: Add STM32 Octo Memory Manager driver") Closes: https://sashiko.dev/#/bug/linux-24c34b63-4c84-4d67-8ee1-eb7964079c44 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/memory/stm32_omm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/memory/stm32_omm.c b/drivers/memory/stm32_omm.c index 3599683ab04a..5ff63870421f 100644 --- a/drivers/memory/stm32_omm.c +++ b/drivers/memory/stm32_omm.c @@ -368,8 +368,9 @@ static int stm32_omm_probe(struct platform_device *pdev) return ret; } - ret = devm_of_platform_populate(dev); + ret = of_platform_populate(dev->of_node, NULL, NULL, dev); if (ret) { + of_platform_depopulate(dev); if (omm->cr & CR_MUXEN) stm32_omm_toggle_child_clock(&pdev->dev, false); @@ -383,6 +384,8 @@ static void stm32_omm_remove(struct platform_device *pdev) { struct stm32_omm *omm = platform_get_drvdata(pdev); + of_platform_depopulate(&pdev->dev); + if (omm->cr & CR_MUXEN) stm32_omm_toggle_child_clock(&pdev->dev, false); } -- 2.56.1.911.g883d8bcb20-goog