diff mbox series

spmi: pmic-arb: use correct node when adding irq domain

Message ID 20240703221157.3640361-1-quic_collinsd@quicinc.com
State New
Headers show
Series spmi: pmic-arb: use correct node when adding irq domain | expand

Commit Message

David Collins July 3, 2024, 10:11 p.m. UTC
Pass a pointer to the SPMI bus subnode instead of the top-
level PMIC arbiter node when calling irq_domain_add_tree().
This ensures that consumer IRQ mappings can be found
successfully at runtime.

Here is an example of a consumer device probe deferral that
happens without this fix in place:

[   18.197271] platform c42d000.spmi:qcom,pmk8550@0:pon_hlos@1300:pwrkey:
  deferred probe pending: pm8941-pwrkey: IRQ index 0 not found
[   18.197275] platform c42d000.spmi:qcom,pmk8550@0:pon_hlos@1300:resin:
  deferred probe pending: pm8941-pwrkey: IRQ index 0 not found

Fixes: 02922ccbb330 ("spmi: pmic-arb: Register controller for bus instead of arbiter")
Fixes: 979987371739 ("spmi: pmic-arb: Add multi bus support")
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
---
 drivers/spmi/spmi-pmic-arb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

David Collins July 8, 2024, 6:10 p.m. UTC | #1
On 7/3/24 19:30, Bjorn Andersson wrote:
> On Wed, Jul 03, 2024 at 03:11:57PM GMT, David Collins wrote:
>> Pass a pointer to the SPMI bus subnode instead of the top-
>> level PMIC arbiter node when calling irq_domain_add_tree().
>> This ensures that consumer IRQ mappings can be found
>> successfully at runtime.
>>
>> Here is an example of a consumer device probe deferral that
>> happens without this fix in place:
>>
>> [   18.197271] platform c42d000.spmi:qcom,pmk8550@0:pon_hlos@1300:pwrkey:
>>   deferred probe pending: pm8941-pwrkey: IRQ index 0 not found
>> [   18.197275] platform c42d000.spmi:qcom,pmk8550@0:pon_hlos@1300:resin:
>>   deferred probe pending: pm8941-pwrkey: IRQ index 0 not found
>>
>> Fixes: 02922ccbb330 ("spmi: pmic-arb: Register controller for bus instead of arbiter")
>> Fixes: 979987371739 ("spmi: pmic-arb: Add multi bus support")
>> Signed-off-by: David Collins <quic_collinsd@quicinc.com>
> 
> Not sure if Stephen was waiting for some fixes tags, but otherwise this
> was already proposed and reviewed here:
> 
> https://lore.kernel.org/all/20240522-topic-spmi_multi_master_irqfix-v2-1-7ec92a862b9f@linaro.org/

Thanks Bjorn for the link to this previous patch.  I was unaware that it
had been sent out.  I ran into this bug when testing with the recent
pmic-arb multi-bus support series.  I searched to see if it been
submitted before and couldn't find mention of it, so I sent out my fix
for it.

It would be great if Konrad's version of the fix (with Fixes tag(s)
added) or mine could be picked up.  That will ensure that client IRQ
usage isn't broken on targets specifying spmi-pmic-arb SPMI bus subnode
devices in DT.

Thanks,
David


> FWIW:
> 
> Reviewed-by: Bjorn Andersson <andersson@kernel.org>
> 
> Regards,
> Bjorn
> 
>> ---
>>  drivers/spmi/spmi-pmic-arb.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
>> index 791cdc160c51..e6a4bf3abb1f 100644
>> --- a/drivers/spmi/spmi-pmic-arb.c
>> +++ b/drivers/spmi/spmi-pmic-arb.c
>> @@ -1737,8 +1737,7 @@ static int spmi_pmic_arb_bus_init(struct platform_device *pdev,
>>  
>>  	dev_dbg(&pdev->dev, "adding irq domain for bus %d\n", bus_index);
>>  
>> -	bus->domain = irq_domain_add_tree(dev->of_node,
>> -					  &pmic_arb_irq_domain_ops, bus);
>> +	bus->domain = irq_domain_add_tree(node, &pmic_arb_irq_domain_ops, bus);
>>  	if (!bus->domain) {
>>  		dev_err(&pdev->dev, "unable to create irq_domain\n");
>>  		return -ENOMEM;
diff mbox series

Patch

diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index 791cdc160c51..e6a4bf3abb1f 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -1737,8 +1737,7 @@  static int spmi_pmic_arb_bus_init(struct platform_device *pdev,
 
 	dev_dbg(&pdev->dev, "adding irq domain for bus %d\n", bus_index);
 
-	bus->domain = irq_domain_add_tree(dev->of_node,
-					  &pmic_arb_irq_domain_ops, bus);
+	bus->domain = irq_domain_add_tree(node, &pmic_arb_irq_domain_ops, bus);
 	if (!bus->domain) {
 		dev_err(&pdev->dev, "unable to create irq_domain\n");
 		return -ENOMEM;