linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bus: mhi: core: Fix check for syserr at power_up
@ 2021-02-12 21:27 Jeffrey Hugo
  2021-02-15  7:25 ` Loic Poulain
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jeffrey Hugo @ 2021-02-12 21:27 UTC (permalink / raw)
  To: manivannan.sadhasivam, hemantk
  Cc: bbhatt, loic.poulain, linux-arm-msm, linux-kernel, Jeffrey Hugo

The check to see if we have reset the device after detecting syserr at
power_up is inverted.  wait_for_event_timeout() returns 0 on failure,
and a positive value on success.  The check is looking for non-zero
as a failure, which is likely to incorrectly cause a device init failure
if syserr was detected at power_up.  Fix this.

Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up")
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
---
 drivers/bus/mhi/core/pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
index 681960c..36ab7aa 100644
--- a/drivers/bus/mhi/core/pm.c
+++ b/drivers/bus/mhi/core/pm.c
@@ -1092,7 +1092,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
 							   &val) ||
 					!val,
 				msecs_to_jiffies(mhi_cntrl->timeout_ms));
-		if (ret) {
+		if (!ret) {
 			ret = -EIO;
 			dev_info(dev, "Failed to reset MHI due to syserr state\n");
 			goto error_bhi_offset;
-- 
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.


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

* Re: [PATCH] bus: mhi: core: Fix check for syserr at power_up
  2021-02-12 21:27 [PATCH] bus: mhi: core: Fix check for syserr at power_up Jeffrey Hugo
@ 2021-02-15  7:25 ` Loic Poulain
  2021-02-16  7:31 ` Manivannan Sadhasivam
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Loic Poulain @ 2021-02-15  7:25 UTC (permalink / raw)
  To: Jeffrey Hugo
  Cc: Manivannan Sadhasivam, Hemant Kumar, Bhaumik Bhatt,
	linux-arm-msm, open list

On Fri, 12 Feb 2021 at 22:27, Jeffrey Hugo <jhugo@codeaurora.org> wrote:
>
> The check to see if we have reset the device after detecting syserr at
> power_up is inverted.  wait_for_event_timeout() returns 0 on failure,
> and a positive value on success.  The check is looking for non-zero
> as a failure, which is likely to incorrectly cause a device init failure
> if syserr was detected at power_up.  Fix this.
>
> Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up")
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>

> ---
>  drivers/bus/mhi/core/pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
> index 681960c..36ab7aa 100644
> --- a/drivers/bus/mhi/core/pm.c
> +++ b/drivers/bus/mhi/core/pm.c
> @@ -1092,7 +1092,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
>                                                            &val) ||
>                                         !val,
>                                 msecs_to_jiffies(mhi_cntrl->timeout_ms));
> -               if (ret) {
> +               if (!ret) {
>                         ret = -EIO;
>                         dev_info(dev, "Failed to reset MHI due to syserr state\n");
>                         goto error_bhi_offset;
> --
> Qualcomm Technologies, Inc. is a member of the
> Code Aurora Forum, a Linux Foundation Collaborative Project.
>

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

* Re: [PATCH] bus: mhi: core: Fix check for syserr at power_up
  2021-02-12 21:27 [PATCH] bus: mhi: core: Fix check for syserr at power_up Jeffrey Hugo
  2021-02-15  7:25 ` Loic Poulain
@ 2021-02-16  7:31 ` Manivannan Sadhasivam
  2021-03-10 14:11 ` Manivannan Sadhasivam
  2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2021-02-16  7:31 UTC (permalink / raw)
  To: Jeffrey Hugo; +Cc: hemantk, bbhatt, loic.poulain, linux-arm-msm, linux-kernel

