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

Commit e0d63b61 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: fix PCIe bus mastering in case of interface down"

parents 7358ce3d d79a663f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1807,9 +1807,8 @@ static int wil_cfg80211_suspend(struct wiphy *wiphy,
	wil_dbg_pm(wil, "suspending\n");

	mutex_lock(&wil->mutex);
	wil_p2p_stop_discovery(wil);

	mutex_lock(&wil->p2p_wdev_mutex);
	wil_p2p_stop_radio_operations(wil);
	wil_abort_scan(wil, true);
	mutex_unlock(&wil->p2p_wdev_mutex);
	mutex_unlock(&wil->mutex);
+15 −9
Original line number Diff line number Diff line
@@ -393,6 +393,9 @@ static int wil6210_suspend(struct device *dev, bool is_runtime)
	int rc = 0;
	struct pci_dev *pdev = to_pci_dev(dev);
	struct wil6210_priv *wil = pci_get_drvdata(pdev);
	struct net_device *ndev = wil_to_ndev(wil);
	bool keep_radio_on = ndev->flags & IFF_UP &&
			     wil->keep_radio_on_during_sleep;

	wil_dbg_pm(wil, "suspend: %s\n", is_runtime ? "runtime" : "system");

@@ -400,14 +403,14 @@ static int wil6210_suspend(struct device *dev, bool is_runtime)
	if (rc)
		goto out;

	rc = wil_suspend(wil, is_runtime);
	rc = wil_suspend(wil, is_runtime, keep_radio_on);
	if (!rc) {
		wil->suspend_stats.successful_suspends++;

		/* If platform device supports keep_radio_on_during_sleep
		 * it will control PCIe master
		/* In case radio stays on, platform device will control
		 * PCIe master
		 */
		if (!wil->keep_radio_on_during_sleep)
		if (!keep_radio_on)
			/* disable bus mastering */
			pci_clear_master(pdev);
	}
@@ -420,20 +423,23 @@ static int wil6210_resume(struct device *dev, bool is_runtime)
	int rc = 0;
	struct pci_dev *pdev = to_pci_dev(dev);
	struct wil6210_priv *wil = pci_get_drvdata(pdev);
	struct net_device *ndev = wil_to_ndev(wil);
	bool keep_radio_on = ndev->flags & IFF_UP &&
			     wil->keep_radio_on_during_sleep;

	wil_dbg_pm(wil, "resume: %s\n", is_runtime ? "runtime" : "system");

	/* If platform device supports keep_radio_on_during_sleep it will
	 * control PCIe master
	/* In case radio stays on, platform device will control
	 * PCIe master
	 */
	if (!wil->keep_radio_on_during_sleep)
	if (!keep_radio_on)
		/* allow master */
		pci_set_master(pdev);
	rc = wil_resume(wil, is_runtime);
	rc = wil_resume(wil, is_runtime, keep_radio_on);
	if (rc) {
		wil_err(wil, "device failed to resume (%d)\n", rc);
		wil->suspend_stats.failed_resumes++;
		if (!wil->keep_radio_on_during_sleep)
		if (!keep_radio_on)
			pci_clear_master(pdev);
	} else {
		wil->suspend_stats.successful_resumes++;
+2 −8
Original line number Diff line number Diff line
@@ -317,12 +317,9 @@ static int wil_resume_radio_off(struct wil6210_priv *wil)
	return rc;
}

int wil_suspend(struct wil6210_priv *wil, bool is_runtime)
int wil_suspend(struct wil6210_priv *wil, bool is_runtime, bool keep_radio_on)
{
	int rc = 0;
	struct net_device *ndev = wil_to_ndev(wil);
	bool keep_radio_on = ndev->flags & IFF_UP &&
			     wil->keep_radio_on_during_sleep;

	wil_dbg_pm(wil, "suspend: %s\n", is_runtime ? "runtime" : "system");

@@ -345,12 +342,9 @@ int wil_suspend(struct wil6210_priv *wil, bool is_runtime)
	return rc;
}

int wil_resume(struct wil6210_priv *wil, bool is_runtime)
int wil_resume(struct wil6210_priv *wil, bool is_runtime, bool keep_radio_on)
{
	int rc = 0;
	struct net_device *ndev = wil_to_ndev(wil);
	bool keep_radio_on = ndev->flags & IFF_UP &&
			     wil->keep_radio_on_during_sleep;
	unsigned long long suspend_time_usec = 0;

	wil_dbg_pm(wil, "resume: %s\n", is_runtime ? "runtime" : "system");
+2 −2
Original line number Diff line number Diff line
@@ -1041,8 +1041,8 @@ int wil_pm_runtime_get(struct wil6210_priv *wil);
void wil_pm_runtime_put(struct wil6210_priv *wil);

int wil_can_suspend(struct wil6210_priv *wil, bool is_runtime);
int wil_suspend(struct wil6210_priv *wil, bool is_runtime);
int wil_resume(struct wil6210_priv *wil, bool is_runtime);
int wil_suspend(struct wil6210_priv *wil, bool is_runtime, bool keep_radio_on);
int wil_resume(struct wil6210_priv *wil, bool is_runtime, bool keep_radio_on);
bool wil_is_wmi_idle(struct wil6210_priv *wil);
int wmi_resume(struct wil6210_priv *wil);
int wmi_suspend(struct wil6210_priv *wil);