diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-10-08 14:45:25 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-10-09 10:14:55 -0400 |
commit | 60631c5c10efbf24a77e1ca1ddecdb4e82ed2833 (patch) | |
tree | 31202c3fc90a11936a8e41092d79562762d04c39 /drivers/net/wireless/ath/ath10k/debug.c | |
parent | a24b88b56074424a413acc2d2a517fb82f5e7c2f (diff) |
ath10k: fix ath10k_debug_start() locking
ath10k_debug_start() was not called with conf_mutex, fix that. Also there was a
deadlock in ath10k_debug_stop(), rename it to ath10k_debug_destroy() and call
it only when the device is destroyed.
Reported-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/debug.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 59615c7f217e..760ff2289e3c 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c | |||
@@ -618,6 +618,8 @@ int ath10k_debug_start(struct ath10k *ar) | |||
618 | { | 618 | { |
619 | int ret; | 619 | int ret; |
620 | 620 | ||
621 | lockdep_assert_held(&ar->conf_mutex); | ||
622 | |||
621 | ret = ath10k_debug_htt_stats_req(ar); | 623 | ret = ath10k_debug_htt_stats_req(ar); |
622 | if (ret) | 624 | if (ret) |
623 | /* continue normally anyway, this isn't serious */ | 625 | /* continue normally anyway, this isn't serious */ |
@@ -628,7 +630,13 @@ int ath10k_debug_start(struct ath10k *ar) | |||
628 | 630 | ||
629 | void ath10k_debug_stop(struct ath10k *ar) | 631 | void ath10k_debug_stop(struct ath10k *ar) |
630 | { | 632 | { |
631 | cancel_delayed_work_sync(&ar->debug.htt_stats_dwork); | 633 | lockdep_assert_held(&ar->conf_mutex); |
634 | |||
635 | /* Must not use _sync to avoid deadlock, we do that in | ||
636 | * ath10k_debug_destroy(). The check for htt_stats_mask is to avoid | ||
637 | * warning from del_timer(). */ | ||
638 | if (ar->debug.htt_stats_mask != 0) | ||
639 | cancel_delayed_work(&ar->debug.htt_stats_dwork); | ||
632 | } | 640 | } |
633 | 641 | ||
634 | int ath10k_debug_create(struct ath10k *ar) | 642 | int ath10k_debug_create(struct ath10k *ar) |
@@ -662,6 +670,11 @@ int ath10k_debug_create(struct ath10k *ar) | |||
662 | return 0; | 670 | return 0; |
663 | } | 671 | } |
664 | 672 | ||
673 | void ath10k_debug_destroy(struct ath10k *ar) | ||
674 | { | ||
675 | cancel_delayed_work_sync(&ar->debug.htt_stats_dwork); | ||
676 | } | ||
677 | |||
665 | #endif /* CONFIG_ATH10K_DEBUGFS */ | 678 | #endif /* CONFIG_ATH10K_DEBUGFS */ |
666 | 679 | ||
667 | #ifdef CONFIG_ATH10K_DEBUG | 680 | #ifdef CONFIG_ATH10K_DEBUG |