Skip to contentSkip to conversation

drivers: qcom: rpmh: avoid sending sleep/wake sets immediately

PATCH RESEND In review Raju P.L.S.S.S.N 3 participants 3 messages Oct 23, 2018 – Oct 24, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drivers: qcom: rpmh: avoid sending sleep/wake sets immediately

Fix the redundant call being made to send the sleep and wake requests immediately to the controller.

As per the patch[1], the sleep and wake request votes are cached in rpmh controller and sent during rpmh_flush(). These requests needs to be sent only during entry of deeper system low power modes or suspend.

[1]https://patchwork.kernel.org/patch/10477533/

---
 drivers/soc/qcom/rpmh.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/soc/qcom/rpmh.c +1 -2
index e6e98d4..877fe78 100644
@@ -228,9 +228,8 @@ static int __rpmh_write(const struct device *dev, enum rpmh_state state,
 		WARN_ON(irqs_disabled());
 		ret = rpmh_rsc_send_data(ctrlr_to_drv(ctrlr), &rpm_msg->msg);
 	} else {
-		ret = rpmh_rsc_write_ctrl_data(ctrlr_to_drv(ctrlr),
-				&rpm_msg->msg);
 		/* Clean up our call by spoofing tx_done */
+		ret = 0;
 		rpmh_tx_done(&rpm_msg->msg, ret);
 	}
 
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of the Code Aurora Forum, hosted by The Linux Foundation.
Reviewed-by on v1 1/1
#1 lore raw
Quoted 32 lines · Raju P.L.S.S.S.N

Fix the redundant call being made to send the sleep and wake requests immediately to the controller.

As per the patch[1], the sleep and wake request votes are cached in rpmh controller and sent during rpmh_flush(). These requests needs to be sent only during entry of deeper system low power modes or suspend.

[1]https://patchwork.kernel.org/patch/10477533/

---
 drivers/soc/qcom/rpmh.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/soc/qcom/rpmh.c +1 -3
index e6e98d4..877fe78 100644
@@ -228,9 +228,8 @@ static int __rpmh_write(const struct device *dev, enum rpmh_state state,
                WARN_ON(irqs_disabled());
                ret = rpmh_rsc_send_data(ctrlr_to_drv(ctrlr), &rpm_msg->msg);
        } else {
-               ret = rpmh_rsc_write_ctrl_data(ctrlr_to_drv(ctrlr),
-                               &rpm_msg->msg);
                /* Clean up our call by spoofing tx_done */
+               ret = 0;
                rpmh_tx_done(&rpm_msg->msg, ret);
        }
 
--
Quoted 3 lines

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation.

I think this makes sense to me, though the paths through here can be a little winding.

#2 lore raw
In reply to Raju P.L.S.S.S.N
Quoted 9 lines · Raju P.L.S.S.S.N

Fix the redundant call being made to send the sleep and wake requests immediately to the controller.

As per the patch[1], the sleep and wake request votes are cached in rpmh controller and sent during rpmh_flush(). These requests needs to be sent only during entry of deeper system low power modes or suspend.

[1]https://patchwork.kernel.org/patch/10477533/

nit: [1] https://

Quoted 25 lines

---
drivers/soc/qcom/rpmh.c | 3 +--

1 file changed, 1 insertion(+), 2 deletions(-)
drivers/soc/qcom/rpmh.c +1 -3
index e6e98d4..877fe78 100644
@@ -228,9 +228,8 @@ static int __rpmh_write(const struct device *dev, enum rpmh_state state,
 		WARN_ON(irqs_disabled());
 		ret = rpmh_rsc_send_data(ctrlr_to_drv(ctrlr), &rpm_msg->msg);
 	} else {
-		ret = rpmh_rsc_write_ctrl_data(ctrlr_to_drv(ctrlr),
-				&rpm_msg->msg);
 		/* Clean up our call by spoofing tx_done */
+		ret = 0;
 		rpmh_tx_done(&rpm_msg->msg, ret);
 	}
 
--

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation.