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

Commit 24cb777b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss2: Make sure PCIe link is in L0 state before updating time sync"

parents 4e4be78d 04bbaab0
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1208,18 +1208,19 @@ static void cnss_pci_clear_time_sync_counter(struct cnss_pci_data *pci_priv)
static int cnss_pci_update_timestamp(struct cnss_pci_data *pci_priv)
{
	struct cnss_plat_data *plat_priv = pci_priv->plat_priv;
	struct device *dev = &pci_priv->pci_dev->dev;
	unsigned long flags = 0;
	u64 host_time_us, device_time_us, offset;
	u32 low, high;
	int ret;

	ret = cnss_pci_check_link_status(pci_priv);
	ret = cnss_pci_prevent_l1(dev);
	if (ret)
		return ret;
		goto out;

	ret = cnss_pci_force_wake_get(pci_priv);
	if (ret)
		return ret;
		goto allow_l1;

	spin_lock_irqsave(&time_sync_lock, flags);
	cnss_pci_clear_time_sync_counter(pci_priv);
@@ -1256,7 +1257,9 @@ static int cnss_pci_update_timestamp(struct cnss_pci_data *pci_priv)

force_wake_put:
	cnss_pci_force_wake_put(pci_priv);

allow_l1:
	cnss_pci_allow_l1(dev);
out:
	return ret;
}