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

net: ipa: enable IPA interrupt handlers separate from registration

Expose ipa_interrupt_enable() and have functions that register
IPA interrupt handlers enable them directly, rather than having the
registration process do that. Do the same for disabling IPA
interrupt handlers.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alex Elder and committed by
Jakub Kicinski
d50ed355 8e461e1f

+26 -7
+2 -6
drivers/net/ipa/ipa_interrupt.c
··· 135 135 } 136 136 137 137 /* Enable an IPA interrupt type */ 138 - static void ipa_interrupt_enable(struct ipa *ipa, enum ipa_irq_id ipa_irq) 138 + void ipa_interrupt_enable(struct ipa *ipa, enum ipa_irq_id ipa_irq) 139 139 { 140 140 /* Update the IPA interrupt mask to enable it */ 141 141 ipa->interrupt->enabled |= BIT(ipa_irq); ··· 143 143 } 144 144 145 145 /* Disable an IPA interrupt type */ 146 - static void ipa_interrupt_disable(struct ipa *ipa, enum ipa_irq_id ipa_irq) 146 + void ipa_interrupt_disable(struct ipa *ipa, enum ipa_irq_id ipa_irq) 147 147 { 148 148 /* Update the IPA interrupt mask to disable it */ 149 149 ipa->interrupt->enabled &= ~BIT(ipa_irq); ··· 231 231 return; 232 232 233 233 interrupt->handler[ipa_irq] = handler; 234 - 235 - ipa_interrupt_enable(interrupt->ipa, ipa_irq); 236 234 } 237 235 238 236 /* Remove the handler for an IPA interrupt type */ ··· 239 241 { 240 242 if (WARN_ON(ipa_irq >= IPA_IRQ_COUNT)) 241 243 return; 242 - 243 - ipa_interrupt_disable(interrupt->ipa, ipa_irq); 244 244 245 245 interrupt->handler[ipa_irq] = NULL; 246 246 }
+15
drivers/net/ipa/ipa_interrupt.h
··· 11 11 12 12 struct ipa; 13 13 struct ipa_interrupt; 14 + enum ipa_irq_id; 14 15 15 16 /** 16 17 * typedef ipa_irq_handler_t - IPA interrupt handler function type ··· 85 84 * channel is suspended. 86 85 */ 87 86 void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt); 87 + 88 + /** 89 + * ipa_interrupt_enable() - Enable an IPA interrupt type 90 + * @ipa: IPA pointer 91 + * @ipa_irq: IPA interrupt ID 92 + */ 93 + void ipa_interrupt_enable(struct ipa *ipa, enum ipa_irq_id ipa_irq); 94 + 95 + /** 96 + * ipa_interrupt_disable() - Disable an IPA interrupt type 97 + * @ipa: IPA pointer 98 + * @ipa_irq: IPA interrupt ID 99 + */ 100 + void ipa_interrupt_disable(struct ipa *ipa, enum ipa_irq_id ipa_irq); 88 101 89 102 /** 90 103 * ipa_interrupt_config() - Configure the IPA interrupt framework
+5 -1
drivers/net/ipa/ipa_power.c
··· 337 337 338 338 ipa_interrupt_add(ipa->interrupt, IPA_IRQ_TX_SUSPEND, 339 339 ipa_suspend_handler); 340 + ipa_interrupt_enable(ipa, IPA_IRQ_TX_SUSPEND); 340 341 341 342 ret = device_init_wakeup(&ipa->pdev->dev, true); 342 - if (ret) 343 + if (ret) { 344 + ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND); 343 345 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND); 346 + } 344 347 345 348 return ret; 346 349 } ··· 351 348 void ipa_power_teardown(struct ipa *ipa) 352 349 { 353 350 (void)device_init_wakeup(&ipa->pdev->dev, false); 351 + ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND); 354 352 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND); 355 353 } 356 354
+4
drivers/net/ipa/ipa_uc.c
··· 187 187 ipa->uc_powered = false; 188 188 ipa->uc_loaded = false; 189 189 ipa_interrupt_add(interrupt, IPA_IRQ_UC_0, ipa_uc_interrupt_handler); 190 + ipa_interrupt_enable(ipa, IPA_IRQ_UC_0); 190 191 ipa_interrupt_add(interrupt, IPA_IRQ_UC_1, ipa_uc_interrupt_handler); 192 + ipa_interrupt_enable(ipa, IPA_IRQ_UC_1); 191 193 } 192 194 193 195 /* Inverse of ipa_uc_config() */ ··· 197 195 { 198 196 struct device *dev = &ipa->pdev->dev; 199 197 198 + ipa_interrupt_disable(ipa, IPA_IRQ_UC_1); 200 199 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_1); 200 + ipa_interrupt_disable(ipa, IPA_IRQ_UC_0); 201 201 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_0); 202 202 if (ipa->uc_loaded) 203 203 ipa_power_retention(ipa, false);