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 804A52FFFB8 for ; Fri, 13 Feb 2026 09:07:17 +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=1770973637; cv=none; b=aQI3/+Y1XkjdTZt2bn77y8hX/+nNGPqM7+HtHsRuuFRM1H7PO5m7L19WxofrmJlFVsCgzDfIBqeoTPivOxpLNLy9SlJkvMKrYI1KNu0bp2rnG7xTqY4ERVF/MLbQNbI8dolxsJnDsTPQ3mT9h0zKnmqnkkCN6LhNHhofpbnQ8lA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770973637; c=relaxed/simple; bh=W/LWsnvp3cad7tMldpHh4EFXdjZoGYCeGPUJl8RNGb8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uj51TuO/D67eyD/zUL/xlfCTTO9qv7OtdBSdTmYdKndO4AemJs/NLHtCt9Xwdl/1ZNHSP4C+LmorRy10b6n3oav/Vbr46Rtx+oyW0uaFlvhXJvBy/5VwlGpl/dbLdGPAn3WP+uC5hoUpVl3pLi8mv0mof/XwXncdp3yz/Jte+eM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O2vd52Pm; 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="O2vd52Pm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C7A0C116C6; Fri, 13 Feb 2026 09:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770973637; bh=W/LWsnvp3cad7tMldpHh4EFXdjZoGYCeGPUJl8RNGb8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O2vd52PmJQgdASKdlWc6ve9iWZBraTdFqNTTAPGlN1cKbeZK/uuD90QuviImzNxOH Qgq7iOYKSjgfoEfz8SlqkcjJR0lBil/a6QPrll5Kf/i5FTyeACypyP2Z+pXqv+7teL NHU88uEKaluujOctZRjaMNnV/jvX68ellOkULMz3crjpyiSqA0vFz17Rg7BSegF5hl dcXIorwvYNzFkNc1Nysu3lrut0iqSEn3fAHwnysorBbUIixUy2ckG5RJ2AUIvcPyDX kGbxqQCHaVLwWrYtLI9a7f8gxcv4DAHiQfr8vUFy1/xGcjNk33zcletS8Pgl3MZGwn RLLba5cASco1g== Received: from johan by rho.lan with local (Exim 4.98.2) (envelope-from ) id 1vqp8n-000000001AK-2OWV; Fri, 13 Feb 2026 10:07:09 +0100 Date: Fri, 13 Feb 2026 10:07:09 +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=us-ascii Content-Disposition: inline In-Reply-To: <20260205160240.748371-6-loic.poulain@oss.qualcomm.com> On Thu, Feb 05, 2026 at 05:02:40PM +0100, Loic Poulain wrote: > Enabling runtime PM before attaching the hsphy instance as driver data > can lead to a NULL pointer dereference in runtime PM callbacks that > expect valid driver data. There is a small window where the suspend > callback may run after PM runtime enabling and before runtime forbid. So here too, the commit should reflect that this cannot really happen in practice. > Attach the hsphy instance as driver data before enabling runtime PM to > prevent NULL pointer dereference in runtime PM callbacks. > > Reorder pm_runtime_enable() and pm_runtime_forbid() to prevent a > short window where an unnecessary runtime suspend can occur. > > Use the devres-managed version to ensure PM runtime is symmetrically > disabled during driver removal for proper cleanup. > > Fixes: 0d75f508a9d5 ("phy: qcom-snps: Add runtime suspend and resume handlers") > Reviewed-by: Dmitry Baryshkov > Reviewed-by: Konrad Dybcio > Reviewed-by: Abel Vesa > Signed-off-by: Loic Poulain Johan