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 56E26253925; Mon, 23 Jun 2025 13:29:29 +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=1750685369; cv=none; b=iNrwjtO2HtA24yShcigCxG4sGoWnF9uA/5n5VaNcQ2mukaJnLwQh3qO0u8xbftQPO34TDx3JOBJy3pOHsoe/vA00Kpo2GI2Oc6/Wbe67WGRq5/pAon/lvsPyfzbt1oWg18O16U2SPFNG7VkEplYLBaY1lxyYipH+Tqhs/W1NFqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750685369; c=relaxed/simple; bh=eQhoiQ2IR7YuIdQchEHTzhkC5TC8u9NCbs57T52HfPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pwvpoY73fXT119RPLh4s0H5GN7FvLoFbqn9ayHEwxu6YmUhZXMC2vhN7AgBxf3QsttBk9x5nCCQW83sv/Pmf4NzACCy5mQ50J/qWY0SVu6vk4tjBBFCOtW+aEHyAbk8qa6AndY6z4BmWLFe13pWZuD/fkAyVC+KMcA6HhJpipWk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oQppmgFx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oQppmgFx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF4F1C4CEEA; Mon, 23 Jun 2025 13:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750685369; bh=eQhoiQ2IR7YuIdQchEHTzhkC5TC8u9NCbs57T52HfPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQppmgFxbej10QFqfCy4td4PHTXJRKlOY8WyLYsZ4rc3QivoLdljRv77bRT4zEFEA jmRh/ZvneE/wRusFkNPGxWJUkoUeyFdyqkib3nlWNLHGcFpHL45rmp9ragYhnRdRe1 DlZw25YcjlVa9QB0iVoOJ/osQtsYtF8XACSSaAUw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tarang Raval , Sakari Ailus , Hans Verkuil , Sasha Levin Subject: [PATCH 6.15 256/592] media: i2c: imx334: Enable runtime PM before sub-device registration Date: Mon, 23 Jun 2025 15:03:34 +0200 Message-ID: <20250623130706.389363151@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130700.210182694@linuxfoundation.org> References: <20250623130700.210182694@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tarang Raval [ Upstream commit 01dfdf6a80c57151af0589af0db7adbbdd1361c7 ] Runtime PM is fully initialized before calling v4l2_async_register_subdev_sensor(). Moving the runtime PM initialization earlier prevents potential access to an uninitialized or powered-down device. Signed-off-by: Tarang Raval Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/i2c/imx334.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index a544fc3df39c2..b51721c01e1d6 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -1391,6 +1391,9 @@ static int imx334_probe(struct i2c_client *client) goto error_handler_free; } + pm_runtime_set_active(imx334->dev); + pm_runtime_enable(imx334->dev); + ret = v4l2_async_register_subdev_sensor(&imx334->sd); if (ret < 0) { dev_err(imx334->dev, @@ -1398,13 +1401,13 @@ static int imx334_probe(struct i2c_client *client) goto error_media_entity; } - pm_runtime_set_active(imx334->dev); - pm_runtime_enable(imx334->dev); pm_runtime_idle(imx334->dev); return 0; error_media_entity: + pm_runtime_disable(imx334->dev); + pm_runtime_set_suspended(imx334->dev); media_entity_cleanup(&imx334->sd.entity); error_handler_free: v4l2_ctrl_handler_free(imx334->sd.ctrl_handler); -- 2.39.5