[PATCH 3/3] irqchip/mbigen: Use fw_devlink_relax_consumers() helper

Wang Wensheng posted 3 patches 1 month, 3 weeks ago
[PATCH 3/3] irqchip/mbigen: Use fw_devlink_relax_consumers() helper
Posted by Wang Wensheng 1 month, 3 weeks ago
Use this to prevernt the consumer devices of mbigen to be probed too
later.

Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
---
 drivers/irqchip/irq-mbigen.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
index 6f69f4e5dbac..4e96eb9b6a6a 100644
--- a/drivers/irqchip/irq-mbigen.c
+++ b/drivers/irqchip/irq-mbigen.c
@@ -252,6 +252,8 @@ static int mbigen_of_create_domain(struct platform_device *pdev,
 
 		if (!mbigen_create_device_domain(&child->dev, num_pins, mgn_chip))
 			return -ENOMEM;
+
+		fw_devlink_relax_consumers(&child->dev);
 	}
 
 	return 0;
-- 
2.22.0
Re: [PATCH 3/3] irqchip/mbigen: Use fw_devlink_relax_consumers() helper
Posted by Greg KH 1 month, 3 weeks ago
On Thu, Aug 14, 2025 at 07:10:23PM +0800, Wang Wensheng wrote:
> Use this to prevernt the consumer devices of mbigen to be probed too
> later.
> 
> Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
> ---
>  drivers/irqchip/irq-mbigen.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
> index 6f69f4e5dbac..4e96eb9b6a6a 100644
> --- a/drivers/irqchip/irq-mbigen.c
> +++ b/drivers/irqchip/irq-mbigen.c
> @@ -252,6 +252,8 @@ static int mbigen_of_create_domain(struct platform_device *pdev,
>  
>  		if (!mbigen_create_device_domain(&child->dev, num_pins, mgn_chip))
>  			return -ENOMEM;
> +
> +		fw_devlink_relax_consumers(&child->dev);

Ick, no, individual drivers should not be doing this.  Saravana, any
ideas?

greg k-h
Re: [PATCH 3/3] irqchip/mbigen: Use fw_devlink_relax_consumers() helper
Posted by Saravana Kannan 1 month, 2 weeks ago
On Thu, Aug 14, 2025 at 4:39 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Thu, Aug 14, 2025 at 07:10:23PM +0800, Wang Wensheng wrote:
> > Use this to prevernt the consumer devices of mbigen to be probed too
> > later.
> >
> > Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
> > ---
> >  drivers/irqchip/irq-mbigen.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
> > index 6f69f4e5dbac..4e96eb9b6a6a 100644
> > --- a/drivers/irqchip/irq-mbigen.c
> > +++ b/drivers/irqchip/irq-mbigen.c
> > @@ -252,6 +252,8 @@ static int mbigen_of_create_domain(struct platform_device *pdev,
> >
> >               if (!mbigen_create_device_domain(&child->dev, num_pins, mgn_chip))
> >                       return -ENOMEM;
> > +
> > +             fw_devlink_relax_consumers(&child->dev);
>
> Ick, no, individual drivers should not be doing this.  Saravana, any
> ideas?

Yeah, I responded to patch 2/3.

To give a more specific answer, this driver is just adding platform
devices to the platform bus that it never probes. They should create a
class for these and add these devices to their own class. fw_devlink
is smart enough about not waiting on class devices to probe. If for
whatever reason, switching it to a class is impossible, then they
should write a stub driver to probe these devices.

-Saravana
Re: [PATCH 3/3] irqchip/mbigen: Use fw_devlink_relax_consumers() helper
Posted by wangwensheng (C) 1 month, 2 weeks ago

在 2025/8/15 2:05, Saravana Kannan 写道:
> On Thu, Aug 14, 2025 at 4:39 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>>
>> On Thu, Aug 14, 2025 at 07:10:23PM +0800, Wang Wensheng wrote:
>>> Use this to prevernt the consumer devices of mbigen to be probed too
>>> later.
>>>
>>> Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
>>> ---
>>>   drivers/irqchip/irq-mbigen.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
>>> index 6f69f4e5dbac..4e96eb9b6a6a 100644
>>> --- a/drivers/irqchip/irq-mbigen.c
>>> +++ b/drivers/irqchip/irq-mbigen.c
>>> @@ -252,6 +252,8 @@ static int mbigen_of_create_domain(struct platform_device *pdev,
>>>
>>>                if (!mbigen_create_device_domain(&child->dev, num_pins, mgn_chip))
>>>                        return -ENOMEM;
>>> +
>>> +             fw_devlink_relax_consumers(&child->dev);
>>
>> Ick, no, individual drivers should not be doing this.  Saravana, any
>> ideas?
> 
> Yeah, I responded to patch 2/3.
> 
> To give a more specific answer, this driver is just adding platform
> devices to the platform bus that it never probes. They should create a
> class for these and add these devices to their own class. fw_devlink
> is smart enough about not waiting on class devices to probe. If for
> whatever reason, switching it to a class is impossible, then they
> should write a stub driver to probe these devices.
> 
> -Saravana

Thanks for your suggestion. I will try this way later.