qcacmn: 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: 2539826
Change-Id: Id4d6ba16beae89f4052e72024ef8ce891ea33715
This commit is contained in:
Rakesh Pillai
2019-09-13 04:15:08 +05:30
committed by nshrivas
orang tua dc1517ec8c
melakukan 1d4d12e0e9
3 mengubah file dengan 25 tambahan dan 20 penghapusan

Melihat File

@@ -9581,15 +9581,21 @@ static struct cdp_ipa_ops dp_ops_ipa = {
#endif
#ifdef DP_POWER_SAVE
static QDF_STATUS dp_bus_suspend(struct cdp_pdev *opaque_pdev)
static QDF_STATUS dp_bus_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
{
struct dp_pdev *pdev = (struct dp_pdev *)opaque_pdev;
struct dp_soc *soc = pdev->soc;
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
struct cdp_pdev *pdev = (struct cdp_pdev *)
dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
int timeout = SUSPEND_DRAIN_WAIT;
int drain_wait_delay = 50; /* 50 ms */
if (qdf_unlikely(!pdev)) {
dp_err("pdev is NULL");
return QDF_STATUS_E_INVAL;
}
/* Abort if there are any pending TX packets */
while (dp_get_tx_pending(opaque_pdev) > 0) {
while (dp_get_tx_pending(pdev) > 0) {
qdf_sleep(drain_wait_delay);
if (timeout <= 0) {
dp_err("TX frames are pending, abort suspend");
@@ -9604,10 +9610,9 @@ static QDF_STATUS dp_bus_suspend(struct cdp_pdev *opaque_pdev)
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS dp_bus_resume(struct cdp_pdev *opaque_pdev)
static QDF_STATUS dp_bus_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
{
struct dp_pdev *pdev = (struct dp_pdev *)opaque_pdev;
struct dp_soc *soc = pdev->soc;
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
if (soc->intr_mode == DP_INTR_POLL)
qdf_timer_mod(&soc->int_timer, DP_INTR_POLL_TIMER_MS);