On Thu, Jun 23, 2022 at 03:53:09PM +0200, Amadeusz Sławiński wrote:
On 6/9/2022 4:18 PM, Mark Brown wrote:
On Thu, Jun 09, 2022 at 03:35:37PM +0200, Amadeusz Sławiński wrote:
The driver could use some cleanup of the interrupt handler, it currently unconditionally clears anything that fires and reports IRQ_HANDLED but should only report IRQ_HANDLED if there was anything from the device. Practically speaking it shouldn't make much difference unless there's spurious interrupts or the interrupt gets shared.
While this sounds fine, in tests I see that irq handler gets called around ~800 times per second even when we unload platform driver and there is no one caring about jack detection... in this case I would consider this to be a waste of CPU time and would prefer to just outright to disable it. Is there some better way to avoid unnecessary calls to irq handler?
Main reason why I even looked at this is pr_debug() present in rt298_jack_detect() which kept spamming our debug logs (~800 lines per second fills up logs rather fast...). It should probably be removed, as rt286 and rt274 do fine without having this logged, but they also call irq handler quite a lot if you add message log for debug.
If the jack detection is firing hundreds of times a second without there being an event that seems like a serious problem with the way the hardware is set up which should be fixed, I'm surprised that this isn't disrupting things normally.