Skip to content

Commit 7a0f8ad

Browse files
author
Kalle Valo
committed
Merge ath-current from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git fixes for 5.1. Major changes: ath10k * fix locking problem with crashdump * fix warnings during suspend and resume
2 parents 5c40353 + 9e80ad3 commit 7a0f8ad

File tree

7 files changed

+31
-11
lines changed

7 files changed

+31
-11
lines changed

drivers/net/wireless/ath/ath10k/ce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ void ath10k_ce_dump_registers(struct ath10k *ar,
18551855
struct ath10k_ce_crash_data ce_data;
18561856
u32 addr, id;
18571857

1858-
lockdep_assert_held(&ar->data_lock);
1858+
lockdep_assert_held(&ar->dump_mutex);
18591859

18601860
ath10k_err(ar, "Copy Engine register dump:\n");
18611861

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3119,6 +3119,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
31193119
goto err_free_wq;
31203120

31213121
mutex_init(&ar->conf_mutex);
3122+
mutex_init(&ar->dump_mutex);
31223123
spin_lock_init(&ar->data_lock);
31233124

31243125
INIT_LIST_HEAD(&ar->peers);

drivers/net/wireless/ath/ath10k/core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,9 @@ struct ath10k {
10631063
/* prevents concurrent FW reconfiguration */
10641064
struct mutex conf_mutex;
10651065

1066+
/* protects coredump data */
1067+
struct mutex dump_mutex;
1068+
10661069
/* protects shared structure data */
10671070
spinlock_t data_lock;
10681071

drivers/net/wireless/ath/ath10k/coredump.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ struct ath10k_fw_crash_data *ath10k_coredump_new(struct ath10k *ar)
11021102
{
11031103
struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data;
11041104

1105-
lockdep_assert_held(&ar->data_lock);
1105+
lockdep_assert_held(&ar->dump_mutex);
11061106

11071107
if (ath10k_coredump_mask == 0)
11081108
/* coredump disabled */
@@ -1146,7 +1146,7 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar)
11461146
if (!buf)
11471147
return NULL;
11481148

1149-
spin_lock_bh(&ar->data_lock);
1149+
mutex_lock(&ar->dump_mutex);
11501150

11511151
dump_data = (struct ath10k_dump_file_data *)(buf);
11521152
strlcpy(dump_data->df_magic, "ATH10K-FW-DUMP",
@@ -1213,7 +1213,7 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar)
12131213
sofar += sizeof(*dump_tlv) + crash_data->ramdump_buf_len;
12141214
}
12151215

1216-
spin_unlock_bh(&ar->data_lock);
1216+
mutex_unlock(&ar->dump_mutex);
12171217

12181218
return dump_data;
12191219
}

drivers/net/wireless/ath/ath10k/mac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5774,7 +5774,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
57745774
}
57755775

57765776
if (changed & BSS_CHANGED_MCAST_RATE &&
5777-
!WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) {
5777+
!ath10k_mac_vif_chan(arvif->vif, &def)) {
57785778
band = def.chan->band;
57795779
rateidx = vif->bss_conf.mcast_rate[band] - 1;
57805780

@@ -5812,7 +5812,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
58125812
}
58135813

58145814
if (changed & BSS_CHANGED_BASIC_RATES) {
5815-
if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) {
5815+
if (ath10k_mac_vif_chan(vif, &def)) {
58165816
mutex_unlock(&ar->conf_mutex);
58175817
return;
58185818
}

drivers/net/wireless/ath/ath10k/pci.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ static void ath10k_pci_dump_registers(struct ath10k *ar,
14411441
__le32 reg_dump_values[REG_DUMP_COUNT_QCA988X] = {};
14421442
int i, ret;
14431443

1444-
lockdep_assert_held(&ar->data_lock);
1444+
lockdep_assert_held(&ar->dump_mutex);
14451445

14461446
ret = ath10k_pci_diag_read_hi(ar, &reg_dump_values[0],
14471447
hi_failure_state,
@@ -1656,7 +1656,7 @@ static void ath10k_pci_dump_memory(struct ath10k *ar,
16561656
int ret, i;
16571657
u8 *buf;
16581658

1659-
lockdep_assert_held(&ar->data_lock);
1659+
lockdep_assert_held(&ar->dump_mutex);
16601660

16611661
if (!crash_data)
16621662
return;
@@ -1734,14 +1734,19 @@ static void ath10k_pci_dump_memory(struct ath10k *ar,
17341734
}
17351735
}
17361736

1737-
static void ath10k_pci_fw_crashed_dump(struct ath10k *ar)
1737+
static void ath10k_pci_fw_dump_work(struct work_struct *work)
17381738
{
1739+
struct ath10k_pci *ar_pci = container_of(work, struct ath10k_pci,
1740+
dump_work);
17391741
struct ath10k_fw_crash_data *crash_data;
1742+
struct ath10k *ar = ar_pci->ar;
17401743
char guid[UUID_STRING_LEN + 1];
17411744

1742-
spin_lock_bh(&ar->data_lock);
1745+
mutex_lock(&ar->dump_mutex);
17431746

1747+
spin_lock_bh(&ar->data_lock);
17441748
ar->stats.fw_crash_counter++;
1749+
spin_unlock_bh(&ar->data_lock);
17451750

17461751
crash_data = ath10k_coredump_new(ar);
17471752

@@ -1756,11 +1761,18 @@ static void ath10k_pci_fw_crashed_dump(struct ath10k *ar)
17561761
ath10k_ce_dump_registers(ar, crash_data);
17571762
ath10k_pci_dump_memory(ar, crash_data);
17581763

1759-
spin_unlock_bh(&ar->data_lock);
1764+
mutex_unlock(&ar->dump_mutex);
17601765

17611766
queue_work(ar->workqueue, &ar->restart_work);
17621767
}
17631768

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+
17641776
void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe,
17651777
int force)
17661778
{
@@ -3442,6 +3454,8 @@ int ath10k_pci_setup_resource(struct ath10k *ar)
34423454
spin_lock_init(&ar_pci->ps_lock);
34433455
mutex_init(&ar_pci->ce_diag_mutex);
34443456

3457+
INIT_WORK(&ar_pci->dump_work, ath10k_pci_fw_dump_work);
3458+
34453459
timer_setup(&ar_pci->rx_post_retry, ath10k_pci_rx_replenish_retry, 0);
34463460

34473461
if (QCA_REV_6174(ar) || QCA_REV_9377(ar))

drivers/net/wireless/ath/ath10k/pci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ struct ath10k_pci {
121121
/* For protecting ce_diag */
122122
struct mutex ce_diag_mutex;
123123

124+
struct work_struct dump_work;
125+
124126
struct ath10k_ce ce;
125127
struct timer_list rx_post_retry;
126128

0 commit comments

Comments
 (0)