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

Commit fef55ac3 authored by Mohammed Siddiq's avatar Mohammed Siddiq
Browse files

cnss2: Add delay for pci link training retries



Add delay for pci link training retries during pci resume
done for pci link recovery.

Change-Id: Idb32ec833dbf5828afecaafb7197c3f40529a839
Signed-off-by: default avatarMohammed Siddiq <msiddiq@codeaurora.org>
parent 402c8854
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ static DEFINE_SPINLOCK(time_sync_lock);
#define POWER_ON_RETRY_DELAY_MS			200

#define LINK_TRAINING_RETRY_MAX_TIMES		3
#define LINK_TRAINING_RETRY_DELAY_MS		500

#define HANG_DATA_LENGTH		384
#define HST_HANG_DATA_OFFSET		((3 * 1024 * 1024) - HANG_DATA_LENGTH)
@@ -679,6 +680,8 @@ static int cnss_set_pci_link(struct cnss_pci_data *pci_priv, bool link_up)
			    link_up ? "resume" : "suspend", ret);
		if (link_up && retry++ < LINK_TRAINING_RETRY_MAX_TIMES) {
			cnss_pr_dbg("Retry PCI link training #%d\n", retry);
			if (pci_priv->pci_link_down_ind)
				msleep(LINK_TRAINING_RETRY_DELAY_MS * retry);
			goto retry;
		}
	}