Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: Lee Jones <lee@kernel.org>, Krzysztof Kozlowski <krzk@kernel.org>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Christophe Kerello <christophe.kerello@foss.st.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>
Cc: <stable@vger.kernel.org>
Subject: Re: [PATCH 3/8] memory: stm32_omm: Depopulate child devices before disabling clocks
Date: Wed, 2 Dec 2026 14:54:17 +0100	[thread overview]
Message-ID: <d40fec79-94b3-4afe-bc3c-1a66434fda63@foss.st.com> (raw)
In-Reply-To: <a7f884f8ebfd8b80acfdb14ed77ee8c1d652bc84.1796203994.git.lee@kernel.org>



On 12/2/26 10:33, Lee Jones wrote:
> 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 <lee@kernel.org>
> ---
>  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);
>  }

Hi Lee

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

  reply	other threads:[~2026-12-02 13:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1796203994.git.lee@kernel.org>
2026-12-02  9:33 ` [PATCH 1/8] memory: atmel-ebi: Use non-devm allocations for of_update_property() Lee Jones
2026-12-02  9:33 ` [PATCH 2/8] memory: tegra210-emc: Stop timers on suspend and prevent training re-arm Lee Jones
2026-12-02  9:33 ` [PATCH 3/8] memory: stm32_omm: Depopulate child devices before disabling clocks Lee Jones
2026-12-02 13:54   ` Patrice CHOTARD [this message]
2026-12-02 15:59     ` Lee Jones
2026-12-02  9:33 ` [PATCH 4/8] memory: stm32_omm: Fix double FIELD_PREP() and clamp for REQ2ACK Lee Jones
2026-12-02 14:08   ` Patrice CHOTARD
2026-12-02  9:33 ` [PATCH 5/8] memory: stm32_omm: Avoid division by zero in req2ack calculation Lee Jones
2026-12-02 14:17   ` Patrice CHOTARD
2026-12-02  9:33 ` [PATCH 6/8] memory: stm32_omm: Shift and mask AMCR value in stm32_omm_set_amcr() Lee Jones
2026-12-02 14:33   ` Patrice CHOTARD
2026-12-02  9:33 ` [PATCH 7/8] memory: emif: Avoid __fls(0) and underflow in of_get_ddr_info() Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d40fec79-94b3-4afe-bc3c-1a66434fda63@foss.st.com \
    --to=patrice.chotard@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=christophe.kerello@foss.st.com \
    --cc=krzk@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox