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

Commit 2a8b0253 authored by Yue Ma's avatar Yue Ma
Browse files

cnss2: Notify MHI driver immediately after PCIe linkdown



Due to serialization, PCIe linkdown notification to MHI driver may
be queued in the driver event workqueue. This results MHI driver
timeout first and thereafter handle the linkdown. Notify MHI driver
immediately after PCIe linkdown so it is able to handle as early as
possible.

Change-Id: I115aedf17b1b2381560bb4c12039223587da4cc4
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent 6ef3f2a0
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -1282,12 +1282,9 @@ static int cnss_do_recovery(struct cnss_plat_data *plat_priv,
		plat_priv->driver_ops->update_status(pci_priv->pci_dev,
						     CNSS_RECOVERY);

	if (reason == CNSS_REASON_LINK_DOWN) {
		cnss_pci_set_mhi_state(plat_priv->bus_priv,
				       CNSS_MHI_NOTIFY_LINK_ERROR);
		if (test_bit(LINK_DOWN_SELF_RECOVERY, &quirks))
	if (reason == CNSS_REASON_LINK_DOWN &&
	    test_bit(LINK_DOWN_SELF_RECOVERY, &quirks))
		goto self_recovery;
	}

	if (reason != CNSS_REASON_RDDM)
		goto subsys_restart;
+4 −0
Original line number Diff line number Diff line
@@ -208,7 +208,10 @@ int cnss_pci_link_down(struct device *dev)
	spin_unlock_irqrestore(&pci_link_down_lock, flags);

	cnss_pr_err("PCI link down is detected by host driver, schedule recovery!\n");

	cnss_pci_set_mhi_state(pci_priv, CNSS_MHI_NOTIFY_LINK_ERROR);
	cnss_schedule_recovery(dev, CNSS_REASON_LINK_DOWN);

	return 0;
}
EXPORT_SYMBOL(cnss_pci_link_down);
@@ -305,6 +308,7 @@ static void cnss_pci_event_cb(struct msm_pcie_notify *notify)
		spin_unlock_irqrestore(&pci_link_down_lock, flags);

		cnss_pr_err("PCI link down, schedule recovery!\n");
		cnss_pci_set_mhi_state(pci_priv, CNSS_MHI_NOTIFY_LINK_ERROR);
		if (pci_dev->device == QCA6174_DEVICE_ID)
			disable_irq(pci_dev->irq);
		cnss_schedule_recovery(&pci_dev->dev, CNSS_REASON_LINK_DOWN);