qdsp5: audio: Avoid Adsp ISR generation during audpp event processing

Audpp enable event is generated by adsp during audpp enable command
for the first playback session and from the second playback onwards
it gets generated by audpp driver as fake event with local irq
disabled. During audpp event processing decoder enable command is
sent to dsp and audio running flag is set. This finally leads to
NEEDS_DATA event generation by dsp. On response to NEEDS_DATA event
input bistream is sent only if audio running flag is set otherwise
this event ignored.

On Uniprocessor disabling local interrupt ensures that audpp event
handler doesn't get preempted during audpp enable/disable event
processing and audio->running flag is set before NEEDS_DATA event
from ADSP. But on Multi processor disabling local irq is not
sufficient as adsp interrupt for NEEDS_DATA may come on other core
before audio running flag has been set. This will result in NEEDS_DATA
being ignored if audio running flag is not set and input bitstream
will not be sent to Adsp for decoding, which is undesired.

To solve this, local irq disable needs to be replaced with adsp cmd
spin lock and audpp enable fake event needs to be generated with adsp
cmd spin lock acquired. Acquiring adsp cmd spin lock will ensure that
no other adsp event is triggered during fake event processing. As
adsp cmd spin lock is only accessible in adsp driver, generating fake
event from audpp driver is not possible. Hence moved fake event
generation logic to adsp driver.

Change-Id: Ia94f8bec14ca2c6d655481609ad88f2194c44b14
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
3 files changed