Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279235
b: refs/heads/master
c: fdb2858
h: refs/heads/master
i:
  279233: 422779f
  279231: a2b205a
v: v3
  • Loading branch information
Raja Mani authored and Kalle Valo committed Nov 21, 2011
1 parent 723d9dc commit 9f580d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 743b4518f9432e09ade6120ced414558969ba5fd
refs/heads/master: fdb28589b10f1bd4c407ea304399c2ff1cae1504
9 changes: 9 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ struct ath6kl_sdio {
struct bus_request bus_req[BUS_REQUEST_MAX_NUM];

struct ath6kl *ar;

u8 *dma_buffer;

/* protects access to dma_buffer */
struct mutex dma_buffer_mutex;

/* scatter request list head */
struct list_head scat_req;

Expand Down Expand Up @@ -395,6 +399,7 @@ static int ath6kl_sdio_read_write_sync(struct ath6kl *ar, u32 addr, u8 *buf,
if (buf_needs_bounce(buf)) {
if (!ar_sdio->dma_buffer)
return -ENOMEM;
mutex_lock(&ar_sdio->dma_buffer_mutex);
tbuf = ar_sdio->dma_buffer;
memcpy(tbuf, buf, len);
bounced = true;
Expand All @@ -405,6 +410,9 @@ static int ath6kl_sdio_read_write_sync(struct ath6kl *ar, u32 addr, u8 *buf,
if ((request & HIF_READ) && bounced)
memcpy(buf, tbuf, len);

if (bounced)
mutex_unlock(&ar_sdio->dma_buffer_mutex);

return ret;
}

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

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

0 comments on commit 9f580d5

Please sign in to comment.