Re: [PATCH v3] net: mvneta: re-enable percpu interrupt on resume
From: Zhou, Yun <hidden>
Date: 2026-06-18 15:46:34
Also in:
lkml
On 6/18/2026 11:04 PM, Sebastian Andrzej Siewior wrote:
CAUTION: This email comes from a non Wind River email account! Do not click links or open attachments unless you recognize the sender and know the content is safe. On 2026-06-18 21:56:12 [+0800], Zhou, Yun wrote:quoted
The enable_percpu_irq() from mvneta_poll is not "lost" — it never gets a chance to execute. The sequence is: 1. mvneta_percpu_isr: disable_percpu_irq() + napi_schedule() 2. PM freezes kthreads (on PREEMPT_RT, softirq runs in kthread)But napi_schedule() runs in ksoftird, doesn't it? The per-CPU IRQs are not threaded. That does not look optimal.
Correct, percpu IRQs are not threaded. net_rx_action (which calls mvneta_poll and ultimately enable_percpu_irq) runs in softirq context via ksoftirqd.
quoted
3. NAPI poll cannot run → enable_percpu_irq() is never called 4. mvneta_stop_dev → napi_disable(): cancels the scheduled poll but does NOT execute the completion path (no enable_percpu_irq)napi_schedule() sets NAPIF_STATE_SCHED. napi_disable() sets NAPI_STATE_DISABLE and waits until NAPIF_STATE_SCHED is cleared. So if NAPIF_STATE_SCHED was set then enable_percpu_irq() will be invoked unless it leaves somewhere early. However, if DISABLED was already set then it disables the IRQ source but does not schedule NAPI. This is probably what happens.
Your analysis makes perfect sense, and that scenario is indeed much more likely. It looks like I'll need to update the commit message accordingly.
quoted
5. Resume → napi_enable(): resets NAPI state but MPIC stays masked The unconditional enable in resume covers this case. When NAPI was idle at suspend time, the extra enable is harmless.There is no desc::depth counting here, that got me confused. But that per-CPU irq is not optimal. Is this a SoC limitation or a design choice? Having a NAPI instance with IRQ per queue and those configured and spread among CPUs should cause less trouble and is what others do. In fact is the only net driver using per-CPU interrupts.
It is a SoC limitation. Armada XP's MPIC provides a single shared interrupt for the ethernet controller with per-CPU masking for interrupt steering — there are no per-queue MSI vectors. The percpu IRQ model was the only way to distribute interrupt handling across CPUs given this hardware constraint. Newer Marvell SoCs (armada3700+) moved away from this model and use standard IRQs, which is why the armada3700 path does not have this problem.