mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Merge "Revert "cnss2: Add support to monitor PM QOS votes""
This commit is contained in:
commit
0fdf10b672
2 changed files with 2 additions and 74 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */
|
||||
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */
|
||||
|
||||
#include <linux/cma.h>
|
||||
#include <linux/firmware.h>
|
||||
|
|
@ -58,7 +58,6 @@
|
|||
static DEFINE_SPINLOCK(pci_link_down_lock);
|
||||
static DEFINE_SPINLOCK(pci_reg_window_lock);
|
||||
static DEFINE_SPINLOCK(time_sync_lock);
|
||||
static DEFINE_SPINLOCK(pm_qos_lock);
|
||||
|
||||
#define MHI_TIMEOUT_OVERWRITE_MS (plat_priv->ctrl_params.mhi_timeout)
|
||||
#define MHI_M2_TIMEOUT_MS (plat_priv->ctrl_params.mhi_m2_timeout)
|
||||
|
|
@ -1277,73 +1276,6 @@ static void cnss_pci_stop_time_sync_update(struct cnss_pci_data *pci_priv)
|
|||
cancel_delayed_work_sync(&pci_priv->time_sync_work);
|
||||
}
|
||||
|
||||
static int cnss_pci_pm_qos_notify(struct notifier_block *nb,
|
||||
unsigned long curr_val, void *cpus)
|
||||
{
|
||||
struct cnss_pci_data *pci_priv =
|
||||
container_of(nb, struct cnss_pci_data, pm_qos_nb);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&pm_qos_lock, flags);
|
||||
|
||||
if (!pci_priv->runtime_pm_prevented &&
|
||||
curr_val != PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE) {
|
||||
cnss_pci_pm_runtime_get_noresume(pci_priv);
|
||||
pci_priv->runtime_pm_prevented = true;
|
||||
} else if (pci_priv->runtime_pm_prevented &&
|
||||
curr_val == PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE) {
|
||||
cnss_pci_pm_runtime_put_noidle(pci_priv);
|
||||
pci_priv->runtime_pm_prevented = false;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&pm_qos_lock, flags);
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static int cnss_pci_pm_qos_add_notifier(struct cnss_pci_data *pci_priv)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (pci_priv->device_id == QCA6174_DEVICE_ID)
|
||||
return 0;
|
||||
|
||||
pci_priv->pm_qos_nb.notifier_call = cnss_pci_pm_qos_notify;
|
||||
ret = pm_qos_add_notifier(PM_QOS_CPU_DMA_LATENCY,
|
||||
&pci_priv->pm_qos_nb);
|
||||
if (ret)
|
||||
cnss_pr_err("Failed to add qos notifier, err = %d\n",
|
||||
ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cnss_pci_pm_qos_remove_notifier(struct cnss_pci_data *pci_priv)
|
||||
{
|
||||
int ret;
|
||||
unsigned long flags;
|
||||
|
||||
if (pci_priv->device_id == QCA6174_DEVICE_ID)
|
||||
return 0;
|
||||
|
||||
ret = pm_qos_remove_notifier(PM_QOS_CPU_DMA_LATENCY,
|
||||
&pci_priv->pm_qos_nb);
|
||||
if (ret)
|
||||
cnss_pr_dbg("Failed to remove qos notifier, err = %d\n",
|
||||
ret);
|
||||
|
||||
spin_lock_irqsave(&pm_qos_lock, flags);
|
||||
|
||||
if (pci_priv->runtime_pm_prevented) {
|
||||
cnss_pci_pm_runtime_put_noidle(pci_priv);
|
||||
pci_priv->runtime_pm_prevented = false;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&pm_qos_lock, flags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cnss_pci_call_driver_probe(struct cnss_pci_data *pci_priv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
@ -1405,7 +1337,6 @@ int cnss_pci_call_driver_probe(struct cnss_pci_data *pci_priv)
|
|||
}
|
||||
|
||||
cnss_pci_start_time_sync_update(pci_priv);
|
||||
cnss_pci_pm_qos_add_notifier(pci_priv);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
@ -1435,7 +1366,6 @@ int cnss_pci_call_driver_remove(struct cnss_pci_data *pci_priv)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
cnss_pci_pm_qos_remove_notifier(pci_priv);
|
||||
cnss_pci_stop_time_sync_update(pci_priv);
|
||||
|
||||
if (test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state) &&
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */
|
||||
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */
|
||||
|
||||
#ifndef _CNSS_PCI_H
|
||||
#define _CNSS_PCI_H
|
||||
|
|
@ -71,8 +71,6 @@ struct cnss_pci_data {
|
|||
struct pci_saved_state *saved_state;
|
||||
struct pci_saved_state *default_state;
|
||||
struct msm_pcie_register_event msm_pci_event;
|
||||
struct notifier_block pm_qos_nb;
|
||||
u8 runtime_pm_prevented;
|
||||
atomic_t auto_suspended;
|
||||
atomic_t drv_connected;
|
||||
u8 drv_connected_last;
|
||||
|
|
|
|||
Loading…
Reference in a new issue