|
@@ -2061,6 +2061,34 @@ void ol_txrx_set_drop_unenc(ol_txrx_vdev_handle vdev, uint32_t val)
|
|
|
vdev->drop_unenc = val;
|
|
|
}
|
|
|
|
|
|
+#if defined(CONFIG_HL_SUPPORT)
|
|
|
+
|
|
|
+static void
|
|
|
+ol_txrx_tx_desc_reset_vdev(ol_txrx_vdev_handle vdev)
|
|
|
+{
|
|
|
+ struct ol_txrx_pdev_t *pdev = vdev->pdev;
|
|
|
+ int i;
|
|
|
+ struct ol_tx_desc_t *tx_desc;
|
|
|
+
|
|
|
+ qdf_spin_lock_bh(&pdev->tx_mutex);
|
|
|
+ for (i = 0; i < pdev->tx_desc.pool_size; i++) {
|
|
|
+ tx_desc = ol_tx_desc_find(pdev, i);
|
|
|
+ if (tx_desc->vdev == vdev)
|
|
|
+ tx_desc->vdev = NULL;
|
|
|
+ }
|
|
|
+ qdf_spin_unlock_bh(&pdev->tx_mutex);
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+
|
|
|
+static void
|
|
|
+ol_txrx_tx_desc_reset_vdev(ol_txrx_vdev_handle vdev)
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
/**
|
|
|
* ol_txrx_vdev_detach - Deallocate the specified data virtual
|
|
|
* device object.
|
|
@@ -2153,6 +2181,18 @@ ol_txrx_vdev_detach(struct cdp_vdev *pvdev,
|
|
|
|
|
|
htt_vdev_detach(pdev->htt_pdev, vdev->vdev_id);
|
|
|
|
|
|
+ /*
|
|
|
+ * The ol_tx_desc_free might access the invalid content of vdev referred
|
|
|
+ * by tx desc, since this vdev might be detached in another thread
|
|
|
+ * asynchronous.
|
|
|
+ *
|
|
|
+ * Go through tx desc pool to set corresponding tx desc's vdev to NULL
|
|
|
+ * when detach this vdev, and add vdev checking in the ol_tx_desc_free
|
|
|
+ * to avoid crash.
|
|
|
+ *
|
|
|
+ */
|
|
|
+ ol_txrx_tx_desc_reset_vdev(vdev);
|
|
|
+
|
|
|
/*
|
|
|
* Doesn't matter if there are outstanding tx frames -
|
|
|
* they will be freed once the target sends a tx completion
|
|
@@ -3035,13 +3075,23 @@ void ol_txrx_peer_unref_delete(ol_txrx_peer_handle peer)
|
|
|
vdev->delete.callback;
|
|
|
void *vdev_delete_context =
|
|
|
vdev->delete.context;
|
|
|
-
|
|
|
/*
|
|
|
* Now that there are no references to the peer,
|
|
|
* we can release the peer reference lock.
|
|
|
*/
|
|
|
qdf_spin_unlock_bh(&pdev->peer_ref_mutex);
|
|
|
|
|
|
+ /*
|
|
|
+ * The ol_tx_desc_free might access the invalid content of vdev
|
|
|
+ * referred by tx desc, since this vdev might be detached in
|
|
|
+ * another thread asynchronous.
|
|
|
+ *
|
|
|
+ * Go through tx desc pool to set corresponding tx desc's vdev
|
|
|
+ * to NULL when detach this vdev, and add vdev checking in the
|
|
|
+ * ol_tx_desc_free to avoid crash.
|
|
|
+ *
|
|
|
+ */
|
|
|
+ ol_txrx_tx_desc_reset_vdev(vdev);
|
|
|
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
|
|
|
"%s: deleting vdev object %p "
|
|
|
"(%02x:%02x:%02x:%02x:%02x:%02x)"
|