On Fri, Feb 12, 2021 at 02:27:23PM -0700, Jeffrey Hugo wrote:
> The check to see if we have reset the device after detecting syserr at
> power_up is inverted.  wait_for_event_timeout() returns 0 on failure,
> and a positive value on success.  The check is looking for non-zero
> as a failure, which is likely to incorrectly cause a device init failure
> if syserr was detected at power_up.  Fix this.
> 
> Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up")
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/bus/mhi/core/pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
> index 681960c..36ab7aa 100644
> --- a/drivers/bus/mhi/core/pm.c
> +++ b/drivers/bus/mhi/core/pm.c
> @@ -1092,7 +1092,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
>  							   &val) ||
>  					!val,
>  				msecs_to_jiffies(mhi_cntrl->timeout_ms));
> -		if (ret) {
> +		if (!ret) {
>  			ret = -EIO;
>  			dev_info(dev, "Failed to reset MHI due to syserr state\n");
>  			goto error_bhi_offset;
> -- 
> Qualcomm Technologies, Inc. is a member of the
> Code Aurora Forum, a Linux Foundation Collaborative Project.
> 

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

* Re: [PATCH] bus: mhi: core: Fix check for syserr at power_up
  2021-02-12 21:27 [PATCH] bus: mhi: core: Fix check for syserr at power_up Jeffrey Hugo
  2021-02-15  7:25 ` Loic Poulain
  2021-02-16  7:31 ` Manivannan Sadhasivam
@ 2021-03-10 14:11 ` Manivannan Sadhasivam
  2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2021-03-10 14:11 UTC (permalink / raw)
  To: Jeffrey Hugo; +Cc: hemantk, bbhatt, loic.poulain, linux-arm-msm, linux-kernel

On Fri, Feb 12, 2021 at 02:27:23PM -0700, Jeffrey Hugo wrote:
> The check to see if we have reset the device after detecting syserr at
> power_up is inverted.  wait_for_event_timeout() returns 0 on failure,
> and a positive value on success.  The check is looking for non-zero
> as a failure, which is likely to incorrectly cause a device init failure
> if syserr was detected at power_up.  Fix this.
> 
> Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up")
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>

Applied to mhi-next!

Thanks,
Mani

> ---
>  drivers/bus/mhi/core/pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
> index 681960c..36ab7aa 100644
> --- a/drivers/bus/mhi/core/pm.c
> +++ b/drivers/bus/mhi/core/pm.c
> @@ -1092,7 +1092,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
>  							   &val) ||
>  					!val,
>  				msecs_to_jiffies(mhi_cntrl->timeout_ms));
> -		if (ret) {
> +		if (!ret) {
>  			ret = -EIO;
>  			dev_info(dev, "Failed to reset MHI due to syserr state\n");
>  			goto error_bhi_offset;
> -- 
> Qualcomm Technologies, Inc. is a member of the
> Code Aurora Forum, a Linux Foundation Collaborative Project.
> 

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

* Re: [PATCH] bus: mhi: core: Fix check for syserr at power_up
  2021-02-12 21:27 [PATCH] bus: mhi: core: Fix check for syserr at power_up Jeffrey Hugo
                   ` (2 preceding siblings ...)
  2021-03-10 14:11 ` Manivannan Sadhasivam
@ 2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-05-26 19:03 UTC (permalink / raw)
  To: Jeffrey Hugo; +Cc: linux-arm-msm

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Fri, 12 Feb 2021 14:27:23 -0700 you wrote:
> The check to see if we have reset the device after detecting syserr at
> power_up is inverted.  wait_for_event_timeout() returns 0 on failure,
> and a positive value on success.  The check is looking for non-zero
> as a failure, which is likely to incorrectly cause a device init failure
> if syserr was detected at power_up.  Fix this.
> 
> Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up")
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> 
> [...]

Here is the summary with links:
  - bus: mhi: core: Fix check for syserr at power_up
    https://git.kernel.org/qcom/c/6403298c58d4

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-05-26 19:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12 21:27 [PATCH] bus: mhi: core: Fix check for syserr at power_up Jeffrey Hugo
2021-02-15  7:25 ` Loic Poulain
2021-02-16  7:31 ` Manivannan Sadhasivam
2021-03-10 14:11 ` Manivannan Sadhasivam
2021-05-26 19:03 ` patchwork-bot+linux-arm-msm

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).