Re: [PATCH] ath6kl: Fix random system lockup
From: Kalle Valo <hidden>
Date: 2012-02-27 14:17:46
On 02/09/2012 09:27 AM, Vasanthakumar Thiagarajan wrote:
From: Raja Mani <redacted> The commit "ath6kl: Use a mutex_lock to avoid race in diabling and handling irq" introduces a state where ath6kl_sdio_irq_handler() would be waiting to claim the sdio function for receive indefinitely when things happen in the following order. ath6kl_sdio_irq_handler() - aquires mtx_irq - sdio_release_host() ath6kl_sdio_irq_disable() - sdio_claim_host() - sleep on mtx_irq ath6kl_hif_intr_bh_handler() - (indefinitely) wait for the sdio function to be released to exclusively claim it again for receive operation. Fix this by replacing the mtx_irq with an atomic variable and a wait_queue. Signed-off-by: Raja Mani <redacted> Signed-off-by: Vasanthakumar Thiagarajan <redacted>
I would really like to avoid using atomic variable if at all possible. I was trying to think other options and what if we take in ath6kl_sdio_irq_disable() mtx_irq before calling sdio_claim_host(). Wouldn't that solve the deadlock? Kalle