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=1796122934; b=HsbvOXDpYtJoy+qLbv0iW+Z/fHY4Ob46GYEquvcje/sWi6eixKFVYaTOFZNSflqgPPG4 BIFh0mOrhlKe9Io0Z/Z/P8+IF2+3Qmmhwd+5JkLKDVLt2zNnq5LrPneKUYJa4req0+w0r FFGsLBARpvUJEGIov1PxE/FyEmJGESIwphgqr3zFLFC21j3WLN8sltk6195immvmmmn7B 2OlcA8qASpfWa4fdAOZ7c/+uFs9v0zcIbtGZtluWQAF7bR01xDZbAx17pTRAu2XWIOVMi 2nJ/8lyjnj8gTy87hYnKmkP6Lmn2Z0R/8Ia+wwjP/dBvp+KHN9krgsjnRkz+jfjorbA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796122934; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=PPRHCjxGoQB2yb8y4nv2QNZpsdXXKSfaEG481fE7BmI=; b=NToK9fFlSdsVUsoZHXv9eoJm5/tROglYzxemm04XRV6LjVe8d06BeYVn4pc/vqQ3BstS l7zvTxFNAVzycPnuT9Ogm88hbtUVMADU2t0qJteybnUPfqOizbop+RMOetnsTWo5Z2G+c SmGTPl+5cyunL0vG/gFv0h39x5C8DjsBrL+IuAcxUZVlVkWoVN98/NJZm0ikKR9YdLerE SndaXHUQ7i2r+bY7qa+gGA5m/sz4oimqmIznVQmSjXwhUvgzxAh2WlAXMeAH1Am/D/U75 tQ2LGvxa0zZG9gSDuE9iP5UabeQA7MhmlhYj6BXPWjSs1mzbNePxwbTpVUFe9rt5D5g== 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=RpbBc4i0; 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 12DF4606A31A; Tue, 1 Dec 2026 11:02:13 +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=RpbBc4i0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 099A71F00893; Tue, 1 Dec 2026 11:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796122933; bh=PPRHCjxGoQB2yb8y4nv2QNZpsdXXKSfaEG481fE7BmI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=RpbBc4i0Crq201IHJs/9LH0xiOwgKaf0ada2j2X0BDvrOB7P6xsUJZoLGgWgUP0fC uFqGXzYWQsQQRnZx6pM6KknyNBP0LmPz7QyiKWQ63WtnGQPeq6bpjUk5Yz1g3cbN9w MfLvYuO6uz0WaDBlVtSE5Pvk5uep/M9Xdd3Ty4OfTyBGBHV9j9UM0WMZUZAp1cntIT dlP3NhjGXitQ04E9VW5LvBIzq4G9yl//Am8zD01PWyAwVtdbnxDsvLKO3mBVm3OgkP qs1c6g6JQC4SOK14OThJ589bftWK/nU2vUuhtnKU10IArDQA38LbbbTOkPHQ5/hUHD pSTzXcHG2EwSA== Date: Tue, 1 Dec 2026 11:02:09 +0000 From: Lee Jones To: Doug Anderson Cc: Liam Girdwood , Mark Brown , Oleksij Rempel , =?iso-8859-1?Q?Andr=E9?= Draszik , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/8] regulator: core: Defer supply cleanup and unregister event forwarding on error Message-ID: <20261201110209.GI90630@joneslee-mac.roam.internal> References: <20261127183624.3341010-1-lee@kernel.org> <20261127183624.3341010-2-lee@kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, 30 Nov 2026, Doug Anderson wrote: > Hi, > > On Fri, Nov 27, 2026 at 10:36 AM Lee Jones wrote: > > > > When enabling rdev->supply fails in set_machine_constraints(), the error > > path calls _regulator_put(rdev->supply) without holding > > regulator_list_mutex and clears rdev->supply to NULL. Neither > > regulator_register() nor regulator_resolve_supply() holds > > regulator_list_mutex here, and when called from > > regulator_resolve_supply() under regulator_lock_dependent(), clearing > > rdev->supply prevents regulator_unlock_dependent() from unlocking the > > supply chain and skips unregister_regulator_event_forwarding(). > > > > In addition, the wash error label in regulator_register() releases > > rdev->supply and drops the device reference without calling > > unregister_regulator_event_forwarding(), leaving a dangling notifier on > > the supply chain after rdev is freed. > > Are these two fixes somehow related to each other? As far as I can > tell, these are two independent fixes and really shouldn't be in the > same patch. > > My AI seems to agree. It suggests: > > > Splitting into two commits (first fixing wash: with Fixes: 433e294c3c5b, then fixing set_machine_constraints() with Fixes: 05f224ca6693 and Fixes: 8d38423d9dea) would let each fix target its relevant stable branches cleanly without introducing an intermediate regression. > > I'll also note that as of 05f224ca6693, the code looked pretty > different. I guess that commit still contained a bug, but the fix will > look different from the fix on ToT. > > > FWIW, my AI also noted a nit: > > After removing the call in set_machine_constraints(), regulator_put() > (:2696) is the sole remaining caller of _regulator_put() (:2665), so > static void _regulator_put(struct regulator *regulator); at :118 is > now unused. Fine to leave as-is to keep a stable fix minimal, or drop > if doing a cleanup. Thanks Doug (and Doug's AI) - will fix. -- Lee Jones