i2c: return probe deferred status on dev_pm_domain_attach
Subsystems (2)
PATCH v2 1/1 i2c: return probe deferred status on dev_pm_domain_attach
A change of return status was introduced in commit 3fffd1283927 ("i2c: allow specifying separate wakeup interrupt in device tree")
The commit prevents the defer status being passed up the call stack appropriately when dev_pm_domain_attach returns -EPROBE_DEFER.
Catch the PROBE_DEFER and clear up the IRQ wakeup status
interrupt in device tree")
---
V2:
Fall through the error path before returning -EPROBE_DEFER
drivers/i2c/i2c-core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/i2c/i2c-core.c +2 -0
@@ -699,6 +699,8 @@ static int i2c_device_probe(struct device *dev) client));if (status) goto err_detach_pm_domain; + }else { + goto err_clear_wakeup_irq; }return 0 ;
Signature · 1 line
2.1.4
Quoted 5 lines · Kieran Bingham
A change of return status was introduced in commit
3fffd1283927("i2c: allow specifying separate wakeup interrupt in device tree")The commit prevents the defer status being passed up the call stack appropriately when
dev_pm_domain_attachreturns -EPROBE_DEFER.
Ah, indeed, sorry about that.
Quoted 19 lines
Catch the
PROBE_DEFERand clear up the IRQ wakeup statusSigned-off-by Kieran Bingham <[email protected]>Fixes 3fffd1283927 ("i2c: allow specifying separate wakeupinterrupt in device tree")
---
V2:
Fall through the error path before returning -EPROBE_DEFERdrivers/i2c/i2c-core.c | 2 ++ 1 file changed, 2 insertions(+)drivers/i2c/i2c-core.c +0
-0
drivers/i2c/i2c-core.c static int i2c_device_probe(struct device *dev) · line 704
Quoted 6 lines
drivers/i2c/i2c-core.c +2
-0@@ -699,6 +699,8 @@ static int i2c_device_probe(struct device *dev) client));if (status) goto err_detach_pm_domain; + }else { + goto err_clear_wakeup_irq; }
How about we do:
status = dev_pm_domain_attach(&client->dev, true);
if (status == -EPROBE_DEFER)
goto err_clear_wakeup_irq;
status = driver->probe(client, i2c_match_id(driver->id_table, client));
....instead of doing "else"?
Thanks.
Signature · 1 line
Dmitry
Quoted 38 lines · Dmitry Torokhov
Quoted 5 lines · Kieran Bingham
A change of return status was introduced in commit
3fffd1283927("i2c: allow specifying separate wakeup interrupt in device tree")The commit prevents the defer status being passed up the call stack appropriately when
dev_pm_domain_attachreturns -EPROBE_DEFER.Ah, indeed, sorry about that.
Quoted 19 lines
Catch the
PROBE_DEFERand clear up the IRQ wakeup statusSigned-off-by Kieran Bingham <[email protected]>Fixes 3fffd1283927 ("i2c: allow specifying separate wakeupinterrupt in device tree")
---
V2:
Fall through the error path before returning -EPROBE_DEFERdrivers/i2c/i2c-core.c | 2 ++ 1 file changed, 2 insertions(+)drivers/i2c/i2c-core.c +0
-0drivers/i2c/i2c-core.c static int i2c_device_probe(struct device *dev) · line 704
Quoted 6 lines
drivers/i2c/i2c-core.c +2
-0@@ -699,6 +699,8 @@ static int i2c_device_probe(struct device *dev) client));if (status) goto err_detach_pm_domain; + }else { + goto err_clear_wakeup_irq; }How about we do:
Quoted 8 lines
status = dev_pm_domain_attach(&client->dev, true); if (status == -EPROBE_DEFER) goto err_clear_wakeup_irq; status = driver->probe(client, i2c_match_id(driver->id_table, client)); ....instead of doing "else"?
Well in fact - this is actually what I do in the next set of patches I'm working on which led me to find this fault.
(i2c: Provide a temporary .probe2() call-back type)
And so ... v3 ... so much for my quick one word bugfix patch :)
I'll send v3 with the if/else removed
--
Kieran
Quoted 5 lines
Thanks.
--
Dmitry