Skip to contentSkip to conversation

wifi: ath11k: release peer accounting on peer delete timeout

PATCH Superseded Michael Pfeifroth 2 participants 7 messages Sep 22 – Oct 8 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: ath11k: release peer accounting on peer delete timeout

On some deployments access points intermittently stop accepting new station associations after several hours of uptime with frequent roaming/reconnects. The kernel logs

ath11k_pci ....: failed to create peer due to insufficient peer entry resource in firmware

and hostapd reports "Could not add STA to kernel driver". A "wifi down/up" (radio restart) on the affected radio restores service.

Despite the message text, this is not a firmware peer-table exhaustion. The message is emitted by the driver-side gate in ath11k_peer_create():

	if (ar->num_peers > (ar->max_num_peers - 1))

i.e. the driver's own ar->num_peers accounting has leaked and reached the ceiling. It is always preceded by a peer-delete that timed out:

ath11k_pci ....: invalid vdev id in peer delete resp ev 1 ath11k_pci ....: Timeout in receiving peer delete response ath11k_pci ....: failed to delete peer vdev_id .. addr .. ret -110

On such a timeout __ath11k_peer_delete() returns early without removing the local peer object, and ath11k_peer_delete() consequently skips the ar->num_peers-- decrement (it only runs on the success path). The normal free happens asynchronously in ath11k_peer_unmap_event(), which never runs when the delete response is lost or misrouted (e.g. because the vdev is already gone by the time the response is processed, hence the "invalid vdev id in peer delete resp ev" warning). Each timed-out delete therefore leaks one ar->num_peers slot until max_num_peers is reached and all further ath11k_peer_create() calls fail.

Free the local peer on the timeout path and return success so that ath11k_peer_delete() releases the num_peers slot. The peer has already been removed from the rhash earlier in __ath11k_peer_delete(), so only the list removal and free remain, mirroring ath11k_peer_unmap_event(). A late unmap event will then simply fail to find the peer id and log a harmless warning instead of touching freed memory.

The problem was reproduced deterministically with a fault-injection patch that forces the peer-delete wait to time out: after max_num_peers such deletes the AP permanently rejects new stations, and with this change it keeps accepting them.

Fixes 690ace20ff79 ("ath11k: peer delete synchronization with firmware")
---
 drivers/net/wireless/ath/ath11k/peer.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/peer.c +14 -2
index b30a906..ed2d7d8 100644
@@ -341,8 +341,20 @@ static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr)
 	}
 
 	ret = ath11k_wait_for_peer_delete_done(ar, vdev_id, addr);
-	if (ret)
-		return ret;
+	if (ret) {
+		/* The firmware delete confirmation was lost; free the local
+		 * peer here (already removed from the rhash above) so that
+		 * ath11k_peer_delete() releases the ar->num_peers slot instead
+		 * of leaking it.
+		 */
+		spin_lock_bh(&ab->base_lock);
+		peer = ath11k_peer_find(ab, vdev_id, addr);
+		if (peer) {
+			list_del(&peer->list);
+			kfree(peer);
+		}
+		spin_unlock_bh(&ab->base_lock);
+	}
 
 	return 0;
 }
Signature · 1 line
2.34.1
#1 lore raw
Quoted 17 lines · Michael Pfeifroth

On some deployments access points intermittently stop accepting new station associations after several hours of uptime with frequent roaming/reconnects. The kernel logs

ath11k_pci ....: failed to create peer due to insufficient peer entry resource in firmware

and hostapd reports "Could not add STA to kernel driver". A "wifi down/up" (radio restart) on the affected radio restores service.

Despite the message text, this is not a firmware peer-table exhaustion. The message is emitted by the driver-side gate in ath11k_peer_create():

	if (ar->num_peers > (ar->max_num_peers - 1))

i.e. the driver's own ar->num_peers accounting has leaked and reached the ceiling. It is always preceded by a peer-delete that timed out:

Quoted 8 lines

ath11k_pci ....: invalid vdev id in peer delete resp ev 1 ath11k_pci ....: Timeout in receiving peer delete response ath11k_pci ....: failed to delete peer vdev_id .. addr .. ret -110

