cnss2: Initialize completion event at right place

CNSS2 registers PCI event callback for wake irq from
PCI driver. When callback is called CNSS2 completes
wake_event to notify the waiting threads. Currently,
initialization of wake_event completion is done after
PCI event callback registration causing issue when
PCI even callback for wake irq is called before wake_event
completion could initialize.

Initialize wake_event completion before PCIe event callback
registration.

Change-Id: If8c6ca5a5d5de5fc903b479d6d32ac0e5349f069
CRs-Fixed: 3648865
This commit is contained in:
Naman Padhiar
2023-10-26 19:32:53 +05:30
committed by Ravindra Konda
parent 027c253616
commit 0e4171f329

View File

@@ -7275,6 +7275,8 @@ static int cnss_pci_probe(struct pci_dev *pci_dev,
cnss_update_supported_link_info(pci_priv);
init_completion(&pci_priv->wake_event_complete);
ret = cnss_reg_pci_event(pci_priv);
if (ret) {
cnss_pr_err("Failed to register PCI event, err = %d\n", ret);
@@ -7319,7 +7321,6 @@ static int cnss_pci_probe(struct pci_dev *pci_dev,
cnss_pci_get_link_status(pci_priv);
cnss_pci_set_wlaon_pwr_ctrl(pci_priv, false, true, false);
cnss_pci_wake_gpio_init(pci_priv);
init_completion(&pci_priv->wake_event_complete);
break;
default:
cnss_pr_err("Unknown PCI device found: 0x%x\n",