Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79b15c7d authored by Mahesh Kumar Kalikot Veetil's avatar Mahesh Kumar Kalikot Veetil Committed by Gerrit - the friendly Code Review server
Browse files

cnss2: Synchronize bus suspend and resume



Bus suspend and resume functions are not re-entrant. Protect
them with mutex as multiple contexts can call these routines
and cause race condition.

Change-Id: Id6276b7fff21f595f403ebd9e15e9ef90bfdd024
CRs-Fixed: 2749241
Signed-off-by: default avatarMahesh Kumar Kalikot Veetil <mkalikot@codeaurora.org>
parent 1bf0a890
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2478,7 +2478,9 @@ static int cnss_pci_suspend(struct device *dev)
		goto clear_flag;

	if (!pci_priv->disable_pc) {
		mutex_lock(&pci_priv->bus_lock);
		ret = cnss_pci_suspend_bus(pci_priv);
		mutex_unlock(&pci_priv->bus_lock);
		if (ret)
			goto resume_driver;
	}
@@ -2517,7 +2519,9 @@ static int cnss_pci_resume(struct device *dev)
		goto out;

	if (!pci_priv->disable_pc) {
		mutex_lock(&pci_priv->bus_lock);
		ret = cnss_pci_resume_bus(pci_priv);
		mutex_unlock(&pci_priv->bus_lock);
		if (ret)
			goto out;
	}