aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2011-10-27 11:48:52 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 05:58:57 -0500
commitd60e8ab6b9bcbbb5eb7591c1989f8c79d6b3d964 (patch)
treed4f87bbe935e0606423cd64c930dce2ae3be569d
parent0c30295e4fd5436ad0bd78a6e0974dc4933e2ddb (diff)
ath6kl: add a timeout to ath6kl_hif_intr_bh_handler()
It's possible to busyloop forever in ath6kl_hif_intr_bh_handler(). Add a check that it lasts only one second. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath6kl/hif.c4
-rw-r--r--drivers/net/wireless/ath/ath6kl/hif.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index e2d808896b7f..309be9823e02 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -485,6 +485,7 @@ out:
485int ath6kl_hif_intr_bh_handler(struct ath6kl *ar) 485int ath6kl_hif_intr_bh_handler(struct ath6kl *ar)
486{ 486{
487 struct ath6kl_device *dev = ar->htc_target->dev; 487 struct ath6kl_device *dev = ar->htc_target->dev;
488 unsigned long timeout;
488 int status = 0; 489 int status = 0;
489 bool done = false; 490 bool done = false;
490 491
@@ -498,7 +499,8 @@ int ath6kl_hif_intr_bh_handler(struct ath6kl *ar)
498 * IRQ processing is synchronous, interrupt status registers can be 499 * IRQ processing is synchronous, interrupt status registers can be
499 * re-read. 500 * re-read.
500 */ 501 */
501 while (!done) { 502 timeout = jiffies + msecs_to_jiffies(ATH6KL_HIF_COMMUNICATION_TIMEOUT);
503 while (time_before(jiffies, timeout) && !done) {
502 status = proc_pending_irqs(dev, &done); 504 status = proc_pending_irqs(dev, &done);
503 if (status) 505 if (status)
504 break; 506 break;
diff --git a/drivers/net/wireless/ath/ath6kl/hif.h b/drivers/net/wireless/ath/ath6kl/hif.h
index ee7c31a4135a..78a6c79f8cab 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.h
+++ b/drivers/net/wireless/ath/ath6kl/hif.h
@@ -69,6 +69,8 @@
69#define ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER (16 * 1024) 69#define ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER (16 * 1024)
70#define ATH6KL_SCATTER_REQS 4 70#define ATH6KL_SCATTER_REQS 4
71 71
72#define ATH6KL_HIF_COMMUNICATION_TIMEOUT 1000
73
72struct bus_request { 74struct bus_request {
73 struct list_head list; 75 struct list_head list;
74 76