Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
To: Lee Jones <lee@kernel.org>
Cc: Pengpeng Hou <pengpeng@iscas.ac.cn>,
	Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: stm32-timers: depopulate child devices on populate failure
Date: Fri,  3 Jul 2026 14:50:16 +0800	[thread overview]
Message-ID: <20260703065016.97181-1-pengpeng@iscas.ac.cn> (raw)
In-Reply-To: <20260701214250.GD2108533@google.com>

Hi Lee,

Thanks for taking a look.

I checked devm_of_platform_populate(), but I don't think it covers this
particular failure path on its own.

devm_of_platform_populate() only installs the devres cleanup after
of_platform_populate() has returned success.  If of_platform_populate()
returns an error after creating some earlier children, the helper just
frees its devres record and those partial children are not depopulated.

For stm32-timers, I think we still need the explicit ordering used by
remove: depopulate children before stm32_timers_dma_remove().  The child
drivers get the parent drvdata, and the PWM child can call the parent
stm32_timers_dma_burst_read() helper, so releasing the parent DMA
channels while partially-created children remain would keep the same
ordering problem the remove path avoids.

I agree the inline unwind is not the clearest form.  I can send a v2
using a normal goto unwind label and a short comment explaining the
partial-populate case, unless you prefer a different shape.

Thanks,
Pengpeng



  reply	other threads:[~2026-07-03  6:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15  6:30 [PATCH] mfd: stm32-timers: depopulate child devices on populate failure Pengpeng Hou
2026-07-01 21:42 ` Lee Jones
2026-07-03  6:50   ` Pengpeng Hou [this message]
2026-07-03  7:47     ` 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=20260703065016.97181-1-pengpeng@iscas.ac.cn \
    --to=pengpeng@iscas.ac.cn \
    --cc=alexandre.torgue@foss.st.com \
    --cc=fabrice.gasnier@foss.st.com \
    --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 \
    /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