linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] drivers: qcom: Fixes in RPMh driver
@ 2019-02-21 12:40 Raju P.L.S.S.S.N
  2019-02-21 12:40 ` [PATCH v1 1/2] drivers: qcom: rpmh: avoid sending sleep/wake sets immediately Raju P.L.S.S.S.N
  2019-02-21 12:40 ` [PATCH v1 2/2] drivers: soc: qcom: rpmh-rsc: Correct check for slot number Raju P.L.S.S.S.N
  0 siblings, 2 replies; 4+ messages in thread
From: Raju P.L.S.S.S.N @ 2019-02-21 12:40 UTC (permalink / raw)
  To: andy.gross, david.brown, linux-arm-msm, linux-soc
  Cc: rnayak, bjorn.andersson, linux-kernel, linux-pm, sboyd, evgreen,
	dianders, mka, ilina, Raju P.L.S.S.S.N

Hi,

This series consists of couple of fixes identified in RPMh driver.
Please consider reviewing the patches.


Maulik Shah (1):
  drivers: soc: qcom: rpmh-rsc: Correct check for slot number

Raju P.L.S.S.S.N (1):
  drivers: qcom: rpmh: avoid sending sleep/wake sets immediately

 drivers/soc/qcom/rpmh-rsc.c | 2 +-
 drivers/soc/qcom/rpmh.c     | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/2] drivers: qcom: rpmh: avoid sending sleep/wake sets immediately
  2019-02-21 12:40 [PATCH v1 0/2] drivers: qcom: Fixes in RPMh driver Raju P.L.S.S.S.N
@ 2019-02-21 12:40 ` Raju P.L.S.S.S.N
  2019-02-21 12:40 ` [PATCH v1 2/2] drivers: soc: qcom: rpmh-rsc: Correct check for slot number Raju P.L.S.S.S.N
  1 sibling, 0 replies; 4+ messages in thread
From: Raju P.L.S.S.S.N @ 2019-02-21 12:40 UTC (permalink / raw)
  To: andy.gross, david.brown, linux-arm-msm, linux-soc
  Cc: rnayak, bjorn.andersson, linux-kernel, linux-pm, sboyd, evgreen,
	dianders, mka, ilina, 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/

Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Reviewed-by: Lina Iyer <ilina@codeaurora.org>
Reviewed-by: Evan Green <evgreen@chromium.org>
---
 drivers/soc/qcom/rpmh.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c
index e6e98d461121..877fe78199a3 100644
--- a/drivers/soc/qcom/rpmh.c
+++ b/drivers/soc/qcom/rpmh.c
@@ -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.


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1 2/2] drivers: soc: qcom: rpmh-rsc: Correct check for slot number
  2019-02-21 12:40 [PATCH v1 0/2] drivers: qcom: Fixes in RPMh driver Raju P.L.S.S.S.N
  2019-02-21 12:40 ` [PATCH v1 1/2] drivers: qcom: rpmh: avoid sending sleep/wake sets immediately Raju P.L.S.S.S.N
@ 2019-02-21 12:40 ` Raju P.L.S.S.S.N
  2019-02-21 15:24   ` Lina Iyer
  1 sibling, 1 reply; 4+ messages in thread
From: Raju P.L.S.S.S.N @ 2019-02-21 12:40 UTC (permalink / raw)
  To: andy.gross, david.brown, linux-arm-msm, linux-soc
  Cc: rnayak, bjorn.andersson, linux-kernel, linux-pm, sboyd, evgreen,
	dianders, mka, ilina, Maulik Shah, Raju P . L . S . S . S . N

From: Maulik Shah <mkshah@codeaurora.org>

The return index value from bitmap_find_next_zero_area can be higher
than available slot. So correct the check to return error in such case.

Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
---
 drivers/soc/qcom/rpmh-rsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index 10b3102298c7..3ff3bebd4d71 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -491,7 +491,7 @@ static int find_slots(struct tcs_group *tcs, const struct tcs_request *msg,
 	do {
 		slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS,
 						  i, msg->num_cmds, 0);
-		if (slot == tcs->num_tcs * tcs->ncpt)
+		if (slot >= tcs->num_tcs * tcs->ncpt)
 			return -ENOMEM;
 		i += tcs->ncpt;
 	} while (slot + msg->num_cmds - 1 >= i);
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of the Code Aurora Forum, hosted by The Linux Foundation.


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 2/2] drivers: soc: qcom: rpmh-rsc: Correct check for slot number
  2019-02-21 12:40 ` [PATCH v1 2/2] drivers: soc: qcom: rpmh-rsc: Correct check for slot number Raju P.L.S.S.S.N
@ 2019-02-21 15:24   ` Lina Iyer
  0 siblings, 0 replies; 4+ messages in thread
From: Lina Iyer @ 2019-02-21 15:24 UTC (permalink / raw)
  To: Raju P.L.S.S.S.N
  Cc: andy.gross, david.brown, linux-arm-msm, linux-soc, rnayak,
	bjorn.andersson, linux-kernel, linux-pm, sboyd, evgreen,
	dianders, mka, Maulik Shah

On Thu, Feb 21 2019 at 05:42 -0700, Raju P.L.S.S.S.N wrote:
>From: Maulik Shah <mkshah@codeaurora.org>
>
>The return index value from bitmap_find_next_zero_area can be higher
>than available slot. So correct the check to return error in such case.
>
>Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
>Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Reviewed-by: Lina Iyer <ilina@codeaurora.org>
>---
> drivers/soc/qcom/rpmh-rsc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
>index 10b3102298c7..3ff3bebd4d71 100644
>--- a/drivers/soc/qcom/rpmh-rsc.c
>+++ b/drivers/soc/qcom/rpmh-rsc.c
>@@ -491,7 +491,7 @@ static int find_slots(struct tcs_group *tcs, const struct tcs_request *msg,
> 	do {
> 		slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS,
> 						  i, msg->num_cmds, 0);
>-		if (slot == tcs->num_tcs * tcs->ncpt)
>+		if (slot >= tcs->num_tcs * tcs->ncpt)
> 			return -ENOMEM;
> 		i += tcs->ncpt;
> 	} while (slot + msg->num_cmds - 1 >= i);
>--
>QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
>of the Code Aurora Forum, hosted by The Linux Foundation.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-21 15:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 12:40 [PATCH v1 0/2] drivers: qcom: Fixes in RPMh driver Raju P.L.S.S.S.N
2019-02-21 12:40 ` [PATCH v1 1/2] drivers: qcom: rpmh: avoid sending sleep/wake sets immediately Raju P.L.S.S.S.N
2019-02-21 12:40 ` [PATCH v1 2/2] drivers: soc: qcom: rpmh-rsc: Correct check for slot number Raju P.L.S.S.S.N
2019-02-21 15:24   ` Lina Iyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).