All of lore.kernel.org
 help / color / mirror / Atom feed
* The MHI interrupt handling issue
@ 2020-12-07 13:20 Loic Poulain
  2020-12-07 15:48 ` Jeffrey Hugo
  0 siblings, 1 reply; 4+ messages in thread
From: Loic Poulain @ 2020-12-07 13:20 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Hemant Kumar, Bhaumik Bhatt, Jeffrey Hugo
  Cc: linux-arm-msm

Hi folks,

Before putting my hands into that, I wanted to expose a MHI interrupt
problem, comments are welcome.

Currently, the hard IRQ handler for event rings do nothing except
triggering a tasklet as bottom half that in turn will take care of
retrieving buffer(s). That leads to have an unexpected high amount of
interrupts when I perform throughput testing with mhi-net (though it
applies for any mhi client driver).

The point is that usually, an hard interrupt handler is responsible
for triggering the bottom half handler but also for
clearing/suspending interrupt on device side. However, AFAIK, there is
no such possibility in the MHI protocol. Since the interrupt is not
handled in the hard irq handler, it is triggered again once interrupt
are re-enabled, and even during the tasklet execution... at the end,
that makes a lot of unnecessary interrupts, that introduce latency and
participate to system load...

I added some printk to highlight that issue:
[11564.689202] mhi_irq_handler 55d32b8
[11564.689485] mhi_irq_handler 55d32b8
[11564.690011] mhi_irq_handler 55d32b8
[11564.690397] [55d32b8] mhi_process_data_event_ring start
[11564.690667] mhi_irq_handler 55d32b8
[11564.690937] mhi_irq_handler 55d32b8
[11564.691207] mhi_irq_handler 55d32b8
[11564.691475] mhi_irq_handler 55d32b8
[11564.692076] [55d32b8] mhi_process_data_event_ring done
[...]

I see two solutions to fix that problem:
- Manage events directly in the hard-irq handler (no more tasklet)
- Use threaded IRQ with IRQF_ONESHOT flag, to keep interrupt masked
until threaded handler has completed.

Regards,
Loic

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-07 21:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-07 13:20 The MHI interrupt handling issue Loic Poulain
2020-12-07 15:48 ` Jeffrey Hugo
2020-12-07 17:02   ` Loic Poulain
2020-12-07 21:07     ` Bhaumik Bhatt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.