On such a timeout __ath11k_peer_delete() returns early without removing the local peer object, and ath11k_peer_delete() consequently skips the ar->num_peers-- decrement (it only runs on the success path). The normal free happens asynchronously in ath11k_peer_unmap_event(), which never

Hmm, I don't think so. host waits for peer unmap event in ath11k_wait_for_peer_deleted(), before waiting for peer delete response. Since there is no "failed wait for peer deleted" log, unmap event is good and ath11k_peer_unmap_event() runs.

Quoted 1 line

runs when the delete response is lost or misrouted (e.g. because the

what does 'misrouted' mean?

Quoted 1 line

vdev is already gone by the time the response is processed, hence the

I have never seen it, but yeas it can happen theoretically.

Quoted 10 lines

"invalid vdev id in peer delete resp ev" warning). Each timed-out delete therefore leaks one ar->num_peers slot until max_num_peers is reached and all further ath11k_peer_create() calls fail.

Free the local peer on the timeout path and return success so that ath11k_peer_delete() releases the num_peers slot. The peer has already been removed from the rhash earlier in __ath11k_peer_delete(), so only the list removal and free remain, mirroring ath11k_peer_unmap_event(). A late unmap event will then simply fail to find the peer id and log a harmless warning instead of touching freed memory.

As stated above peer unmap is good hence peer is already freed there. The code here frees peer only when it indeed not freed.

Quoted 2 lines

The problem was reproduced deterministically with a fault-injection

curious what the patch does? does it modify ath11k codebase?

Quoted 16 lines

patch that forces the peer-delete wait to time out: after max_num_peers such deletes the AP permanently rejects new stations, and with this change it keeps accepting them.

Fixes 690ace20ff79 ("ath11k: peer delete synchronization with firmware")
---
 drivers/net/wireless/ath/ath11k/peer.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/peer.c +0 -0
index b30a906..ed2d7d8 100644

drivers/net/wireless/ath/ath11k/peer.c static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr) · line 345

Quoted 7 lines
drivers/net/wireless/ath/ath11k/peer.c +2 -2
@@ -341,8 +341,20 @@ static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr)
 	}
 
 	ret = ath11k_wait_for_peer_delete_done(ar, vdev_id, addr);
-	if (ret)
-		return ret;
+	if (ret) {
+		/* The firmware delete confirmation was lost; free the local

ath11k now follows networking subsystem comment style and it prefers a '/*' by itself on the first line.

drivers/net/wireless/ath/ath11k/peer.c static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr) · line 348

Quoted 3 lines
drivers/net/wireless/ath/ath11k/peer.c +3 -0
+		 * peer here (already removed from the rhash above) so that
+		 * ath11k_peer_delete() releases the ar->num_peers slot instead
+		 * of leaking it.

the comment needs rephrase to reflect that peer delete needed only when it not freed yet.

Quoted 12 lines
drivers/net/wireless/ath/ath11k/peer.c +9 -0
+		 */
+		spin_lock_bh(&ab->base_lock);
+		peer = ath11k_peer_find(ab, vdev_id, addr);
+		if (peer) {
+			list_del(&peer->list);
+			kfree(peer);
+		}
+		spin_unlock_bh(&ab->base_lock);
+	}
 
 	return 0;
 }
#2 lore raw
Quoted 7 lines · Baochen Qiang
Quoted 4 lines

On such a timeout __ath11k_peer_delete() returns early without removing the local peer object, and ath11k_peer_delete() consequently skips the ar->num_peers-- decrement (it only runs on the success path). The normal free happens asynchronously in ath11k_peer_unmap_event(), which never

Hmm, I don't think so. host waits for peer unmap event in ath11k_wait_for_peer_deleted(), before waiting for peer delete response. Since there is no "failed wait for peer deleted" log, unmap event is good and ath11k_peer_unmap_event() runs.

You are right, thanks. The unmap event is received, so the peer is already removed from ab->peers and freed; what actually leaks is only the ar->num_peers counter, because __ath11k_peer_delete() returns -ETIMEDOUT from the *second* wait (the delete-response completion) and ath11k_peer_delete() therefore skips the num_peers-- decrement.

