qcacmn: Set runtime pm state prior to runtime_init

During initialization of driver, the runtime pm usage
count is incremented to 1 when the pm state is NONE.
Runtime get is done as part of htc send packet for
a wmi command in scheduler thread context. In kworker,
runtime_start is processed as part of driver load and
runtime put is done prior to updating the pm state to
ON. Runtime put triggered as part of htc send packet
causes a panic since the state is NONE and usage
count is 1.

Fix is to set runtime pm state to ON prior to doing
a runtime put as part of initialization.

Change-Id: I52cca5240f2f0872c681aab3a58a382f3fa1df0e
CRs-Fixed: 2669029
This commit is contained in:
Yeshwanth Sriram Guntuka 2020-04-22 15:20:57 +05:30 • committed by nshrivas
commit ac0322cce9

View file

@ -1212,8 +1212,8 @@ static void hif_pm_runtime_start(struct hif_pci_softc *sc)
HIF_INFO("%s: Enabling RUNTIME PM, Delay: %d ms", __func__,
ol_sc->hif_config.runtime_pm_delay);
hif_runtime_init(sc->dev, ol_sc->hif_config.runtime_pm_delay);
qdf_atomic_set(&sc->pm_state, HIF_PM_RUNTIME_STATE_ON);
hif_runtime_init(sc->dev, ol_sc->hif_config.runtime_pm_delay);
hif_runtime_pm_debugfs_create(sc);
}