From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2587D239099 for ; Mon, 16 Feb 2026 10:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771238503; cv=none; b=p5GGKUxYcgpbW6xPmkIRYTM7uP0FHCaskahP5r3acNcyxm4U9bn7UqY6/2RTGuyY3i1+Cyt036YCuKCEQHS3t4FgES/NJBsaWLxyZeWNWC0zdPq2e9VRxghAY0xQNoYERULmD7lkrdaJFx1wk1qWlASTUXqq0gh/yyg/1WR9gmo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771238503; c=relaxed/simple; bh=gz+Bkg7Hm+LIbTebWklcCLYcJyitSgHeu8WvkTXpLis=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n4QKinopcLPjpmMEgyX9xMd5w2sZGWYoN3kuCgUDc6e/+jXhY0MV1Rv4AneuPxmX8VGeZtIfxYcXczg0ldD7oGXJKt2XfrYLy3o4X4s3mUSbEnjpr/6nshUgm3lrDpmElMN+atlgLBCT/bWvFk6NEbo6rSGcGeAU+NN6XVO8OoQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WD1wYf5U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WD1wYf5U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5AB5C19422; Mon, 16 Feb 2026 10:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771238502; bh=gz+Bkg7Hm+LIbTebWklcCLYcJyitSgHeu8WvkTXpLis=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WD1wYf5Uh42SaCiML58TMhtZiwCODawtKV4wLQdkwvLmAP2uUvqm/iMyWrsN0eqOu TIvV74JufuwbS8j5euvDST3q9cPilJJVtUURlqwx9q5Qq15nsv3p+ZTVJvR7/a6Zul 4ZMhYFNUBYxLUnHxBV798eNkLm3DYwpo0WOnBUJKhJtqvb1bVFl4pjSo8tcgyuqkHV nkGg9QkWGvMq1xCG+L5GeQHV9NjjFIy5oMjzfA6qiaKKQruAErwp1pNrI3zqTJCGdk P/Dvw5Oc9YBzpheUsTO2LNRPawXu6pWdHjjyd5mNiBeJM7VbDAv7sTfw5PUiEe2t8z ktkLuWLkwn1mg== Received: from johan by rho.lan with local (Exim 4.98.2) (envelope-from ) id 1vrw2s-000000000Rz-2iKl; Mon, 16 Feb 2026 11:41:38 +0100 Date: Mon, 16 Feb 2026 11:41:38 +0100 From: Johan Hovold To: Loic Poulain Cc: vkoul@kernel.org, kishon@kernel.org, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, dmitry.baryshkov@oss.qualcomm.com, neil.armstrong@linaro.org, konrad.dybcio@oss.qualcomm.com, Abel Vesa Subject: Re: [PATCH v3 5/5] phy: qcom: snps-femto-v2: Fix possible NULL-deref on early runtime suspend Message-ID: References: <20260205160240.748371-1-loic.poulain@oss.qualcomm.com> <20260205160240.748371-6-loic.poulain@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Feb 13, 2026 at 04:04:43PM +0100, Loic Poulain wrote: > On Fri, Feb 13, 2026 at 11:45 AM Johan Hovold wrote: > > But I'm literally asking for *what* would trigger the suspend in that > > initial window between enable() and forbid() cause I don't see it. > > To be honest, I had not initially looked into the exact cause of the > suspend trigger until now, but here is what is happening. > > The PHY is a supplier of the USB device. A USB device cannot be probed > until all its suppliers are ready. As long as the PHY is not ready, the > device core keeps retrying the probe, which fails with -EPROBE_DEFER. > > At some point the PHY probe finally runs, but the device core may still be > attempting to probe the USB device concurrently. > > Inside __driver_probe_device(), we have: > > ret = really_probe(dev, drv); > pm_request_idle(dev); > > if (dev->parent) > pm_runtime_put(dev->parent); > > pm_runtime_put_suppliers(dev); > return ret; > > This means that whenever a USB probe attempt completes, whether with an > error or not, its suppliers are released via pm_runtime_put_suppliers(). > Releasing suppliers may in turn trigger a runtime suspend. > > In our case, since the PHY is a supplier of the USB device, the USB core > keeps 'looping' in __driver_probe_device() returning -EPROBE_DEFER until > the PHY becomes ready. As a result, pm_runtime_put_suppliers() may run > concurrently with the PHY's probe function. If this happens after > runtime PM has been enabled for the PHY, but before the driver has > forbidden suspend or taken a PM reference, the PHY may end up being > runtime-suspended 'unexpectedly'. Thanks for tracking that down. That's an unexpected side effect of fw_devlink adding runtime pm enabled links (which is the default behaviour since late 2023). Johan