diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/pci.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/pci.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 271f92c24d44..2c27f407a851 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c | |||
@@ -1441,7 +1441,7 @@ static void ath10k_pci_dump_registers(struct ath10k *ar, | |||
1441 | __le32 reg_dump_values[REG_DUMP_COUNT_QCA988X] = {}; | 1441 | __le32 reg_dump_values[REG_DUMP_COUNT_QCA988X] = {}; |
1442 | int i, ret; | 1442 | int i, ret; |
1443 | 1443 | ||
1444 | lockdep_assert_held(&ar->data_lock); | 1444 | lockdep_assert_held(&ar->dump_mutex); |
1445 | 1445 | ||
1446 | ret = ath10k_pci_diag_read_hi(ar, ®_dump_values[0], | 1446 | ret = ath10k_pci_diag_read_hi(ar, ®_dump_values[0], |
1447 | hi_failure_state, | 1447 | hi_failure_state, |
@@ -1656,7 +1656,7 @@ static void ath10k_pci_dump_memory(struct ath10k *ar, | |||
1656 | int ret, i; | 1656 | int ret, i; |
1657 | u8 *buf; | 1657 | u8 *buf; |
1658 | 1658 | ||
1659 | lockdep_assert_held(&ar->data_lock); | 1659 | lockdep_assert_held(&ar->dump_mutex); |
1660 | 1660 | ||
1661 | if (!crash_data) | 1661 | if (!crash_data) |
1662 | return; | 1662 | return; |
@@ -1734,14 +1734,19 @@ static void ath10k_pci_dump_memory(struct ath10k *ar, | |||
1734 | } | 1734 | } |
1735 | } | 1735 | } |
1736 | 1736 | ||
1737 | static void ath10k_pci_fw_crashed_dump(struct ath10k *ar) | 1737 | static void ath10k_pci_fw_dump_work(struct work_struct *work) |
1738 | { | 1738 | { |
1739 | struct ath10k_pci *ar_pci = container_of(work, struct ath10k_pci, | ||
1740 | dump_work); | ||
1739 | struct ath10k_fw_crash_data *crash_data; | 1741 | struct ath10k_fw_crash_data *crash_data; |
1742 | struct ath10k *ar = ar_pci->ar; | ||
1740 | char guid[UUID_STRING_LEN + 1]; | 1743 | char guid[UUID_STRING_LEN + 1]; |
1741 | 1744 | ||
1742 | spin_lock_bh(&ar->data_lock); | 1745 | mutex_lock(&ar->dump_mutex); |
1743 | 1746 | ||
1747 | spin_lock_bh(&ar->data_lock); | ||
1744 | ar->stats.fw_crash_counter++; | 1748 | ar->stats.fw_crash_counter++; |
1749 | spin_unlock_bh(&ar->data_lock); | ||
1745 | 1750 | ||
1746 | crash_data = ath10k_coredump_new(ar); | 1751 | crash_data = ath10k_coredump_new(ar); |
1747 | 1752 | ||
@@ -1756,11 +1761,18 @@ static void ath10k_pci_fw_crashed_dump(struct ath10k *ar) | |||
1756 | ath10k_ce_dump_registers(ar, crash_data); | 1761 | ath10k_ce_dump_registers(ar, crash_data); |
1757 | ath10k_pci_dump_memory(ar, crash_data); | 1762 | ath10k_pci_dump_memory(ar, crash_data); |
1758 | 1763 | ||
1759 | spin_unlock_bh(&ar->data_lock); | 1764 | mutex_unlock(&ar->dump_mutex); |
1760 | 1765 | ||
1761 | queue_work(ar->workqueue, &ar->restart_work); | 1766 | queue_work(ar->workqueue, &ar->restart_work); |
1762 | } | 1767 | } |
1763 | 1768 | ||
1769 | static void ath10k_pci_fw_crashed_dump(struct ath10k *ar) | ||
1770 | { | ||
1771 | struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); | ||
1772 | |||
1773 | queue_work(ar->workqueue, &ar_pci->dump_work); | ||
1774 | } | ||
1775 | |||
1764 | void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe, | 1776 | void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe, |
1765 | int force) | 1777 | int force) |
1766 | { | 1778 | { |
@@ -3442,6 +3454,8 @@ int ath10k_pci_setup_resource(struct ath10k *ar) | |||
3442 | spin_lock_init(&ar_pci->ps_lock); | 3454 | spin_lock_init(&ar_pci->ps_lock); |
3443 | mutex_init(&ar_pci->ce_diag_mutex); | 3455 | mutex_init(&ar_pci->ce_diag_mutex); |
3444 | 3456 | ||
3457 | INIT_WORK(&ar_pci->dump_work, ath10k_pci_fw_dump_work); | ||
3458 | |||
3445 | timer_setup(&ar_pci->rx_post_retry, ath10k_pci_rx_replenish_retry, 0); | 3459 | timer_setup(&ar_pci->rx_post_retry, ath10k_pci_rx_replenish_retry, 0); |
3446 | 3460 | ||
3447 | if (QCA_REV_6174(ar) || QCA_REV_9377(ar)) | 3461 | if (QCA_REV_6174(ar) || QCA_REV_9377(ar)) |