* [PATCH 0/2] pmdomain: imx93: Fix shared MIPI PHY resource management
@ 2026-06-09 6:26 Guoniu Zhou
2026-06-09 6:26 ` [PATCH 1/2] dt-bindings: power: imx93: Add MIPI PHY power domain Guoniu Zhou
2026-06-09 6:26 ` [PATCH 2/2] pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI Guoniu Zhou
0 siblings, 2 replies; 6+ messages in thread
From: Guoniu Zhou @ 2026-06-09 6:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Ulf Hansson,
Peng Fan, Shawn Guo
Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-pm,
Guoniu Zhou, stable
The i.MX93 MIPI DSI and CSI domains share control bits for clock and
reset in the media block controller. This creates a resource conflict
where one domain can inadvertently disable shared resources while the
other domain is still active, leading to system instability.
This series fixes the issue by introducing a dedicated MIPI PHY power
domain that owns the shared clock and reset control bits. The DSI and
CSI domains are then made subdomains of this PHY domain, ensuring proper
reference counting and preventing premature resource shutdown.
Tested on i.MX93 EVK with concurrent DSI and CSI operations.
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
Guoniu Zhou (2):
dt-bindings: power: imx93: Add MIPI PHY power domain
pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI
drivers/pmdomain/imx/imx93-blk-ctrl.c | 60 ++++++++++++++++++++++++++++-
include/dt-bindings/power/fsl,imx93-power.h | 1 +
2 files changed, 59 insertions(+), 2 deletions(-)
---
base-commit: 3b7a18a34e8d3b14c7c926f033488a0350de9759
change-id: 20260608-pm_imx93-6ccc1aa11932
Best regards,
--
Guoniu Zhou <guoniu.zhou@oss.nxp.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] dt-bindings: power: imx93: Add MIPI PHY power domain 2026-06-09 6:26 [PATCH 0/2] pmdomain: imx93: Fix shared MIPI PHY resource management Guoniu Zhou @ 2026-06-09 6:26 ` Guoniu Zhou 2026-06-09 14:52 ` Frank Li 2026-06-09 15:13 ` Krzysztof Kozlowski 2026-06-09 6:26 ` [PATCH 2/2] pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI Guoniu Zhou 1 sibling, 2 replies; 6+ messages in thread From: Guoniu Zhou @ 2026-06-09 6:26 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Ulf Hansson, Peng Fan, Shawn Guo Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-pm, Guoniu Zhou Add MIPI PHY power domain for shared PHY resources used by both MIPI DSI and CSI blocks. Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com> --- include/dt-bindings/power/fsl,imx93-power.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dt-bindings/power/fsl,imx93-power.h b/include/dt-bindings/power/fsl,imx93-power.h index 17f9f015bf7d..071221fe5c57 100644 --- a/include/dt-bindings/power/fsl,imx93-power.h +++ b/include/dt-bindings/power/fsl,imx93-power.h @@ -11,5 +11,6 @@ #define IMX93_MEDIABLK_PD_PXP 2 #define IMX93_MEDIABLK_PD_LCDIF 3 #define IMX93_MEDIABLK_PD_ISI 4 +#define IMX93_MEDIABLK_PD_MIPI_PHY 5 #endif -- 2.34.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] dt-bindings: power: imx93: Add MIPI PHY power domain 2026-06-09 6:26 ` [PATCH 1/2] dt-bindings: power: imx93: Add MIPI PHY power domain Guoniu Zhou @ 2026-06-09 14:52 ` Frank Li 2026-06-09 15:13 ` Krzysztof Kozlowski 1 sibling, 0 replies; 6+ messages in thread From: Frank Li @ 2026-06-09 14:52 UTC (permalink / raw) To: Guoniu Zhou Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Ulf Hansson, Peng Fan, Shawn Guo, devicetree, imx, linux-arm-kernel, linux-kernel, linux-pm On Tue, Jun 09, 2026 at 02:26:40PM +0800, Guoniu Zhou wrote: > > Add MIPI PHY power domain for shared PHY resources used by both > MIPI DSI and CSI blocks. > > Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com> > --- Reviewed-by: Frank Li <Frank.Li@nxp.com> > include/dt-bindings/power/fsl,imx93-power.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/dt-bindings/power/fsl,imx93-power.h b/include/dt-bindings/power/fsl,imx93-power.h > index 17f9f015bf7d..071221fe5c57 100644 > --- a/include/dt-bindings/power/fsl,imx93-power.h > +++ b/include/dt-bindings/power/fsl,imx93-power.h > @@ -11,5 +11,6 @@ > #define IMX93_MEDIABLK_PD_PXP 2 > #define IMX93_MEDIABLK_PD_LCDIF 3 > #define IMX93_MEDIABLK_PD_ISI 4 > +#define IMX93_MEDIABLK_PD_MIPI_PHY 5 > > #endif > > -- > 2.34.1 > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] dt-bindings: power: imx93: Add MIPI PHY power domain 2026-06-09 6:26 ` [PATCH 1/2] dt-bindings: power: imx93: Add MIPI PHY power domain Guoniu Zhou 2026-06-09 14:52 ` Frank Li @ 2026-06-09 15:13 ` Krzysztof Kozlowski 1 sibling, 0 replies; 6+ messages in thread From: Krzysztof Kozlowski @ 2026-06-09 15:13 UTC (permalink / raw) To: Guoniu Zhou, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Ulf Hansson, Peng Fan, Shawn Guo Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-pm On 09/06/2026 08:26, Guoniu Zhou wrote: > Add MIPI PHY power domain for shared PHY resources used by both > MIPI DSI and CSI blocks. > > Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com> > --- > include/dt-bindings/power/fsl,imx93-power.h | 1 + Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI 2026-06-09 6:26 [PATCH 0/2] pmdomain: imx93: Fix shared MIPI PHY resource management Guoniu Zhou 2026-06-09 6:26 ` [PATCH 1/2] dt-bindings: power: imx93: Add MIPI PHY power domain Guoniu Zhou @ 2026-06-09 6:26 ` Guoniu Zhou 2026-06-09 15:09 ` Frank Li 1 sibling, 1 reply; 6+ messages in thread From: Guoniu Zhou @ 2026-06-09 6:26 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Ulf Hansson, Peng Fan, Shawn Guo Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-pm, Guoniu Zhou, stable The MIPI DSI and CSI domains share control bits for clock and reset, which can lead to incorrect behavior if one domain disables the shared resource while the other is still active. To fix the issue, introduce a shared MIPI PHY power domain to own the common resources and make DSI and CSI its subdomains. This ensures the shared bits are properly managed and not disabled while still in use. Fixes: e9aa77d413c9 ("soc: imx: add i.MX93 media blk ctrl driver") Cc: stable@vger.kernel.org Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com> --- drivers/pmdomain/imx/imx93-blk-ctrl.c | 60 +++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-blk-ctrl.c b/drivers/pmdomain/imx/imx93-blk-ctrl.c index 1afc78b034fa..243ce939ba68 100644 --- a/drivers/pmdomain/imx/imx93-blk-ctrl.c +++ b/drivers/pmdomain/imx/imx93-blk-ctrl.c @@ -48,6 +48,8 @@ #define PRIO(X) (X) +#define BLK_CTRL_NO_PARENT UINT_MAX + struct imx93_blk_ctrl_domain; struct imx93_blk_ctrl { @@ -68,12 +70,18 @@ struct imx93_blk_ctrl_qos { u32 cfg_prio; }; +struct imx93_blk_ctrl_subdomain_link { + struct generic_pm_domain *parent; + struct generic_pm_domain *subdomain; +}; + struct imx93_blk_ctrl_domain_data { const char *name; const char * const *clk_names; int num_clks; u32 rst_mask; u32 clk_mask; + u32 parent; int num_qos; struct imx93_blk_ctrl_qos qos[DOMAIN_MAX_QOS]; }; @@ -203,6 +211,13 @@ static void imx93_release_pm_genpd(void *data) pm_genpd_remove(genpd); } +static void imx93_release_subdomain(void *data) +{ + struct imx93_blk_ctrl_subdomain_link *link = data; + + pm_genpd_remove_subdomain(link->parent, link->subdomain); +} + static struct lock_class_key blk_ctrl_genpd_lock_class; static int imx93_blk_ctrl_probe(struct platform_device *pdev) @@ -302,6 +317,34 @@ static int imx93_blk_ctrl_probe(struct platform_device *pdev) bc->onecell_data.domains[i] = &domain->genpd; } + for (i = 0; i < bc_data->num_domains; i++) { + struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; + const struct imx93_blk_ctrl_domain_data *data = domain->data; + struct imx93_blk_ctrl_subdomain_link *link; + + if (bc_data->skip_mask & BIT(i) || + data->parent == BLK_CTRL_NO_PARENT) + continue; + + link = devm_kzalloc(dev, sizeof(*link), GFP_KERNEL); + if (!link) + return -ENOMEM; + + link->parent = &bc->domains[data->parent].genpd; + link->subdomain = &domain->genpd; + + ret = pm_genpd_add_subdomain(&bc->domains[data->parent].genpd, + &domain->genpd); + if (ret) + return dev_err_probe(dev, ret, "failed to add subdomain %s\n", + domain->genpd.name); + + ret = devm_add_action_or_reset(dev, imx93_release_subdomain, link); + if (ret) + return dev_err_probe(dev, ret, + "failed to add subdomain release callback\n"); + } + ret = devm_pm_runtime_enable(dev); if (ret) return dev_err_probe(dev, ret, "failed to enable pm-runtime\n"); @@ -326,8 +369,9 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .name = "mediablk-mipi-dsi", .clk_names = (const char *[]){ "dsi" }, .num_clks = 1, - .rst_mask = BIT(11) | BIT(12), - .clk_mask = BIT(11) | BIT(12), + .rst_mask = BIT(11), + .clk_mask = BIT(11), + .parent = IMX93_MEDIABLK_PD_MIPI_PHY, }, [IMX93_MEDIABLK_PD_MIPI_CSI] = { .name = "mediablk-mipi-csi", @@ -335,6 +379,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .num_clks = 2, .rst_mask = BIT(9) | BIT(10), .clk_mask = BIT(9) | BIT(10), + .parent = IMX93_MEDIABLK_PD_MIPI_PHY, }, [IMX93_MEDIABLK_PD_PXP] = { .name = "mediablk-pxp", @@ -342,6 +387,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .num_clks = 1, .rst_mask = BIT(7) | BIT(8), .clk_mask = BIT(7) | BIT(8), + .parent = BLK_CTRL_NO_PARENT, .num_qos = 2, .qos = { { @@ -363,6 +409,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .num_clks = 2, .rst_mask = BIT(4) | BIT(5) | BIT(6), .clk_mask = BIT(4) | BIT(5) | BIT(6), + .parent = BLK_CTRL_NO_PARENT, .num_qos = 1, .qos = { { @@ -379,6 +426,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .num_clks = 1, .rst_mask = BIT(2) | BIT(3), .clk_mask = BIT(2) | BIT(3), + .parent = BLK_CTRL_NO_PARENT, .num_qos = 4, .qos = { { @@ -404,6 +452,14 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] } } }, + [IMX93_MEDIABLK_PD_MIPI_PHY] = { + .name = "mediablk-mipi-phy", + .clk_names = NULL, + .num_clks = 0, + .rst_mask = BIT(12), + .clk_mask = BIT(12), + .parent = BLK_CTRL_NO_PARENT, + }, }; static const struct regmap_range imx93_media_blk_ctl_yes_ranges[] = { -- 2.34.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI 2026-06-09 6:26 ` [PATCH 2/2] pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI Guoniu Zhou @ 2026-06-09 15:09 ` Frank Li 0 siblings, 0 replies; 6+ messages in thread From: Frank Li @ 2026-06-09 15:09 UTC (permalink / raw) To: Guoniu Zhou Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Ulf Hansson, Peng Fan, Shawn Guo, devicetree, imx, linux-arm-kernel, linux-kernel, linux-pm, stable On Tue, Jun 09, 2026 at 02:26:41PM +0800, Guoniu Zhou wrote: > > The MIPI DSI and CSI domains share control bits for clock and reset, which > can lead to incorrect behavior if one domain disables the shared resource > while the other is still active. > > To fix the issue, introduce a shared MIPI PHY power domain to own the > common resources and make DSI and CSI its subdomains. This ensures the > shared bits are properly managed and not disabled while still in use. > > Fixes: e9aa77d413c9 ("soc: imx: add i.MX93 media blk ctrl driver") > Cc: stable@vger.kernel.org > Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com> > --- Reviewed-by: Frank Li <Frank.Li@nxp.com> > drivers/pmdomain/imx/imx93-blk-ctrl.c | 60 +++++++++++++++++++++++++++++++++-- > 1 file changed, 58 insertions(+), 2 deletions(-) > > diff --git a/drivers/pmdomain/imx/imx93-blk-ctrl.c b/drivers/pmdomain/imx/imx93-blk-ctrl.c > index 1afc78b034fa..243ce939ba68 100644 > --- a/drivers/pmdomain/imx/imx93-blk-ctrl.c > +++ b/drivers/pmdomain/imx/imx93-blk-ctrl.c > @@ -48,6 +48,8 @@ > > #define PRIO(X) (X) > > +#define BLK_CTRL_NO_PARENT UINT_MAX > + > struct imx93_blk_ctrl_domain; > > struct imx93_blk_ctrl { > @@ -68,12 +70,18 @@ struct imx93_blk_ctrl_qos { > u32 cfg_prio; > }; > > +struct imx93_blk_ctrl_subdomain_link { > + struct generic_pm_domain *parent; > + struct generic_pm_domain *subdomain; > +}; > + > struct imx93_blk_ctrl_domain_data { > const char *name; > const char * const *clk_names; > int num_clks; > u32 rst_mask; > u32 clk_mask; > + u32 parent; > int num_qos; > struct imx93_blk_ctrl_qos qos[DOMAIN_MAX_QOS]; > }; > @@ -203,6 +211,13 @@ static void imx93_release_pm_genpd(void *data) > pm_genpd_remove(genpd); > } > > +static void imx93_release_subdomain(void *data) > +{ > + struct imx93_blk_ctrl_subdomain_link *link = data; > + > + pm_genpd_remove_subdomain(link->parent, link->subdomain); > +} > + > static struct lock_class_key blk_ctrl_genpd_lock_class; > > static int imx93_blk_ctrl_probe(struct platform_device *pdev) > @@ -302,6 +317,34 @@ static int imx93_blk_ctrl_probe(struct platform_device *pdev) > bc->onecell_data.domains[i] = &domain->genpd; > } > > + for (i = 0; i < bc_data->num_domains; i++) { > + struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; > + const struct imx93_blk_ctrl_domain_data *data = domain->data; > + struct imx93_blk_ctrl_subdomain_link *link; > + > + if (bc_data->skip_mask & BIT(i) || > + data->parent == BLK_CTRL_NO_PARENT) > + continue; > + > + link = devm_kzalloc(dev, sizeof(*link), GFP_KERNEL); > + if (!link) > + return -ENOMEM; > + > + link->parent = &bc->domains[data->parent].genpd; > + link->subdomain = &domain->genpd; > + > + ret = pm_genpd_add_subdomain(&bc->domains[data->parent].genpd, > + &domain->genpd); > + if (ret) > + return dev_err_probe(dev, ret, "failed to add subdomain %s\n", > + domain->genpd.name); > + > + ret = devm_add_action_or_reset(dev, imx93_release_subdomain, link); > + if (ret) > + return dev_err_probe(dev, ret, > + "failed to add subdomain release callback\n"); > + } > + > ret = devm_pm_runtime_enable(dev); > if (ret) > return dev_err_probe(dev, ret, "failed to enable pm-runtime\n"); > @@ -326,8 +369,9 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] > .name = "mediablk-mipi-dsi", > .clk_names = (const char *[]){ "dsi" }, > .num_clks = 1, > - .rst_mask = BIT(11) | BIT(12), > - .clk_mask = BIT(11) | BIT(12), > + .rst_mask = BIT(11), > + .clk_mask = BIT(11), > + .parent = IMX93_MEDIABLK_PD_MIPI_PHY, > }, > [IMX93_MEDIABLK_PD_MIPI_CSI] = { > .name = "mediablk-mipi-csi", > @@ -335,6 +379,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] > .num_clks = 2, > .rst_mask = BIT(9) | BIT(10), > .clk_mask = BIT(9) | BIT(10), > + .parent = IMX93_MEDIABLK_PD_MIPI_PHY, > }, > [IMX93_MEDIABLK_PD_PXP] = { > .name = "mediablk-pxp", > @@ -342,6 +387,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] > .num_clks = 1, > .rst_mask = BIT(7) | BIT(8), > .clk_mask = BIT(7) | BIT(8), > + .parent = BLK_CTRL_NO_PARENT, > .num_qos = 2, > .qos = { > { > @@ -363,6 +409,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] > .num_clks = 2, > .rst_mask = BIT(4) | BIT(5) | BIT(6), > .clk_mask = BIT(4) | BIT(5) | BIT(6), > + .parent = BLK_CTRL_NO_PARENT, > .num_qos = 1, > .qos = { > { > @@ -379,6 +426,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] > .num_clks = 1, > .rst_mask = BIT(2) | BIT(3), > .clk_mask = BIT(2) | BIT(3), > + .parent = BLK_CTRL_NO_PARENT, > .num_qos = 4, > .qos = { > { > @@ -404,6 +452,14 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] > } > } > }, > + [IMX93_MEDIABLK_PD_MIPI_PHY] = { > + .name = "mediablk-mipi-phy", > + .clk_names = NULL, > + .num_clks = 0, > + .rst_mask = BIT(12), > + .clk_mask = BIT(12), > + .parent = BLK_CTRL_NO_PARENT, > + }, > }; > > static const struct regmap_range imx93_media_blk_ctl_yes_ranges[] = { > > -- > 2.34.1 > > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-09 15:42 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-06-09 6:26 [PATCH 0/2] pmdomain: imx93: Fix shared MIPI PHY resource management Guoniu Zhou 2026-06-09 6:26 ` [PATCH 1/2] dt-bindings: power: imx93: Add MIPI PHY power domain Guoniu Zhou 2026-06-09 14:52 ` Frank Li 2026-06-09 15:13 ` Krzysztof Kozlowski 2026-06-09 6:26 ` [PATCH 2/2] pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI Guoniu Zhou 2026-06-09 15:09 ` Frank Li
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox