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

Commit f60e2750 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Luca Coelho
Browse files

iwlwifi: remove runtime_pm_mode



This is always set to IWL_PLAT_PM_MODE_DISABLED

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent ba7136f3
Loading
Loading
Loading
Loading
+5 −28
Original line number Diff line number Diff line
@@ -630,9 +630,6 @@ enum iwl_trans_state {
/**
 * DOC: Platform power management
 *
 * There are two types of platform power management: system-wide
 * (WoWLAN) and runtime.
 *
 * In system-wide power management the entire platform goes into a low
 * power state (e.g. idle or suspend to RAM) at the same time and the
 * device is configured as a wakeup source for the entire platform.
@@ -641,48 +638,32 @@ enum iwl_trans_state {
 * put the platform in low power mode).  The device's behavior in this
 * mode is dictated by the wake-on-WLAN configuration.
 *
 * In runtime power management, only the devices which are themselves
 * idle enter a low power state.  This is done at runtime, which means
 * that the entire system is still running normally.  This mode is
 * usually triggered automatically by the device driver and requires
 * the ability to enter and exit the low power modes in a very short
 * time, so there is not much impact in usability.
 *
 * The terms used for the device's behavior are as follows:
 *
 *	- D0: the device is fully powered and the host is awake;
 *	- D3: the device is in low power mode and only reacts to
 *		specific events (e.g. magic-packet received or scan
 *		results found);
 *	- D0I3: the device is in low power mode and reacts to any
 *		activity (e.g. RX);
 *
 * These terms reflect the power modes in the firmware and are not to
 * be confused with the physical device power state.  The NIC can be
 * in D0I3 mode even if, for instance, the PCI device is in D3 state.
 * be confused with the physical device power state.
 */

/**
 * enum iwl_plat_pm_mode - platform power management mode
 *
 * This enumeration describes the device's platform power management
 * behavior when in idle mode (i.e. runtime power management) or when
 * in system-wide suspend (i.e WoWLAN).
 * behavior when in system-wide suspend (i.e WoWLAN).
 *
 * @IWL_PLAT_PM_MODE_DISABLED: power management is disabled for this
 *	device.  At runtime, this means that nothing happens and the
 *	device always remains in active.  In system-wide suspend mode,
 *	it means that the all connections will be closed automatically
 *	by mac80211 before the platform is suspended.
 *	device.  In system-wide suspend mode, it means that the all
 *	connections will be closed automatically by mac80211 before
 *	the platform is suspended.
 * @IWL_PLAT_PM_MODE_D3: the device goes into D3 mode (i.e. WoWLAN).
 *	For runtime power management, this mode is not officially
 *	supported.
 * @IWL_PLAT_PM_MODE_D0I3: the device goes into D0I3 mode.
 */
enum iwl_plat_pm_mode {
	IWL_PLAT_PM_MODE_DISABLED,
	IWL_PLAT_PM_MODE_D3,
	IWL_PLAT_PM_MODE_D0I3,
};

/* Max time to wait for trans to become idle/non-idle on d0i3
@@ -795,9 +776,6 @@ struct iwl_trans_debug {
 * @system_pm_mode: the system-wide power management mode in use.
 *	This mode is set dynamically, depending on the WoWLAN values
 *	configured from the userspace at runtime.
 * @runtime_pm_mode: the runtime power management mode in use.  This
 *	mode is set during the initialization phase and is not
 *	supposed to change during runtime.
 */
struct iwl_trans {
	const struct iwl_trans_ops *ops;
@@ -842,7 +820,6 @@ struct iwl_trans {
	struct iwl_self_init_dram init_dram;

	enum iwl_plat_pm_mode system_pm_mode;
	enum iwl_plat_pm_mode runtime_pm_mode;

	/* pointer to trans specific struct */
	/*Ensure that this pointer will always be aligned to sizeof pointer */
+0 −28
Original line number Diff line number Diff line
@@ -1097,25 +1097,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	/* register transport layer debugfs here */
	iwl_trans_pcie_dbgfs_register(iwl_trans);

	/* if RTPM is in use, enable it in our device */
	if (iwl_trans->runtime_pm_mode != IWL_PLAT_PM_MODE_DISABLED) {
		/* We explicitly set the device to active here to
		 * clear contingent errors.
		 */
		pm_runtime_set_active(&pdev->dev);

		pm_runtime_set_autosuspend_delay(&pdev->dev,
					 iwlwifi_mod_params.d0i3_timeout);
		pm_runtime_use_autosuspend(&pdev->dev);

		/* We are not supposed to call pm_runtime_allow() by
		 * ourselves, but let userspace enable runtime PM via
		 * sysfs.  However, since we don't enable this from
		 * userspace yet, we need to allow/forbid() ourselves.
		*/
		pm_runtime_allow(&pdev->dev);
	}

	/* The PCI device starts with a reference taken and we are
	 * supposed to release it here.  But to simplify the
	 * interaction with the opmode, we don't do it now, but let
@@ -1133,15 +1114,6 @@ static void iwl_pci_remove(struct pci_dev *pdev)
{
	struct iwl_trans *trans = pci_get_drvdata(pdev);

	/* if RTPM was in use, restore it to the state before probe */
	if (trans->runtime_pm_mode != IWL_PLAT_PM_MODE_DISABLED) {
		/* We should not call forbid here, but we do for now.
		 * Check the comment to pm_runtime_allow() in
		 * iwl_pci_probe().
		 */
		pm_runtime_forbid(trans->dev);
	}

	iwl_drv_stop(trans->drv);

	iwl_trans_pcie_free(trans);
+0 −9
Original line number Diff line number Diff line
@@ -3312,18 +3312,11 @@ static struct iwl_trans_dump_data
#ifdef CONFIG_PM_SLEEP
static int iwl_trans_pcie_suspend(struct iwl_trans *trans)
{
	if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3 &&
	    (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3))
		return iwl_pci_fw_enter_d0i3(trans);

	return 0;
}

static void iwl_trans_pcie_resume(struct iwl_trans *trans)
{
	if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3 &&
	    (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3))
		iwl_pci_fw_exit_d0i3(trans);
}
#endif /* CONFIG_PM_SLEEP */

@@ -3656,8 +3649,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
						   WQ_HIGHPRI | WQ_UNBOUND, 1);
	INIT_WORK(&trans_pcie->rba.rx_alloc, iwl_pcie_rx_allocator_work);

	trans->runtime_pm_mode = IWL_PLAT_PM_MODE_DISABLED;

#ifdef CONFIG_IWLWIFI_DEBUGFS
	trans_pcie->fw_mon_data.state = IWL_FW_MON_DBGFS_STATE_CLOSED;
	mutex_init(&trans_pcie->fw_mon_data.mutex);