So the essential fix is to return success on the timeout path. The list_del()/kfree() is only a safety net for the other timeout case, where ath11k_wait_for_peer_deleted() itself times out and no unmap event ever removed the peer; that is why it is guarded by "if (peer)". I have reworded the commit message and the code comment accordingly in v2.

Quoted 2 lines
Quoted 1 line

runs when the delete response is lost or misrouted (e.g. because the

what does 'misrouted' mean?

Poor wording on my side, dropped in v2. What I meant is the case you describe below: the delete-response event is dropped in ath11k_peer_delete_resp_event() because ath11k_mac_get_ar_by_vdev_id() cannot resolve the vdev id (the "invalid vdev id in peer delete resp ev" warning), so complete(&ar->peer_delete_done) is never called and the wait times out even though firmware did delete the peer.

Quoted 2 lines
Quoted 1 line

The problem was reproduced deterministically with a fault-injection

curious what the patch does? does it modify ath11k codebase?

Yes, it is an out-of-tree debug-only patch (not part of this submission). It adds a few module parameters to ath11k: one forces the next N ath11k_wait_for_peer_delete_done() calls to return -ETIMEDOUT, and one caps max_num_peers so the ceiling is hit after only a few deletes. With the counter leak in place the AP stops accepting new stations after max_num_peers forced timeouts; with this fix it keeps accepting them.

I have addressed the comment style (/* on its own first line) in v2 as well. v2 follows shortly.

Thanks,
Michael

#3 lore raw

PATCH v2 1/1 wifi: ath11k: release peer accounting on peer delete timeout

In reply to Baochen Qiang

On some deployments access points intermittently stop accepting new station associations after several hours of uptime with frequent roaming/reconnects. The kernel logs

ath11k_pci ....: failed to create peer due to insufficient peer entry resource in firmware

and hostapd reports "Could not add STA to kernel driver". A "wifi down/up" (radio restart) on the affected radio restores service.

Despite the message text, this is not a firmware peer-table exhaustion. The message is emitted by the driver-side gate in ath11k_peer_create():

	if (ar->num_peers > (ar->max_num_peers - 1))

i.e. the driver's own ar->num_peers accounting has leaked and reached the ceiling. It is always preceded by a peer-delete that timed out:

ath11k_pci ....: invalid vdev id in peer delete resp ev 1 ath11k_pci ....: Timeout in receiving peer delete response ath11k_pci ....: failed to delete peer vdev_id .. addr .. ret -110

ath11k_peer_delete() only decrements ar->num_peers when __ath11k_peer_delete() returns 0. On a delete timeout __ath11k_peer_delete() returns -ETIMEDOUT, so the decrement is skipped and one num_peers slot is leaked per event. After max_num_peers such timeouts ath11k_peer_create() rejects every new station until the radio is restarted.

In the observed case the peer-unmap event is received normally (there is no "failed wait for peer deleted" log), so ath11k_peer_unmap_event() has already removed the peer from ab->peers and freed it; only the num_peers counter is left wrong. The delete-response completion is missed because the response event is dropped in ath11k_peer_delete_resp_event() when ath11k_mac_get_ar_by_vdev_id() cannot resolve the vdev ("invalid vdev id in peer delete resp ev"), so ar->peer_delete_done is never signalled and the second wait in ath11k_wait_for_peer_delete_done() times out.

Return success from __ath11k_peer_delete() on the timeout path so that ath11k_peer_delete() releases the num_peers slot. As a safety net also drop the local peer if it is still on the list; that only happens in the other timeout case, where ath11k_wait_for_peer_deleted() itself timed out and no unmap event removed the peer. The peer has already been removed from the rhash earlier in __ath11k_peer_delete(), so only the list removal and free remain, mirroring ath11k_peer_unmap_event(). A late unmap event would then simply fail to find the peer id and log a harmless warning instead of touching freed memory.

The problem was reproduced deterministically with an out-of-tree debug patch that adds module parameters to force ath11k_wait_for_peer_delete_done() to return -ETIMEDOUT and to cap
max_num_peers: after max_num_peers such deletes the AP permanently rejects new stations, and with this change it keeps accepting them.

Fixes 690ace20ff79 ("ath11k: peer delete synchronization with firmware")

---
v2:
- Correct the root-cause description: the peer-unmap event is received normally, so the peer is already freed; only the num_peers counter leaks (Baochen Qiang).
- Explain that the missed delete-response completion is due to the event being dropped on an unresolved vdev id, replacing the vague "misrouted" wording.
- Rework the code comment and switch to netdev comment style.

 drivers/net/wireless/ath/ath11k/peer.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/peer.c +15 -2
index b30a906..f93a8da 100644
@@ -341,8 +341,21 @@ static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr)
 	}
 
 	ret = ath11k_wait_for_peer_delete_done(ar, vdev_id, addr);
-	if (ret)
-		return ret;
+	if (ret) {
+		/*
+		 * The delete timed out. The peer is normally already freed by
+		 * the unmap event; drop it here only if it is still on the
+		 * list. Either way return success so that ath11k_peer_delete()
+		 * releases the num_peers slot instead of leaking it.
+		 */
+		spin_lock_bh(&ab->base_lock);
+		peer = ath11k_peer_find(ab, vdev_id, addr);
+		if (peer) {
+			list_del(&peer->list);
+			kfree(peer);
+		}
+		spin_unlock_bh(&ab->base_lock);
+	}
 
 	return 0;
 }
