net: ipa: directly disable ipa-setup-ready interrupt
authorAlex Elder <elder@linaro.org>
Tue, 23 Nov 2021 00:15:54 +0000 (18:15 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Dec 2021 08:04:50 +0000 (09:04 +0100)
commitf38aa5cfadf17fd7d67403d274faa00bb4a639ae
treea03df43193473ed28ec44b63e2bff8aff0cf1b28
parentda4d70199e5d82da664a80077508d6c18f5e76df
net: ipa: directly disable ipa-setup-ready interrupt

[ Upstream commit 33a153100bb3459479bd95d3259c2915b53fefa8 ]

We currently maintain a "disabled" Boolean flag to determine whether
the "ipa-setup-ready" SMP2P IRQ handler does anything.  That flag
must be accessed under protection of a mutex.

Instead, disable the SMP2P interrupt when requested, which prevents
the interrupt handler from ever being called.  More importantly, it
synchronizes a thread disabling the interrupt with the completion of
the interrupt handler in case they run concurrently.

Use the IPA setup_complete flag rather than the disabled flag in the
handler to determine whether to ignore any interrupts arriving after
the first.

Rename the "disabled" flag to be "setup_disabled", to be specific
about its purpose.

Fixes: 530f9216a953 ("soc: qcom: ipa: AP/modem communications")
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ipa/ipa_smp2p.c