From d2e5385d629ca0cfba37f9a28b6685164d6287a7 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Fri, 13 Sep 2019 04:20:13 +0530 Subject: [PATCH] qcacld-3.0: cdp: Convergence of cdp_bus_ops Currently the cdp apis are given pdev/vdev/peer handle as its arguments, which is directly accessed in those APIs. This can cause a race-condition in access of the respective handles if it has been deleted in parallel. Hence as a part of cdp convergence, pass only the pdev/vdev id or peer mac address, which will be used to get the respective handles, and hence avoiding the unwanted access of the handles if it has been deleted. Converged bus_ops - bus_suspend - bus_resume CRs-Fixed: 2539749 Change-Id: I7f57c09fe4620f90c5cfab781635f6f0ada08ec5 --- core/dp/txrx/ol_txrx.c | 11 +++++++---- core/hdd/src/wlan_hdd_driver_ops.c | 11 ++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 872a15dc80fc..17e27efd7098 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -3556,26 +3556,29 @@ static QDF_STATUS ol_txrx_runtime_resume(struct cdp_soc_t *soc_hdl, /** * ol_txrx_bus_suspend() - bus suspend - * @ppdev: TXRX pdev context + * @soc_hdl: Datapath soc handle + * @pdev_id: id of data path pdev handle * * Ensure that ol_txrx is ready for bus suspend * * Return: QDF_STATUS */ -static QDF_STATUS ol_txrx_bus_suspend(struct cdp_pdev *ppdev) +static QDF_STATUS ol_txrx_bus_suspend(struct cdp_soc_t *soc_hdl, + uint8_t pdev_id) { return ol_txrx_wait_for_pending_tx(SUSPEND_DRAIN_WAIT); } /** * ol_txrx_bus_resume() - bus resume - * @ppdev: TXRX pdev context + * @soc_hdl: Datapath soc handle + * @pdev_id: id of data path pdev handle * * Dummy function for symetry * * Return: QDF_STATUS_SUCCESS */ -static QDF_STATUS ol_txrx_bus_resume(struct cdp_pdev *ppdev) +static QDF_STATUS ol_txrx_bus_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) { return QDF_STATUS_SUCCESS; } diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index ff5ddb363823..92ef2bfd3010 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -35,6 +35,7 @@ #include "wlan_policy_mgr_api.h" #include "qwlan_version.h" #include "bmi.h" +#include #include "cdp_txrx_bus.h" #include "cdp_txrx_misc.h" #include "pld_common.h" @@ -973,7 +974,6 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params) struct hdd_context *hdd_ctx; void *hif_ctx; void *dp_soc; - void *dp_pdev; struct pmo_wow_enable_params pmo_params; hdd_info("starting bus suspend"); @@ -1003,8 +1003,7 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params) } dp_soc = cds_get_context(QDF_MODULE_ID_SOC); - dp_pdev = cds_get_context(QDF_MODULE_ID_TXRX); - err = qdf_status_to_os_return(cdp_bus_suspend(dp_soc, dp_pdev)); + err = qdf_status_to_os_return(cdp_bus_suspend(dp_soc, OL_TXRX_PDEV_ID)); if (err) { hdd_err("Failed cdp bus suspend: %d", err); return err; @@ -1050,7 +1049,7 @@ late_hif_resume: QDF_BUG(QDF_IS_STATUS_SUCCESS(status)); resume_cdp: - status = cdp_bus_resume(dp_soc, dp_pdev); + status = cdp_bus_resume(dp_soc, OL_TXRX_PDEV_ID); QDF_BUG(QDF_IS_STATUS_SUCCESS(status)); return err; @@ -1160,7 +1159,6 @@ int wlan_hdd_bus_resume(void) int status; QDF_STATUS qdf_status; void *dp_soc; - void *dp_pdev; if (cds_is_driver_recovering()) return 0; @@ -1205,8 +1203,7 @@ int wlan_hdd_bus_resume(void) } dp_soc = cds_get_context(QDF_MODULE_ID_SOC); - dp_pdev = cds_get_context(QDF_MODULE_ID_TXRX); - qdf_status = cdp_bus_resume(dp_soc, dp_pdev); + qdf_status = cdp_bus_resume(dp_soc, OL_TXRX_PDEV_ID); status = qdf_status_to_os_return(qdf_status); if (status) { hdd_err("Failed cdp bus resume");