Signature · 1 line
2.34.1
#4 lore raw
Quoted 47 lines · Michael Pfeifroth

On some deployments access points intermittently stop accepting new station associations after several hours of uptime with frequent roaming/reconnects. The kernel logs

ath11k_pci ....: failed to create peer due to insufficient peer entry resource in firmware

and hostapd reports "Could not add STA to kernel driver". A "wifi down/up" (radio restart) on the affected radio restores service.

Despite the message text, this is not a firmware peer-table exhaustion. The message is emitted by the driver-side gate in ath11k_peer_create():

	if (ar->num_peers > (ar->max_num_peers - 1))

i.e. the driver's own ar->num_peers accounting has leaked and reached the ceiling. It is always preceded by a peer-delete that timed out:

ath11k_pci ....: invalid vdev id in peer delete resp ev 1 ath11k_pci ....: Timeout in receiving peer delete response ath11k_pci ....: failed to delete peer vdev_id .. addr .. ret -110

ath11k_peer_delete() only decrements ar->num_peers when __ath11k_peer_delete() returns 0. On a delete timeout __ath11k_peer_delete() returns -ETIMEDOUT, so the decrement is skipped and one num_peers slot is leaked per event. After max_num_peers such timeouts ath11k_peer_create() rejects every new station until the radio is restarted.

In the observed case the peer-unmap event is received normally (there is no "failed wait for peer deleted" log), so ath11k_peer_unmap_event() has already removed the peer from ab->peers and freed it; only the num_peers counter is left wrong. The delete-response completion is missed because the response event is dropped in ath11k_peer_delete_resp_event() when ath11k_mac_get_ar_by_vdev_id() cannot resolve the vdev ("invalid vdev id in peer delete resp ev"), so ar->peer_delete_done is never signalled and the second wait in ath11k_wait_for_peer_delete_done() times out.

Return success from __ath11k_peer_delete() on the timeout path so that ath11k_peer_delete() releases the num_peers slot. As a safety net also drop the local peer if it is still on the list; that only happens in the other timeout case, where ath11k_wait_for_peer_deleted() itself timed out and no unmap event removed the peer. The peer has already been removed from the rhash earlier in __ath11k_peer_delete(), so only the list removal and free remain, mirroring ath11k_peer_unmap_event(). A late unmap event would then simply fail to find the peer id and log a harmless warning instead of touching freed memory.

Quoted 5 lines

