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 7A8751D5CD1 for ; Mon, 16 Feb 2026 10:47:59 +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=1771238879; cv=none; b=HkvfZDX89IWQfVUXU5KAVr2MH4aESkFmVQzEVYdCxkVnTE+S57mo4N6pshneuVUROvOkiSuKRC5m7FbEczwWAp6SMk6jF3j0Vh7ghYXiWjD//J5pn+ztq4PJvF9oaTemDx6+hjuAUKPF3sBXIUrlv2VGzxK7hj0FXIfj3eCDmS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771238879; c=relaxed/simple; bh=FmAZrnEMpRdb4yfHQsqQJsWHQI/ak9gpcuvRuiLF1+M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WacRJiPobiF0DkrxImfz1I1qfPlUBsTmrzhTjtKQ81ONhaJB3wKgg9pZ/JNOBgfdDNZ9SoFcenKlMPSb61hIcVDWBftPOGfVoFSeiJxskasyYikEQTwicAlaGQ9TnXIbhVcfHOQxFfZjddyAR7kB5dYArk9BNwKfmhC9QOEun5M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jzchyL5w; 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="jzchyL5w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53F2AC116C6; Mon, 16 Feb 2026 10:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771238879; bh=FmAZrnEMpRdb4yfHQsqQJsWHQI/ak9gpcuvRuiLF1+M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jzchyL5wiDBMLgrCWCbIz/r52isLwIkXzVmTDxY80jp4YJDnBoFC8AcHiDmVdsZ7r j5XHC3utpe9hGF2KTdpPo51Sluh5i1PuoBHpoT9kW6Hb1lqzPAViUpDjTfeWSfS44C /Mw+HIw8emtwJIgiAS8sRAqMXNtlx/p8f4NaRTcTEUNN27MhtAXux8AsOi935WI69R 5VfMN4/no2JTKpyCXYXU9Mcm/HpduJ8KzGbG5k5Un/PctUBYhVAlleWDaYyZ8FE+Xm TkzRYXgY6snF0xT4AifbldJJsb/iI/8UF2bdpr9JNsbQkALnCKiP1DB47sWg6qjGZN 4Aa60+Kma7aVA== Received: from johan by rho.lan with local (Exim 4.98.2) (envelope-from ) id 1vrw8w-000000000cw-3O8B; Mon, 16 Feb 2026 11:47:55 +0100 Date: Mon, 16 Feb 2026 11:47:54 +0100 From: Johan Hovold To: Vladimir Oltean Cc: Loic Poulain , 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> <20260213201550.vk5cosmoewokarlx@skbuf> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260213201550.vk5cosmoewokarlx@skbuf> On Fri, Feb 13, 2026 at 10:15:50PM +0200, Vladimir Oltean wrote: > Another comment upon reviewing this driver's runtime PM use (although > this is at most something that may result in a patch for "next"): > > This driver uses hsphy->phy_initialized to make sure qcom_snps_hsphy_suspend() > isn't called unless qcom_snps_hsphy_init() was called. > > Don't we achieve the same behaviour by replacing "hsphy->phy_initialized = true" > with pm_runtime_get_sync(dev) and "hsphy->phy_initialized = false" with > pm_runtime_put(dev)? No, the device can still suspend before phy_init() is called. What would work, and which should probably be preferred over adding these phy_initialized flags, is to increment the pm usage counter before enabling runtime pm and decrementing it after the PHY has been created. Johan