[PATCH v2 10/11] irqchip/irq-imx-gpcv2: Mark fwnode device as not initialized

Saravana Kannan posted 11 patches 2 years, 7 months ago
There is a newer version of this series
[PATCH v2 10/11] irqchip/irq-imx-gpcv2: Mark fwnode device as not initialized
Posted by Saravana Kannan 2 years, 7 months ago
Since this device is only partially initialized by the irqchip driver,
we need to mark the fwnode device as not initialized. This is to let
fw_devlink know that the device will be completely initialized at a
later point. That way, fw_devlink will continue to defer the probe of
the power domain consumers till the power domain driver successfully
binds to the struct device and completes the initialization of the
device.

Signed-off-by: Saravana Kannan <saravanak@google.com>
---
 drivers/irqchip/irq-imx-gpcv2.c | 1 +
 drivers/soc/imx/gpcv2.c         | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq-imx-gpcv2.c
index b9c22f764b4d..8a0e82067924 100644
--- a/drivers/irqchip/irq-imx-gpcv2.c
+++ b/drivers/irqchip/irq-imx-gpcv2.c
@@ -283,6 +283,7 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node,
 	 * later the GPC power domain driver will not be skipped.
 	 */
 	of_node_clear_flag(node, OF_POPULATED);
+	fwnode_dev_initialized(domain->fwnode, false);
 	return 0;
 }
 
diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
index 7a47d14fde44..b24f9ab634dc 100644
--- a/drivers/soc/imx/gpcv2.c
+++ b/drivers/soc/imx/gpcv2.c
@@ -1519,6 +1519,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
 
 		pd_pdev->dev.parent = dev;
 		pd_pdev->dev.of_node = np;
+		pd_pdev->dev.fwnode = of_fwnode_handle(np);
 
 		ret = platform_device_add(pd_pdev);
 		if (ret) {
-- 
2.39.1.456.gfc5497dd1b-goog
Re: [PATCH v2 10/11] irqchip/irq-imx-gpcv2: Mark fwnode device as not initialized
Posted by Andy Shevchenko 2 years, 7 months ago
On Thu, Jan 26, 2023 at 04:11:37PM -0800, Saravana Kannan wrote:
> Since this device is only partially initialized by the irqchip driver,
> we need to mark the fwnode device as not initialized. This is to let
> fw_devlink know that the device will be completely initialized at a
> later point. That way, fw_devlink will continue to defer the probe of
> the power domain consumers till the power domain driver successfully
> binds to the struct device and completes the initialization of the
> device.

...

>  		pd_pdev->dev.of_node = np;
> +		pd_pdev->dev.fwnode = of_fwnode_handle(np);

Instead,

		device_set_node(&pd_dev->dev, of_fwnode_handle(np));

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v2 10/11] irqchip/irq-imx-gpcv2: Mark fwnode device as not initialized
Posted by Saravana Kannan 2 years, 7 months ago
On Fri, Jan 27, 2023 at 1:51 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Jan 26, 2023 at 04:11:37PM -0800, Saravana Kannan wrote:
> > Since this device is only partially initialized by the irqchip driver,
> > we need to mark the fwnode device as not initialized. This is to let
> > fw_devlink know that the device will be completely initialized at a
> > later point. That way, fw_devlink will continue to defer the probe of
> > the power domain consumers till the power domain driver successfully
> > binds to the struct device and completes the initialization of the
> > device.
>
> ...
>
> >               pd_pdev->dev.of_node = np;
> > +             pd_pdev->dev.fwnode = of_fwnode_handle(np);
>
> Instead,
>
>                 device_set_node(&pd_dev->dev, of_fwnode_handle(np));

Ack


-Saravana