serial: msm_geni_serial: Fix geni_wait_for_cmd_done timeouts
geni_wait_for_cmd_done API is using msm_geni_spinlocked API
to check uport->lock(spinlock) status. If lock is available,
driver relies on interrupt otherwise driver decides
to go for polling mode.
In case of oops_in_progress when msm_geni_serial_console_write
checks if lock is not available or taken by the other core then
console_write disabling the interrupt and calling geni_wait_for_cmd_done().
After that spin_lock acquired by other core has been released and
waiting for interrupt to be fired with interrupt disabled.
As interrupts are already disabled, wait_for_completion is getting timeout
due to race condition.
To fix this checking the return value of msm_serial_try_disable_interrupts
function and using that as an argument for geni_wait_for_cmd_done to
to decide wait for interrupt or need to poll.
Also fix spin_unlock_irqrestore flags handling in handle_rx_console
function.
Console Printk() can be called from any context(idle thread or interrupt)
and blocking is not allowed. Hence handle cancel TX in
console_write in polling mode.
Change-Id: Ia1eeaadadd9dd8090bef89e32654000b144e348b
Signed-off-by:
Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
Loading
Please register or sign in to comment