The problem was reproduced deterministically with an out-of-tree debug patch that adds module parameters to force ath11k_wait_for_peer_delete_done() to return -ETIMEDOUT and to cap
max_num_peers: after max_num_peers such deletes the AP permanently rejects new stations, and with this change it keeps accepting them.

though the last paragraph explicitly says the issue is artificial, most of the commit message still reads like a real world bug ...

I think it would be better to rephrase as something like 'Theoretically, if peer unmap event is good but peer delete fails ...'

Quoted 3 lines
Fixes 690ace20ff79 ("ath11k: peer delete synchronization with firmware")

I don't think it qualifies for stable backport since it is not a real world issue.

Quoted 27 lines

---
v2:
- Correct the root-cause description: the peer-unmap event is received normally, so the peer is already freed; only the num_peers counter leaks (Baochen Qiang).
- Explain that the missed delete-response completion is due to the event being dropped on an unresolved vdev id, replacing the vague "misrouted" wording.
- Rework the code comment and switch to netdev comment style.

 drivers/net/wireless/ath/ath11k/peer.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/peer.c +4 -2
index b30a906..f93a8da 100644
@@ -341,8 +341,21 @@ static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr)
 	}
 
 	ret = ath11k_wait_for_peer_delete_done(ar, vdev_id, addr);
-	if (ret)
-		return ret;
+	if (ret) {
+		/*
+		 * The delete timed out. The peer is normally already freed by
+		 * the unmap event; drop it here only if it is still on the

drivers/net/wireless/ath/ath11k/peer.c static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr) · line 357

Quoted 10 lines
drivers/net/wireless/ath/ath11k/peer.c +10 -0
+		 * list. Either way return success so that ath11k_peer_delete()
+		 * releases the num_peers slot instead of leaking it.
+		 */
+		spin_lock_bh(&ab->base_lock);
+		peer = ath11k_peer_find(ab, vdev_id, addr);
+		if (peer) {
+			list_del(&peer->list);
+			kfree(peer);
+		}
+		spin_unlock_bh(&ab->base_lock);

except for the firmware crash case, this is exactly what is done in ath11k_wait_for_peer_deleted(), so if that function succeeds the peer is definitely removed and freed already, so this is actually dead code.

as for the crash case, all peers are cleaned up in recovery path so we don't need to do remove/free as well.

Quoted 4 lines
drivers/net/wireless/ath/ath11k/peer.c +1 -0
+	}
 
 	return 0;
 }
#5 lore raw

PATCH v3 1/1 wifi: ath11k: release peer accounting on peer delete timeout

ath11k_peer_delete() only decrements ar->num_peers when __ath11k_peer_delete() returns 0. On a peer-delete-confirmation timeout __ath11k_peer_delete() returns -ETIMEDOUT, so the decrement is skipped and one ar->num_peers slot is leaked. Once enough slots have leaked the ar->num_peers > (ar->max_num_peers - 1) gate in ath11k_peer_create() rejects every new station with "insufficient peer entry resource in firmware", and the AP stops accepting associations until the radio is restarted with a wifi down/up.

This was observed in the field on an AP after hours of uptime with frequent roaming and reconnects: clients could no longer associate even though the firmware peer table was not actually exhausted, only the host-side ar->num_peers accounting had leaked.

The delete-confirmation timeout itself is otherwise harmless. The host first waits for the peer unmap event in ath11k_wait_for_peer_deleted(), so by the time the delete-response completion times out the peer has already been removed from ab->peers and freed by ath11k_peer_unmap_event(). Only the ar->num_peers counter is left inconsistent.

The timeout is reached when the peer unmap event arrives but the peer delete response is missed, e.g. because the response event is dropped in ath11k_peer_delete_resp_event() on an unresolved vdev id (logged as "invalid vdev id in peer delete resp ev"). Do not treat the delete confirmation timeout as fatal so that ath11k_peer_delete() releases the ar->num_peers slot instead of leaking it.

Fixes 690ace20ff79 ("ath11k: peer delete synchronization with firmware")

