Implement 0009 deep-standby SoC rail, RPM handoff, USB PHY, Wi-Fi BET, and drm_mipi_dbi fixes
- Enable CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y and lower 200 MHz CPU OPP opp-peak-kBps to 0x25800 (19.2 MHz BIMC XO floor) across all six MSM8905/MSM8909 DTS files so rpmpd_sync_state and icc_sync_state complete despite driverless /cpus nodes. - Add patches/kernel/0009-msm8909-deep-standby-rpm-usb-wifi-ddr.patch: late_initcall_sync(rpm_smd_clk_late_cleanup) to drop active votes on unclaimed QDSS/QPIC clocks and clear RPM SLEEP_STATE boot handoff votes, ChipIdea ci_hdrc_msm/core unplugged USB HS PHY shutdown + 200 ms autosuspend, and wcn36xx BET + multicast filter + HOST_SUSPEND_IND/HOST_RESUME_REQ in screen_off_offload. - Build and export drivers/gpu/drm/drm_mipi_dbi.ko.zst alongside panel-mipi-dbi.ko.zst in build-kernel-audio.sh, rebuild-image.sh, apply-bananarchy-overlay.sh, and check-rebuild.sh. - Rebuild and verify a1114 (carbonara) images/archives for nokia-argon and nokia-beatles and update BATTERY-OPTIMIZATION-ANALYSIS.md, CHANGELOG.md, and pinned hashes in check-rebuild.sh.
This commit is contained in:
1 parent
b2cf028808
commit
96c66bf0c6
37 files changed
+47187
-46641
No files matched your search
@@ -0,0 +1,421 @@
|
||||
--- a/drivers/base/core.c
|
||||
+++ b/drivers/base/core.c
|
||||
@@ -1682,11 +1682,8 @@
|
||||
#define FW_DEVLINK_SYNC_STATE_STRICT 0
|
||||
#define FW_DEVLINK_SYNC_STATE_TIMEOUT 1
|
||||
|
||||
-#ifndef CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT
|
||||
-static int fw_devlink_sync_state;
|
||||
-#else
|
||||
+/* Allow sync_state() completion even when DT CPU nodes lack a struct device_driver. */
|
||||
static int fw_devlink_sync_state = FW_DEVLINK_SYNC_STATE_TIMEOUT;
|
||||
-#endif
|
||||
|
||||
static int __init fw_devlink_sync_state_setup(char *arg)
|
||||
{
|
||||
--- a/drivers/clk/qcom/clk-smd-rpm.c
|
||||
+++ b/drivers/clk/qcom/clk-smd-rpm.c
|
||||
@@ -185,6 +185,7 @@
|
||||
};
|
||||
|
||||
static DEFINE_MUTEX(rpm_smd_clk_lock);
|
||||
+static const struct rpm_smd_clk_desc *rpmcc_smd_desc;
|
||||
|
||||
static int clk_smd_rpm_handoff(const struct clk_smd_rpm *r)
|
||||
{
|
||||
@@ -1332,11 +1333,58 @@
|
||||
goto err;
|
||||
}
|
||||
|
||||
+ rpmcc_smd_desc = desc;
|
||||
+
|
||||
return 0;
|
||||
err:
|
||||
dev_err(&pdev->dev, "Error registering SMD clock driver (%d)\n", ret);
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
+static int __init rpm_smd_clk_late_cleanup(void)
|
||||
+{
|
||||
+ size_t i;
|
||||
+
|
||||
+ if (!rpmcc_smd_desc || !rpmcc_smd_rpm)
|
||||
+ return 0;
|
||||
+
|
||||
+ mutex_lock(&rpm_smd_clk_lock);
|
||||
+ for (i = 0; i < rpmcc_smd_desc->num_clks; i++) {
|
||||
+ struct clk_smd_rpm *r = rpmcc_smd_desc->clks[i];
|
||||
+ struct clk_smd_rpm_req req;
|
||||
+ bool drop_active = false;
|
||||
+
|
||||
+ if (!r || r->active_only)
|
||||
+ continue;
|
||||
+ if (r->enabled || (r->peer && r->peer->enabled))
|
||||
+ continue;
|
||||
+ if (clk_hw_get_flags(&r->hw) & CLK_IS_CRITICAL)
|
||||
+ continue;
|
||||
+
|
||||
+ req.key = cpu_to_le32(r->rpm_key);
|
||||
+ req.nbytes = cpu_to_le32(sizeof(u32));
|
||||
+ req.value = 0;
|
||||
+
|
||||
+ qcom_rpm_smd_write(rpmcc_smd_rpm, QCOM_SMD_RPM_SLEEP_STATE,
|
||||
+ r->rpm_res_type, r->rpm_clk_id,
|
||||
+ &req, sizeof(req));
|
||||
+
|
||||
+ if (r->rpm_res_type == QCOM_SMD_RPM_QPIC_CLK ||
|
||||
+ (r->rpm_res_type == QCOM_SMD_RPM_MISC_CLK &&
|
||||
+ r->rpm_clk_id == 1))
|
||||
+ drop_active = true;
|
||||
+
|
||||
+ if (drop_active)
|
||||
+ qcom_rpm_smd_write(rpmcc_smd_rpm,
|
||||
+ QCOM_SMD_RPM_ACTIVE_STATE,
|
||||
+ r->rpm_res_type, r->rpm_clk_id,
|
||||
+ &req, sizeof(req));
|
||||
+ }
|
||||
+ mutex_unlock(&rpm_smd_clk_lock);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+late_initcall_sync(rpm_smd_clk_late_cleanup);
|
||||
|
||||
static struct platform_driver rpm_smd_clk_driver = {
|
||||
.driver = {
|
||||
--- a/drivers/usb/chipidea/ci_hdrc_msm.c
|
||||
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
|
||||
@@ -36,15 +36,54 @@
|
||||
struct ci_hdrc_msm {
|
||||
struct device *dev;
|
||||
struct platform_device *ci;
|
||||
+ struct phy *phy;
|
||||
struct clk *core_clk;
|
||||
struct clk *iface_clk;
|
||||
struct clk *fs_clk;
|
||||
struct ci_hdrc_platform_data pdata;
|
||||
struct reset_controller_dev rcdev;
|
||||
+ bool phy_enabled;
|
||||
bool secondary_phy;
|
||||
bool hsic;
|
||||
void __iomem *base;
|
||||
};
|
||||
+
|
||||
+static int ci_hdrc_msm_phy_enable(struct ci_hdrc_msm *msm_ci,
|
||||
+ struct ci_hdrc *ci)
|
||||
+{
|
||||
+ struct phy *phy = ci && ci->phy ? ci->phy : msm_ci->phy;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!phy)
|
||||
+ return 0;
|
||||
+
|
||||
+ msm_ci->phy = phy;
|
||||
+ if (msm_ci->phy_enabled)
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = phy_init(phy);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = phy_power_on(phy);
|
||||
+ if (ret) {
|
||||
+ phy_exit(phy);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ msm_ci->phy_enabled = true;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void ci_hdrc_msm_phy_disable(struct ci_hdrc_msm *msm_ci)
|
||||
+{
|
||||
+ if (!msm_ci->phy_enabled || !msm_ci->phy)
|
||||
+ return;
|
||||
+
|
||||
+ phy_power_off(msm_ci->phy);
|
||||
+ phy_exit(msm_ci->phy);
|
||||
+ msm_ci->phy_enabled = false;
|
||||
+}
|
||||
|
||||
static int
|
||||
ci_hdrc_msm_por_reset(struct reset_controller_dev *r, unsigned long id)
|
||||
@@ -82,10 +121,17 @@
|
||||
|
||||
static void ci_hdrc_msm_enter_lpm(struct ci_hdrc *ci, bool enable)
|
||||
{
|
||||
- /*
|
||||
- * PHY power and clocks are managed via CI_HDRC_CONTROLLER_STOPPED_EVENT
|
||||
- * and parent runtime PM; avoid touching ULPI PORTSC while PHY is off.
|
||||
- */
|
||||
+ struct ci_hdrc_msm *msm_ci = dev_get_drvdata(ci->dev->parent);
|
||||
+
|
||||
+ if (!msm_ci)
|
||||
+ return;
|
||||
+
|
||||
+ if (enable) {
|
||||
+ ci_hdrc_msm_phy_disable(msm_ci);
|
||||
+ } else if (!ci_hdrc_msm_phy_enable(msm_ci, ci) && ci->phy) {
|
||||
+ phy_set_mode(ci->phy, ci->role == CI_ROLE_HOST ?
|
||||
+ PHY_MODE_USB_HOST : PHY_MODE_USB_DEVICE);
|
||||
+ }
|
||||
}
|
||||
|
||||
static const struct reset_control_ops ci_hdrc_msm_reset_ops = {
|
||||
@@ -109,15 +155,9 @@
|
||||
writel_relaxed(val, msm_ci->base + HS_PHY_SEC_CTRL);
|
||||
}
|
||||
|
||||
- ret = phy_init(ci->phy);
|
||||
+ ret = ci_hdrc_msm_phy_enable(msm_ci, ci);
|
||||
if (ret)
|
||||
return ret;
|
||||
-
|
||||
- ret = phy_power_on(ci->phy);
|
||||
- if (ret) {
|
||||
- phy_exit(ci->phy);
|
||||
- return ret;
|
||||
- }
|
||||
|
||||
/* use AHB transactor, allow posted data writes */
|
||||
hw_write_id_reg(ci, HS_PHY_AHB_MODE, 0xffffffff, 0x8);
|
||||
@@ -141,8 +181,6 @@
|
||||
break;
|
||||
case CI_HDRC_CONTROLLER_STOPPED_EVENT:
|
||||
dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");
|
||||
- phy_power_off(ci->phy);
|
||||
- phy_exit(ci->phy);
|
||||
break;
|
||||
default:
|
||||
dev_dbg(dev, "unknown ci_hdrc event\n");
|
||||
@@ -269,19 +307,24 @@
|
||||
}
|
||||
of_node_put(ulpi_node);
|
||||
|
||||
+ pm_runtime_set_active(&pdev->dev);
|
||||
+ pm_runtime_get_noresume(&pdev->dev);
|
||||
+ pm_runtime_enable(&pdev->dev);
|
||||
+
|
||||
plat_ci = ci_hdrc_add_device(&pdev->dev, pdev->resource,
|
||||
pdev->num_resources, &ci->pdata);
|
||||
if (IS_ERR(plat_ci)) {
|
||||
ret = PTR_ERR(plat_ci);
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n");
|
||||
+ pm_runtime_put_noidle(&pdev->dev);
|
||||
+ pm_runtime_disable(&pdev->dev);
|
||||
+ pm_runtime_set_suspended(&pdev->dev);
|
||||
goto err_mux;
|
||||
}
|
||||
|
||||
ci->ci = plat_ci;
|
||||
-
|
||||
- pm_runtime_set_active(&pdev->dev);
|
||||
- pm_runtime_enable(&pdev->dev);
|
||||
+ pm_runtime_put(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -298,6 +341,7 @@
|
||||
|
||||
ci_hdrc_remove_device(ci->ci);
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
+ ci_hdrc_msm_phy_disable(ci);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
clk_disable_unprepare(ci->iface_clk);
|
||||
--- a/drivers/usb/chipidea/core.c
|
||||
+++ b/drivers/usb/chipidea/core.c
|
||||
@@ -1230,6 +1230,7 @@
|
||||
pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
|
||||
pm_runtime_mark_last_busy(ci->dev);
|
||||
pm_runtime_use_autosuspend(&pdev->dev);
|
||||
+ pm_request_autosuspend(&pdev->dev);
|
||||
}
|
||||
|
||||
if (ci_otg_is_fsm_mode(ci))
|
||||
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
|
||||
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
|
||||
@@ -217,6 +217,8 @@
|
||||
struct list_head dev_node;
|
||||
bool started;
|
||||
bool power_params_offload;
|
||||
+ bool host_suspend_ind_sent;
|
||||
+ u32 standby_bcast_mcast_filter;
|
||||
|
||||
const char *nv_file;
|
||||
const struct firmware *nv;
|
||||
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
|
||||
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
|
||||
@@ -2340,7 +2340,11 @@
|
||||
*/
|
||||
if (ignore_dtim) {
|
||||
msg_body.ignore_dtim = 1;
|
||||
- msg_body.dtim_period = 2;
|
||||
+ msg_body.dtim_period = max_t(u32, 2,
|
||||
+ WCN36XX_LISTEN_INTERVAL(wcn));
|
||||
+ msg_body.bcast_mcast_filter = wcn->standby_bcast_mcast_filter;
|
||||
+ msg_body.enable_bet = 1;
|
||||
+ msg_body.bet_interval = WCN36XX_LISTEN_INTERVAL(wcn);
|
||||
}
|
||||
msg_body.listen_interval = WCN36XX_LISTEN_INTERVAL(wcn);
|
||||
|
||||
@@ -3166,7 +3170,8 @@
|
||||
mutex_lock(&wcn->hal_mutex);
|
||||
|
||||
INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_SUSPEND_IND);
|
||||
- msg_body.configured_mcst_bcst_filter_setting = 0;
|
||||
+ msg_body.configured_mcst_bcst_filter_setting =
|
||||
+ wcn->standby_bcast_mcast_filter;
|
||||
msg_body.active_session_count = 1;
|
||||
PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
|
||||
|
||||
--- a/drivers/net/wireless/ath/wcn36xx/main.c
|
||||
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
|
||||
@@ -44,6 +44,7 @@
|
||||
static bool screen_off_offload;
|
||||
|
||||
static void wcn36xx_sync_screen_off_offload(struct wcn36xx *wcn, bool enable);
|
||||
+static void wcn36xx_exit_host_standby(struct wcn36xx *wcn, bool send_rpc);
|
||||
|
||||
static int wcn36xx_screen_off_offload_set(const char *val,
|
||||
const struct kernel_param *kp)
|
||||
@@ -308,6 +309,8 @@
|
||||
INIT_LIST_HEAD(&wcn->vif_list);
|
||||
wcn->started = true;
|
||||
wcn->power_params_offload = false;
|
||||
+ wcn->host_suspend_ind_sent = false;
|
||||
+ wcn->standby_bcast_mcast_filter = 0;
|
||||
mutex_unlock(&wcn->conf_mutex);
|
||||
spin_lock_init(&wcn->dxe_lock);
|
||||
spin_lock_init(&wcn->survey_lock);
|
||||
@@ -346,6 +349,8 @@
|
||||
mutex_lock(&wcn->conf_mutex);
|
||||
wcn->started = false;
|
||||
wcn->power_params_offload = false;
|
||||
+ wcn->host_suspend_ind_sent = false;
|
||||
+ wcn->standby_bcast_mcast_filter = 0;
|
||||
mutex_unlock(&wcn->conf_mutex);
|
||||
|
||||
wcn36xx_debugfs_exit(wcn);
|
||||
@@ -463,8 +468,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (changed & IEEE80211_CONF_CHANGE_PS)
|
||||
- wcn36xx_change_ps(wcn, hw->conf.flags & IEEE80211_CONF_PS);
|
||||
+ if (changed & IEEE80211_CONF_CHANGE_PS) {
|
||||
+ bool ps = hw->conf.flags & IEEE80211_CONF_PS;
|
||||
+
|
||||
+ wcn36xx_change_ps(wcn, ps);
|
||||
+ if (ps && READ_ONCE(screen_off_offload))
|
||||
+ wcn36xx_sync_screen_off_offload(wcn, true);
|
||||
+ }
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_IDLE) {
|
||||
if (hw->conf.flags & IEEE80211_CONF_IDLE)
|
||||
@@ -710,6 +720,10 @@
|
||||
|
||||
mutex_unlock(&wcn->scan_lock);
|
||||
|
||||
+ mutex_lock(&wcn->conf_mutex);
|
||||
+ wcn36xx_exit_host_standby(wcn, true);
|
||||
+ mutex_unlock(&wcn->conf_mutex);
|
||||
+
|
||||
wcn36xx_smd_update_channel_list(wcn, &hw_req->req);
|
||||
return wcn36xx_smd_start_hw_scan(wcn, vif, &hw_req->req);
|
||||
}
|
||||
@@ -738,6 +752,10 @@
|
||||
struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
|
||||
|
||||
wcn36xx_dbg(WCN36XX_DBG_MAC, "sw_scan_start");
|
||||
+
|
||||
+ mutex_lock(&wcn->conf_mutex);
|
||||
+ wcn36xx_exit_host_standby(wcn, true);
|
||||
+ mutex_unlock(&wcn->conf_mutex);
|
||||
|
||||
wcn->sw_scan = true;
|
||||
wcn->sw_scan_vif = vif;
|
||||
@@ -892,6 +910,8 @@
|
||||
vif_priv->ns_offload_active = false;
|
||||
vif_priv->gtk_offload_active = false;
|
||||
vif_priv->rekey_data.valid = false;
|
||||
+ wcn36xx_exit_host_standby(wcn, true);
|
||||
+ wcn->standby_bcast_mcast_filter = 0;
|
||||
wcn->power_params_offload = false;
|
||||
wcn36xx_smd_delete_bss(wcn, vif);
|
||||
wcn36xx_smd_set_link_st(wcn, bss_conf->bssid, vif->addr,
|
||||
@@ -970,6 +990,8 @@
|
||||
vif_priv->ns_offload_active = false;
|
||||
vif_priv->gtk_offload_active = false;
|
||||
vif_priv->rekey_data.valid = false;
|
||||
+ wcn36xx_exit_host_standby(wcn, true);
|
||||
+ wcn->standby_bcast_mcast_filter = 0;
|
||||
wcn->power_params_offload = false;
|
||||
wcn36xx_smd_set_link_st(wcn,
|
||||
bss_conf->bssid,
|
||||
@@ -1161,6 +1183,17 @@
|
||||
return vif;
|
||||
}
|
||||
|
||||
+static void wcn36xx_exit_host_standby(struct wcn36xx *wcn, bool send_rpc)
|
||||
+{
|
||||
+ if (!wcn->host_suspend_ind_sent)
|
||||
+ return;
|
||||
+
|
||||
+ if (send_rpc && wcn->started)
|
||||
+ wcn36xx_smd_host_resume(wcn);
|
||||
+
|
||||
+ wcn->host_suspend_ind_sent = false;
|
||||
+}
|
||||
+
|
||||
static void wcn36xx_sync_screen_off_offload(struct wcn36xx *wcn, bool enable)
|
||||
{
|
||||
struct ieee80211_vif *vif;
|
||||
@@ -1170,9 +1203,13 @@
|
||||
if (!wcn->started)
|
||||
return;
|
||||
|
||||
- if (!enable && wcn->power_params_offload) {
|
||||
- wcn36xx_smd_set_power_params(wcn, false);
|
||||
- wcn->power_params_offload = false;
|
||||
+ if (!enable) {
|
||||
+ wcn36xx_exit_host_standby(wcn, true);
|
||||
+ wcn->standby_bcast_mcast_filter = 0;
|
||||
+ if (wcn->power_params_offload) {
|
||||
+ wcn36xx_smd_set_power_params(wcn, false);
|
||||
+ wcn->power_params_offload = false;
|
||||
+ }
|
||||
}
|
||||
|
||||
vif = wcn36xx_get_first_assoc_vif(wcn);
|
||||
@@ -1184,6 +1221,8 @@
|
||||
return;
|
||||
|
||||
if (enable) {
|
||||
+ u32 want_filter;
|
||||
+
|
||||
if (vif->cfg.arp_addr_cnt == 1 && !vif_priv->arp_offload_active) {
|
||||
if (!wcn36xx_smd_arp_offload(wcn, vif, true))
|
||||
vif_priv->arp_offload_active = true;
|
||||
@@ -1202,9 +1241,20 @@
|
||||
vif_priv->gtk_offload_active = true;
|
||||
}
|
||||
|
||||
- if (!wcn->power_params_offload) {
|
||||
+ want_filter = vif_priv->arp_offload_active ? 3 : 0;
|
||||
+ if (!wcn->power_params_offload ||
|
||||
+ wcn->standby_bcast_mcast_filter != want_filter) {
|
||||
+ if (!want_filter && wcn->host_suspend_ind_sent)
|
||||
+ wcn36xx_exit_host_standby(wcn, true);
|
||||
+ wcn->standby_bcast_mcast_filter = want_filter;
|
||||
if (!wcn36xx_smd_set_power_params(wcn, true))
|
||||
wcn->power_params_offload = true;
|
||||
+ }
|
||||
+
|
||||
+ if (want_filter == 3 && !wcn->host_suspend_ind_sent &&
|
||||
+ (wcn->hw->conf.flags & IEEE80211_CONF_PS)) {
|
||||
+ if (!wcn36xx_smd_wlan_host_suspend_ind(wcn))
|
||||
+ wcn->host_suspend_ind_sent = true;
|
||||
}
|
||||
} else {
|
||||
if (vif_priv->gtk_offload_active) {
|
||||
@@ -1483,7 +1483,7 @@ CONFIG_REGMAP_IRQ=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
# CONFIG_DMA_FENCE_TRACE is not set
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set
|
||||
CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y
|
||||
# end of Generic Driver Options
|
||||
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user