Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369843
b: refs/heads/master
c: c1c999e
h: refs/heads/master
i:
  369841: 10f6bbe
  369839: a6e8fd1
v: v3
  • Loading branch information
Andreas Fenkart authored and Gustavo Padovan committed Apr 23, 2013
1 parent 5770fcc commit 5842f52
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 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: 9da226c7919aaed40e0195f0b7c7713ed00e380f
refs/heads/master: c1c999e27ce5681c5b43c7f82947030e7134f1d0
18 changes: 12 additions & 6 deletions trunk/drivers/bluetooth/btmrvl_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ static int btmrvl_sdio_verify_fw_download(struct btmrvl_sdio_card *card,

/* Wait for firmware to become ready */
for (tries = 0; tries < pollnum; tries++) {
if (btmrvl_sdio_read_fw_status(card, &firmwarestat) < 0)
sdio_claim_host(card->func);
ret = btmrvl_sdio_read_fw_status(card, &firmwarestat);
sdio_release_host(card->func);
if (ret < 0)
continue;

if (firmwarestat == FIRMWARE_READY) {
Expand Down Expand Up @@ -882,13 +885,14 @@ static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card)
BT_ERR("card or function is NULL!");
return -EINVAL;
}
sdio_claim_host(card->func);

if (!btmrvl_sdio_verify_fw_download(card, 1)) {
BT_DBG("Firmware already downloaded!");
goto done;
return 0;
}

sdio_claim_host(card->func);

/* Check if other function driver is downloading the firmware */
fws0 = sdio_readb(card->func, card->reg->card_fw_status0, &ret);
if (ret) {
Expand Down Expand Up @@ -918,15 +922,17 @@ static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card)
}
}

sdio_release_host(card->func);

if (btmrvl_sdio_verify_fw_download(card, pollnum)) {
BT_ERR("FW failed to be active in time!");
ret = -ETIMEDOUT;
goto done;
return -ETIMEDOUT;
}

return 0;

done:
sdio_release_host(card->func);

return ret;
}

Expand Down

0 comments on commit 5842f52

Please sign in to comment.