From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73075349CC1 for ; Wed, 1 Jul 2026 21:43:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782942186; cv=none; b=JECFr/I7KyarfmVxMQdrKBhG+bHaELw6O8ePdIKEI0CtMPurQlyg19mTBMxi6bxP8eLpGWI08iNI0vDHz8DosIUrpM3I/wJik0D94HEcBOQR9fRKwaFv1MbFBnyQy3nFwEhr7aBcNEwxNX+vWDDCjgEpWNc7ZzR6ySzJDFFjXEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782942186; c=relaxed/simple; bh=8V/Zm+ngQLvrsbOOY5rLImhLMrF+DRB98ur5wXW8LMg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZaPBTARsfpLTHcI7wqME3HyxWz2J/1uBRvYfEMeD0DfWlOAbojum7mFqFXtOvL2A3t3ByJFA/PIJ8RzHMTpiK/+r7ts9HScVQNxIIUQ2KsfXnJCu7Gd1MdPNZ2/aowZDn2D/IYvKt2nys3x16eESu5n1iQD9oBcG5GRmjh3ArAc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XZmWjkPn; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XZmWjkPn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E3321F000E9; Wed, 1 Jul 2026 21:42:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782942185; bh=vFwcgrMP51FdJfNWjgX6FQceDh7Uf7KWJsHpwmCExdo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=XZmWjkPnZK3fkjIVsPg1IyLY5CsScRyUNdbZxQFLSIwscN+BYy+ERMpHK2ogQiuBz JeYxxPyvX+ovMYt6mij4IwrooXgbS3Hg7PYqCaRQVtdb+38SfNOWea/tNy7ipj9zTo de4wi6l5s5PfEFyoadMxTBRhuMOR60ag5jXs0CERFb8vZ5j77huBoi5sqWVSj2PH48 UyIgW1Cts26zju64SNMXOLPN1dHnJ+LaZRTnLbREK9htdd5OnaDquZPMILdjsKthZt sXSaiHzHi/naigFUi+gLwh591pzvhUdUS/MwFSulvWA7aOJUWGIbJfoBcwOg/q6xJ5 pz7IRow2H3DRQ== Date: Wed, 1 Jul 2026 22:42:50 +0100 From: Lee Jones To: Pengpeng Hou Cc: Fabrice Gasnier , Maxime Coquelin , Alexandre Torgue , 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 Message-ID: <20260701214250.GD2108533@google.com> References: <20260615063042.36397-1-pengpeng@iscas.ac.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260615063042.36397-1-pengpeng@iscas.ac.cn> On Mon, 15 Jun 2026, Pengpeng Hou wrote: > stm32_timers_probe() releases the timer DMA resources when > of_platform_populate() fails, but it does not depopulate any child > devices that were created before the failure. > > The remove path explicitly depopulates child devices before releasing > DMA resources to avoid races with children using DMA. Apply the same > ordering on the populate failure path. > > Signed-off-by: Pengpeng Hou > --- > drivers/mfd/stm32-timers.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mfd/stm32-timers.c b/drivers/mfd/stm32-timers.c > index b3dbc02aaf79..1f0aecae83a5 100644 > --- a/drivers/mfd/stm32-timers.c > +++ b/drivers/mfd/stm32-timers.c > @@ -329,8 +329,10 @@ static int stm32_timers_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, ddata); > > ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); > - if (ret) > + if (ret) { > + of_platform_depopulate(&pdev->dev); It's strange to see an un-winder inside the error handling of its original call. We're used to seeing them called only on success during a subsequent step. Wouldn't devm_of_platform_populate() be better here instead? > stm32_timers_dma_remove(dev, ddata); > + } > > return ret; > } > -- > 2.50.1 (Apple Git-155) > -- Lee Jones