---
v3:
- Drop the defensive peer list_del()/kfree() branch; it is dead code since the peer is already freed via the unmap event or on recovery (Baochen Qiang), leaving a minimal fix that just ignores the delete timeout.
- Reframe the commit message around the field-observed num_peers leak and the resulting station association failures.
v2:
- Correct the root-cause description and switch to netdev comment style.

 drivers/net/wireless/ath/ath11k/peer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/peer.c +4 -3
index b30a906..f573a2c 100644
@@ -340,9 +340,10 @@ static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr)
 		return ret;
 	}
 
-	ret = ath11k_wait_for_peer_delete_done(ar, vdev_id, addr);
-	if (ret)
-		return ret;
+	/* Ignore the return value: the peer is already freed, only its
+	 * ar->num_peers slot would otherwise leak on a delete timeout.
+	 */
+	ath11k_wait_for_peer_delete_done(ar, vdev_id, addr);
 
 	return 0;
 }
Signature · 1 line
2.34.1
#6 lore raw
Quoted 49 lines · Michael Pfeifroth

ath11k_peer_delete() only decrements ar->num_peers when __ath11k_peer_delete() returns 0. On a peer-delete-confirmation timeout __ath11k_peer_delete() returns -ETIMEDOUT, so the decrement is skipped and one ar->num_peers slot is leaked. Once enough slots have leaked the ar->num_peers > (ar->max_num_peers - 1) gate in ath11k_peer_create() rejects every new station with "insufficient peer entry resource in firmware", and the AP stops accepting associations until the radio is restarted with a wifi down/up.

This was observed in the field on an AP after hours of uptime with frequent roaming and reconnects: clients could no longer associate even though the firmware peer table was not actually exhausted, only the host-side ar->num_peers accounting had leaked.

The delete-confirmation timeout itself is otherwise harmless. The host first waits for the peer unmap event in ath11k_wait_for_peer_deleted(), so by the time the delete-response completion times out the peer has already been removed from ab->peers and freed by ath11k_peer_unmap_event(). Only the ar->num_peers counter is left inconsistent.

The timeout is reached when the peer unmap event arrives but the peer delete response is missed, e.g. because the response event is dropped in ath11k_peer_delete_resp_event() on an unresolved vdev id (logged as "invalid vdev id in peer delete resp ev"). Do not treat the delete confirmation timeout as fatal so that ath11k_peer_delete() releases the ar->num_peers slot instead of leaking it.

Fixes 690ace20ff79 ("ath11k: peer delete synchronization with firmware")

---
v3:
- Drop the defensive peer list_del()/kfree() branch; it is dead code since the peer is already freed via the unmap event or on recovery (Baochen Qiang), leaving a minimal fix that just ignores the delete timeout.
- Reframe the commit message around the field-observed num_peers leak and the resulting station association failures.
v2:
- Correct the root-cause description and switch to netdev comment style.

 drivers/net/wireless/ath/ath11k/peer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/peer.c +0 -0
index b30a906..f573a2c 100644

drivers/net/wireless/ath/ath11k/peer.c static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr) · line 346

Quoted 10 lines
drivers/net/wireless/ath/ath11k/peer.c +4 -3
@@ -340,9 +340,10 @@ static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr)
 		return ret;
 	}
 
-	ret = ath11k_wait_for_peer_delete_done(ar, vdev_id, addr);
-	if (ret)
-		return ret;
+	/* Ignore the return value: the peer is already freed, only its
+	 * ar->num_peers slot would otherwise leak on a delete timeout.
+	 */
+	ath11k_wait_for_peer_delete_done(ar, vdev_id, addr);

as stated in the commit message, the purpose is to ease the case where firmware peer table is not exhausted but host's table is, however the change here is to ignore the return value by default, regardless of whether firmware peer table has free slots. So what about ath11k_wait_for_peer_delete_done() timeouts due to firmware peer table exhaustion in fact?

More importantly, host rejects new peer association only after the

ar->num_peers > (ar->max_num_peers - 1)

But if we really hit it, I would suspect something wrong with firmware. So even if we give it one more chance I don't think we can survive in the end.

Quoted 3 lines
drivers/net/wireless/ath/ath11k/peer.c +0 -0
 	return 0;
 }