Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290252
b: refs/heads/master
c: 9d82682
h: refs/heads/master
v: v3
  • Loading branch information
Vasanthakumar Thiagarajan authored and Kalle Valo committed Jan 9, 2012
1 parent 99f9e51 commit 3f6ed45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 982767b8c94482b4b7f694e2ab2074c95fbf3e0e
refs/heads/master: 9d82682d45ef7407474e0ae043a587cb33a7fa26
19 changes: 9 additions & 10 deletions trunk/drivers/net/wireless/ath/ath6kl/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ struct ath6kl_sdio {
/* scatter request list head */
struct list_head scat_req;

/* Avoids disabling irq while the interrupts being handled */
struct mutex mtx_irq;

spinlock_t scat_lock;
bool scatter_enabled;

bool is_disabled;
atomic_t irq_handling;
const struct sdio_device_id *id;
struct work_struct wr_async_work;
struct list_head wr_asyncq;
Expand Down Expand Up @@ -460,8 +462,7 @@ static void ath6kl_sdio_irq_handler(struct sdio_func *func)
ath6kl_dbg(ATH6KL_DBG_SDIO, "irq\n");

ar_sdio = sdio_get_drvdata(func);
atomic_set(&ar_sdio->irq_handling, 1);

mutex_lock(&ar_sdio->mtx_irq);
/*
* Release the host during interrups so we can pick it back up when
* we process commands.
Expand All @@ -470,7 +471,7 @@ static void ath6kl_sdio_irq_handler(struct sdio_func *func)

status = ath6kl_hif_intr_bh_handler(ar_sdio->ar);
sdio_claim_host(ar_sdio->func);
atomic_set(&ar_sdio->irq_handling, 0);
mutex_unlock(&ar_sdio->mtx_irq);
WARN_ON(status && status != -ECANCELED);
}

Expand Down Expand Up @@ -578,17 +579,14 @@ static void ath6kl_sdio_irq_disable(struct ath6kl *ar)

sdio_claim_host(ar_sdio->func);

/* Mask our function IRQ */
while (atomic_read(&ar_sdio->irq_handling)) {
sdio_release_host(ar_sdio->func);
schedule_timeout(HZ / 10);
sdio_claim_host(ar_sdio->func);
}
mutex_lock(&ar_sdio->mtx_irq);

ret = sdio_release_irq(ar_sdio->func);
if (ret)
ath6kl_err("Failed to release sdio irq: %d\n", ret);

mutex_unlock(&ar_sdio->mtx_irq);

sdio_release_host(ar_sdio->func);
}

Expand Down Expand Up @@ -1253,6 +1251,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
spin_lock_init(&ar_sdio->scat_lock);
spin_lock_init(&ar_sdio->wr_async_lock);
mutex_init(&ar_sdio->dma_buffer_mutex);
mutex_init(&ar_sdio->mtx_irq);

INIT_LIST_HEAD(&ar_sdio->scat_req);
INIT_LIST_HEAD(&ar_sdio->bus_req_freeq);
Expand Down

0 comments on commit 3f6ed45

Please sign in to comment.