Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ipa: use dev PM wakeirq handling

Replace the enable_irq_wake() call with one to dev_pm_set_wake_irq()
instead. This will let the dev PM framework automatically manage the
the wakeup capability of the ipa IRQ and ensure that userspace requests
to enable/disable wakeup for the IPA via sysfs are respected.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20230127202758.2913612-1-caleb.connolly@linaro.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Caleb Connolly and committed by
Paolo Abeni
df54fde4 562c6548

+4 -6
+4 -6
drivers/net/ipa/ipa_interrupt.c
··· 22 22 #include <linux/types.h> 23 23 #include <linux/interrupt.h> 24 24 #include <linux/pm_runtime.h> 25 + #include <linux/pm_wakeirq.h> 25 26 26 27 #include "ipa.h" 27 28 #include "ipa_reg.h" ··· 270 269 goto err_kfree; 271 270 } 272 271 273 - ret = enable_irq_wake(irq); 272 + ret = dev_pm_set_wake_irq(dev, irq); 274 273 if (ret) { 275 - dev_err(dev, "error %d enabling wakeup for \"ipa\" IRQ\n", ret); 274 + dev_err(dev, "error %d registering \"ipa\" IRQ as wakeirq\n", ret); 276 275 goto err_free_irq; 277 276 } 278 277 ··· 290 289 void ipa_interrupt_deconfig(struct ipa_interrupt *interrupt) 291 290 { 292 291 struct device *dev = &interrupt->ipa->pdev->dev; 293 - int ret; 294 292 295 - ret = disable_irq_wake(interrupt->irq); 296 - if (ret) 297 - dev_err(dev, "error %d disabling \"ipa\" IRQ wakeup\n", ret); 293 + dev_pm_clear_wake_irq(dev); 298 294 free_irq(interrupt->irq, interrupt); 299 295 kfree(interrupt); 300 296 }